#Unix Makefile for the C example programs of #"CGI Programming in C and Perl." Copyright 1995, 1996, Addison-Wesley. #For this to work, cgic104 and gd1_2 must be in adjacent #directories. For best results cp -r the entire #contents of the /source subdirectory of the CD-ROM #to your drive. #BE SURE TO MAKE ANY REQUIRED CHANGES TO THE SOURCE #before compiling various programs. # #To compile a particular program, type "make programname". #Change this to the ANSI C compiler on your system if you do not have gcc. #You must have an ANSI C compiler. gcc is freely available for most systems. CC=gcc all: @echo Please type \"make programname\" to compile individual programs. @echo Be sure to make any required changes to the source code @echo of each program before compiling. #Ensure that libgd.a and libcgic.a are available. libs: ../gd1_2/libgd.a ../cgic104/libcgic.a cd ../gd1_2; make libgd.a cd ../cgic104; make libcgic.a #Ensure that there are no paths requiring modification #in the source code of a program before agreeing to compile it. checkpaths: @echo NOTE: this program contains paths and/or URLs which @echo must be set to reasonable paths and URLs on your system @echo before it will work properly. See the source code and @echo the relevant chapter of the book for details. #Any additional directories in which libraries will be found LIBDIRS=-L../gd1_2 -L../cgic104 #Any additional directories in which include files will be found INCLUDEDIRS=-I../gd1_2 -I../cgic104 #Rule to create object files from C source files .c.o: $< ${CC} $< ${CFLAGS} ${INCLUDEDIRS} -c #Libraries to be linked against: gd, cgic, and the standard math library LIBS=-lgd -lcgic -lm #Rules to create each target from the object files that compose it mag: checkpaths libs mag.o ${CC} mag.o -o mag ${LIBDIRS} ${LIBS} cgipull: checkpaths libs cgipull.o ${CC} cgipull.o -o cgipull ${LIBDIRS} ${LIBS} nph-push: checkpaths libs nph-push.o ${CC} nph-push.o -o nph-push ${LIBDIRS} ${LIBS} nph-p2: checkpaths libs nph-p2.o ${CC} nph-p2.o -o nph-p2 ${LIBDIRS} ${LIBS} nph-sss: checkpaths libs nph-sss.o ${CC} nph-sss.o -o nph-sss ${LIBDIRS} ${LIBS} simtrade: checkpaths simtrade.o parse.o ${CC} simtrade.o parse.o -o simtrade trade: checkpaths libs trade.o parse.o chart.o ${CC} trade.o parse.o chart.o -o trade ${LIBDIRS} ${LIBS} circle: libs circle.o ${CC} circle.o -o circle ${LIBDIRS} ${LIBS} gdshort: libs gdshort.o ${CC} gdshort.o -o gdshort ${LIBDIRS} ${LIBS} bugrep: checkpaths libs bugrep.o ${CC} bugrep.o -o bugrep ${LIBDIRS} ${LIBS} wbw1: checkpaths wbw1.o ${CC} wbw1.o -o wbw1 wbw2: checkpaths libs wbw2.o ${CC} wbw2.o -o wbw2 ${LIBDIRS} ${LIBS} cgicmnts: checkpaths libs cgicmnts.o ${CC} cgicmnts.o -o cgicmnts ${LIBDIRS} ${LIBS} hello: hello.o ${CC} hello.o -o hello testc: libs chart.o testc.o ${CC} testc.o chart.o -o testc ${LIBDIRS} ${LIBS} cgictest: libs cgictest.o ${CC} cgictest.o -o cgictest ${LIBDIRS} ${LIBS} comments: checkpaths comments.o ${CC} comments.o -o comments dimage: checkpaths dimage.o ${CC} dimage.o -o dimage refimage: checkpaths refimage.o ${CC} refimage.o -o refimage