# Installation directories: INSTALLDIR = INSTALLDIR_IS_UNDEFINED INC = $(INSTALLDIR)/gcc/include LIB = $(INSTALLDIR)/lib # User must define FUNCTION externally. FUNCTION = FUNCTION_IS_UNDEFINED HFILES = \ fltgraph.h \ aagraph.h HOFILES = \ fltgraph.ho \ aagraph.ho OFILES = \ fltgraph.o \ aagraph.o PROG = \ $(FUNCTION)-plottest PSFILE = \ $(FUNCTION)-plottest.ps MAINOBJ = \ $(PROG).o LIBS = \ $(LIB)/libps.a \ $(LIB)/libaa.a \ $(LIB)/libia.a \ $(LIB)/libflt.a \ $(LIB)/libjs.a GCCFLAGS = \ -I$(INC) \ -g \ -ansi \ -Wall -Wtraditional -Wpointer-arith -Wmissing-prototypes \ -mfpu all: cleanup $(PSFILE) cleanup: ;\ /bin/rm -f *.o *.a *.ho $(PROG) $(PSFILE) $(PROG).c: $(FUNCTION).c plottest-preamble.c plottest-postamble.c ;\ echo '#include "plottest-preamble.c"' > $(PROG).c &&\ echo '#include "$(FUNCTION).c"' >> $(PROG).c &&\ echo '#include "plottest-postamble.c"' >> $(PROG).c %.o: %.c ;\ gcc -c $(GCCFLAGS) $*.c %.ho: %.h ;\ v gcc -o $*.ho -c $(GCCFLAGS) -x c $*.h \ || /bin/rm -f $*.ho $(PROG): $(OFILES) $(MAINOBJ) $(LIBS) ;\ gcc -pg -o $(PROG) $(MAINOBJ) $(OFILES) $(LIBS) -lm $(PSFILE): $(PROG) ;\ $(PROG) # Dependencies of .h files: fltgraph.ho:: fltgraph.h $(INC)/flt.ho $(INC)/ia.ho aagraph.ho:: aagraph.h $(INC)/aa.ho $(INC)/flt.ho $(INC)/ia.ho # Dependencies for .c files: fltgraph.o:: fltgraph.c fltgraph.ho \ $(INC)/js.ho $(INC)/flt.ho $(INC)/ia.ho $(INC)/ps.ho aagraph.o:: aagraph.c aagraph.ho fltgraph.ho \ $(INC)/js.ho $(INC)/flt.ho $(INC)/ia.ho $(INC)/aa.ho $(INC)/ps.ho $(PROG).o:: $(PROG).c aagraph.ho fltgraph.ho \ $(INC)/aa.ho $(INC)/ia.ho $(INC)/flt.ho \ $(INC)/js.ho $(INC)/ioprotos.ho