# Floating-point hacks # Last edited on 2004-11-02 21:38:03 by stolfi INC = /home/staff/stolfi/PUB/include LIB = /home/staff/stolfi/PUB/${PLATFORM}/lib LSP = /home/staff/stolfi/PUB/lisp/lib BIN = /home/staff/stolfi/PUB/${PLATFORM}/bin # Determine major platform for C compilation IS_LINUX := $(findstring Linux,${PLATFORM}) IS_SUNIV := $(findstring SunOS-4,${PLATFORM}) IS_SUNV := $(findstring SunOS-5,${PLATFORM}) IS_OSFIV := $(findstring OSF1-V4,${PLATFORM}) PLATF := $(subst -,,${IS_LINUX}${IS_SUNIV}${IS_SUNV}${IS_OSFIV}) MDEP = machine-dep/${PLATFORM} HFILES := \ flt.h \ pcode.h \ flteval.h HOFILES := \ flt.ho \ pcode.ho \ flteval.ho OFILES := \ flt.o \ pcode.o \ flteval.o MDEPOFILES = \ ${MDEP}/fltasm.o \ LISPFILES = \ expr-to-pcode.lsp SCRIPTS = \ expr-to-pcode LIBFILE = \ libflt.a .PHONY: all clean uninstall mdep install test all: clean uninstall install # all: uninstall clean install test # all: test uninstall: cd ${INC} && /bin/rm -f ${HFILES} ${HOFILES} cd ${LIB} && /bin/rm -f ${LIBFILE} cd ${LSP} && /bin/rm -f ${LISPFILES} cd ${BIN} && /bin/rm -f ${SCRIPTS} install: ${HOFILES} ${LIBFILE} ${LISPFILES} ${SCRIPTS} cp -p ${HFILES} ${INC} cp ${HOFILES} ${INC} cp -p ${LIBFILE} ${LIB} cp -p ${LISPFILES} ${LSP} cp -p ${SCRIPTS} ${BIN} mdep: cd ${MDEP} && make PLATF=${PLATF} all test: cd tests && make PLATF=${PLATF} all clean: /bin/rm -f *.o *.ho *.a core cd ${MDEP} && make clean cd tests && make clean GCCFLAGS = \ -D${PLATF} \ -I. -I${INC} \ -g \ -ansi -pedantic \ -Wall -Wpointer-arith -Wmissing-prototypes %.o: %.c ;\ gcc -c ${GCCFLAGS} $*.c %.ho: %.h ;\ gcc -o $*.ho -c ${GCCFLAGS} -x c $*.h \ || /bin/rm -f $*.ho ${LIBFILE}: ${OFILES} mdep ;\ rm -f $*.a && ar crv $*.a ${OFILES} ${MDEPOFILES} && ranlib $*.a # Dependencies of .ho files: flt.ho:: flt.h pcode.ho:: pcode.h flteval.ho:: flteval.h flt.ho pcode.ho # Dependencies of .o files: flt.o:: flt.c flt.ho ${INC}/js.ho ${INC}/ioprotos.ho pcode.o:: pcode.c pcode.ho ${INC}/js.ho ${INC}/ioprotos.ho flteval.o:: flteval.c flteval.ho flt.ho pcode.ho \ ${INC}/js.ho ${INC}/ioprotos.ho