#
# makefile for SMLNJ-Math function library
# win32 specific

SHELL =

INC_DIR =	..\..\include
CLIB_DIR =	..\.
MACH_DIR = 	..\..\mach-dep

INCLUDES =	/I$(INC_DIR) /I$(CLIB_DIR) /I$(MACH_DIR) /I..\..\objs

MAKEFILE =	makefile.win32
MAKE =		nmake /F$(MAKEFILE)
AR =		lib
ARFLAGS =	
RANLIB =	lib

LIBRARY =	libsmlnj-math.lib

VERSION =	v-dummy

OBJS =		smlnj-math-lib.obj \
		ctlrndmode.obj \
		atan64.obj \
		cos64.obj \
		exp64.obj \
		log64.obj \
		sin64.obj \
		sqrt64.obj

$(LIBRARY)	: $(VERSION) $(OBJS)
	del /F /Q $(LIBRARY)
	$(AR) $(ARFLAGS) /out:$(LIBRARY) $(OBJS)
	$(RANLIB) /out:$(LIBRARY)

$(VERSION) :
	($(MAKE) MAKE="$(MAKE)" clean)
	echo "$(VERSION)" > $(VERSION)

smlnj-math-lib.obj: smlnj-math-lib.c \
		$(INC_DIR)\ml-base.h \
		$(INC_DIR)\c-library.h \
		cfun-proto-list.h cfun-list.h
		$(CC) $(CFLAGS) $(DEFS) $(INCLUDES) /c smlnj-math-lib.c

ctlrndmode.obj: ctlrndmode.c \
		$(INC_DIR)\ml-base.h \
		$(INC_DIR)\ml-objects.h \
		fp-dep.h cfun-proto-list.h
		$(CC) $(CFLAGS) $(DEFS) $(INCLUDES) /c ctlrndmode.c

atan64.obj: atan64.c \
		$(INC_DIR)\ml-base.h $(INC_DIR)\ml-values.h \
		$(INC_DIR)\ml-objects.h \
		cfun-proto-list.h
		$(CC) $(CFLAGS) $(DEFS) $(INCLUDES) /c atan64.c

cos64.obj: cos64.c \
		$(INC_DIR)\ml-base.h $(INC_DIR)\ml-values.h \
		$(INC_DIR)\ml-objects.h \
		cfun-proto-list.h
		$(CC) $(CFLAGS) $(DEFS) $(INCLUDES) /c cos64.c

exp64.obj: exp64.c \
		$(INC_DIR)\ml-base.h $(INC_DIR)\ml-values.h \
		$(INC_DIR)\ml-objects.h \
		cfun-proto-list.h
		$(CC) $(CFLAGS) $(DEFS) $(INCLUDES) /c exp64.c

log64.obj: log64.c \
		$(INC_DIR)\ml-base.h $(INC_DIR)\ml-values.h \
		$(INC_DIR)\ml-objects.h \
		cfun-proto-list.h
		$(CC) $(CFLAGS) $(DEFS) $(INCLUDES) /c log64.c

sin64.obj: sin64.c \
		$(INC_DIR)\ml-base.h $(INC_DIR)\ml-values.h \
		$(INC_DIR)\ml-objects.h \
		cfun-proto-list.h
		$(CC) $(CFLAGS) $(DEFS) $(INCLUDES) /c sin64.c

sqrt64.obj: sqrt64.c \
		$(INC_DIR)\ml-base.h $(INC_DIR)\ml-values.h \
		$(INC_DIR)\ml-objects.h \
		cfun-proto-list.h
		$(CC) $(CFLAGS) $(DEFS) $(INCLUDES) /c sqrt64.c

clean :
	del /F /Q v-* *.obj *.pdb $(LIBRARY)

