# Makefile for compiling PoZeTools version 0.52. # Pieter Suurmond, march 31, 2005. # Should work on Linux, freeBSD, Mac OSX, SGI IRIX, etc. # Names of the 4 executable binaries: PRG_CONSOLE = PZT PRG_CGI = cgi/nph-PZT.cgi PRG_CGI_FREQ = cgi/nph-freq.cgi.jpg PRG_CGI_TIME = cgi/nph-time.cgi.jpg # Simly type 'make' to only build the commandline application: default: $(PRG_CONSOLE) # Type 'make cgi' to only build the 3 CGI executables (for # an online filter design service on your UNIX-webserver): cgi: $(PRG_CGI) $(PRG_CGI_FREQ) $(PRG_CGI_TIME) # Type 'make all' to compile all the PoZeTools binaries: all: $(PRG_CONSOLE) $(PRG_CGI) $(PRG_CGI_FREQ) $(PRG_CGI_TIME) #------------------------------------------------------------------------------- # Compiler: CC = gcc # CC = cc # GCC flags (-g = debug; -Wall = show all warnings): CFLAGS = -O2 -Wall # MIPS flags: # CFLAGS = -O2 -fullwarn # Math-library: LIBS = -lm #------------------------------------------------------------------------------- # Explicit rules for objects that need to include header from subdirectory 'gt'. PZT_graph.o: PZT_graph.c PZT_graph.h gt/gt.h Makefile $(CC) $(CFLAGS) -Igt -c PZT_graph.c -o PZT_graph.o PZT_poze_graph.o: PZT_poze_graph.c PZT_poze_graph.h gt/gt.h Makefile $(CC) $(CFLAGS) -Igt -c PZT_poze_graph.c -o PZT_poze_graph.o PZT_coeff_graph.o: PZT_coeff_graph.c PZT_coeff_graph.h gt/gt.h Makefile $(CC) $(CFLAGS) -Igt -c PZT_coeff_graph.c -o PZT_coeff_graph.o #------------------------------------------------------------------------------- # Some ancient versions of 'make' don't understand that the objects 'gt.o' and # 'pieter_cgi.o' are meant to be placed in their subdirectories ('gt' and 'cgi') # during compilation. The newer (GNU) 'makes' understand this, but here, we # explicitly instruct old 'makes' to do so. Neither of them needs the math-lib. gt/gt.o: gt/gt.c gt/gt.h Makefile $(CC) $(CFLAGS) -c gt/gt.c -o gt/gt.o cgi/pieter_cgi.o: cgi/pieter_cgi.c cgi/pieter_cgi.h Makefile $(CC) $(CFLAGS) -c cgi/pieter_cgi.c -o cgi/pieter_cgi.o #------------------------------------------------------------------------------- # Rule to build the commandline application. Needs to link against math library. OBJ_CONSOLE = PZT_coeff.o \ PZT_coeff_graph.o \ PZT_complex_math.o \ PZT_complex_text.o \ PZT_graph.o PZT_poze.o \ PZT_poze_graph.o \ gt/gt.o HDR_CONSOLE = $(OBJ_CONSOLE:.o=.h) PZT.h $(PRG_CONSOLE): $(PRG_CONSOLE).c Makefile $(OBJ_CONSOLE) $(HDR_CONSOLE) $(CC) $(CFLAGS) $(PRG_CONSOLE).c $(OBJ_CONSOLE) $(LIBS) -o $(PRG_CONSOLE) strip $(PRG_CONSOLE) #------------------------------------------------------------------------------- # Rules to build the 3 CGI executables in subdirectory 'cgi/'. They all need to # include a header from the (relative) parent directory (-I./ below). The author # prefers it this way, above putting system dependant(!) pathnames in #includes. OBJ_CGI = PZT_coeff.o \ PZT_complex_math.o \ PZT_complex_text.o \ PZT_poze.o \ cgi/pieter_cgi.o HDR_CGI = $(OBJ_CGI:.o=.h) PZT.h $(PRG_CGI): $(PRG_CGI).c Makefile $(OBJ_CGI) $(HDR_CGI) $(CC) $(CFLAGS) $(PRG_CGI).c -I./ $(OBJ_CGI) $(LIBS) -o $(PRG_CGI) strip $(PRG_CGI) # And these latter two also need to find graphic toolkit header '../gt/gt.h'. OBJ_CGI_FREQ = PZT_complex_math.o \ PZT_complex_text.o \ PZT_graph.o \ PZT_poze.o \ PZT_poze_graph.o \ gt/gt.o HDR_CGI_FREQ = $(OBJ_CGI_FREQ:.o=.h) PZT.h $(PRG_CGI_FREQ): $(PRG_CGI_FREQ).c Makefile $(OBJ_CGI_FREQ) $(HDR_CGI_FREQ) $(CC) $(CFLAGS) $(PRG_CGI_FREQ).c -I./ -I./gt $(OBJ_CGI_FREQ) $(LIBS) -o $(PRG_CGI_FREQ) strip $(PRG_CGI_FREQ) OBJ_CGI_TIME = PZT_coeff.o \ PZT_coeff_graph.o \ PZT_complex_math.o \ PZT_complex_text.o \ PZT_graph.o \ PZT_poze.o \ gt/gt.o HDR_CGI_TIME = $(OBJ_CGI_TIME:.o=.h) PZT.h $(PRG_CGI_TIME): $(PRG_CGI_TIME).c Makefile $(OBJ_CGI_TIME) $(HDR_CGI_TIME) $(CC) $(CFLAGS) $(PRG_CGI_TIME).c -I./ -I./gt $(OBJ_CGI_TIME) $(LIBS) -o $(PRG_CGI_TIME) strip $(PRG_CGI_TIME) #------------------------------------------------------------------------------- # Only keep the sources. clean: -rm $(PRG_CONSOLE) $(PRG_CGI) $(PRG_CGI_FREQ) $(PRG_CGI_TIME) -rm *.o cgi/*.o gt/*.o -rm *.jpg core #------------------------------------------------------------------------------- # On SGI IRIX, these AppleTalk Xinet files may become very annoying. # Here is how to delete them from the PoZeTools distribution. cleanAT: find ./ -name .HSancillary -print -ok rm {} \; find ./ -name .HSResource -print -ok rm -R {} \;