# Makefile for Mac OS X gwnum library
#

ENVP= MACOSX_DEPLOYMENT_TARGET=10.3

CC = gcc
CFLAGS = -I.. -I../sqlite-amalgamation-3180000 -O2 -m32 -march=i686 -fno-exceptions
CFLAGSD = -I.. -I../sqlite-amalgamation-3180000 -g -DGDEBUG -m32 -march=i686 -fno-exceptions
CFLAGS64 = -I.. -I../sqlite-amalgamation-3180000 -O2 -DX86_64 -m64 -fno-exceptions
CFLAGS64D = -I.. -I../sqlite-amalgamation-3180000 -g -DGDEBUG -DX86_64 -m64 -fno-exceptions

CPP = g++
CPPFLAGS = -I.. -I../qd -O2 -m32 -march=i686 -fno-exceptions -fno-rtti -Wno-stdlibcxx-not-found
CPPFLAGSD = -I.. -I../qd -g -DGDEBUG -m32 -march=i686 -fno-exceptions -fno-rtti -Wno-stdlibcxx-not-found
CPPFLAGS64 = -I.. -I../qd -O2 -DX86_64 -m64 -fno-exceptions -fno-rtti -Wno-stdlibcxx-not-found
CPPFLAGS64D = -I.. -I../qd -g -DGDEBUG -DX86_64 -m64 -fno-exceptions -fno-rtti -Wno-stdlibcxx-not-found

AR = ar

MACOBJS = cpuid.o gwnum.o gwtables.o gwthread.o gwini.o gwbench.o gwutil.o gwdbldbl.o giants.o radix.o ecmstag1.o

LIB = gwnum.a

#########################################################################

$(LIB): $(MACOBJS)
	cp macosx64/gwnum.a .
	$(AR) -rs $(LIB) $(MACOBJS)

clean:
	rm -f $(MACOBJS)

distclean: clean
	rm -f $(LIB)

.c.o:
	$(ENVP) $(CC) $(CFLAGS64) -c $<

.cpp.o:
	$(ENVP) $(CPP) $(CPPFLAGS64) -c $<

