# Make file for URAT1 code
#
# Usage: make [CLANG=Y] [XCOMPILE=Y] [MSWIN=Y] [tgt]
#
#	where tgt can be any of:
# [all|urat1_t|clean]
#
#	'XCOMPILE' = cross-compile for Windows,  using MinGW,  on a Linux box
#	'MSWIN' = compile for Windows,  using MinGW,  on a Windows machine
#	'CLANG' = use clang instead of GCC;  Linux only
# None of these: compile using gcc on Linux,  for Linux

# Set Linux defaults...
CC=gcc
CFLAGS=-O3 -Wall -Wextra -pedantic
LIBSADDED=
EXE=
OBJSADDED=
RM=rm -f
# ...then override them as needed:

ifdef CLANG
	CC=clang
endif

ifdef MSWIN
	EXE=.exe
endif

ifdef XCOMPILE
	CC=x86_64-w64-mingw32-gcc
	EXE=.exe
endif

all: urat1_t$(EXE)


urat1_t$(EXE): urat1_t.c urat1.c urat1.h
	$(CC) $(CFLAGS) -o urat1_t$(EXE) urat1_t.c urat1.c

clean:
	$(RM) urat1_t$(EXE)
