PNMLIB = -L../libpnm -lpnm DEPPNMLIB = ../libpnm/libpnm.a BINS = $(PBMBINS) $(PGMBINS) $(PPMBINS) $(PNMBINS) OBJS = $(PBMOBJS) $(PGMOBJS) $(PPMOBJS) $(PNMOBJS) SCRIPTS = $(PBMSCRIPTS) $(PGMSCRIPTS) $(PPMSCRIPTS) $(PNMSCRIPTS) MANS1 = $(BINS) $(SCRIPTS) pbmextras binaries: $(BINS) install.bin: binaries -mkdir $(INSTBINS) cd $(INSTBINS) ; rm -f $(BINS) cp $(BINS) $(INSTBINS) merge: pbmextras pbmextras: pbmextras.c $(OBJS) $(DEPPNMLIB) $(CC) $(ALLCFLAGS) $(ALLLDFLAGS) -o $@ $@.c $(OBJS) $(PNMLIB) -lm install.merge: merge -mkdir $(INSTBINS) cd $(INSTBINS) ; rm -f $(BINS) cp pbmextras $(INSTBINS) cd $(INSTBINS) ; for i in $(BINS) ; do ln pbmextras $$i ; done rm -f $(INSTBINS)/pbmextras install.scripts: -mkdir $(INSTSCRIPTS) cd $(INSTSCRIPTS) ; rm -f $(SCRIPTS) cp $(SCRIPTS) $(INSTSCRIPTS) cd $(INSTSCRIPTS) ; chmod +x $(SCRIPTS) install.man: for i in $(MANS1) ; do \ rm -f $(INSTMANS1)/$$i.$(SUFFMANS1) ; \ $(MANCP) $$i.1 $(INSTMANS1)/$$i.$(SUFFMANS1) ; \ done clean: rm -f *.o core $(BINS) pbmextras # Rules for binaries. $(PBMBINS) NULL1: ../inc/pbmplus.h ../inc/pbm.h $(DEPPNMLIB) $(CC) $(ALLCFLAGS) $(ALLLDFLAGS) -o $@ $@.c $(PNMLIB) -lm $(PGMBINS) NULL2: ../inc/pbmplus.h ../inc/pbm.h ../inc/pgm.h $(DEPPNMLIB) $(CC) $(ALLCFLAGS) $(ALLLDFLAGS) -o $@ $@.c $(PNMLIB) -lm $(PPMBINS) NULL3: ../inc/pbmplus.h ../inc/pbm.h ../inc/pgm.h ../inc/ppm.h $(DEPPNMLIB) $(CC) $(ALLCFLAGS) $(ALLLDFLAGS) -o $@ $@.c $(PNMLIB) -lm $(PNMBINS) NULL4: ../inc/pbmplus.h ../inc/pbm.h ../inc/pgm.h ../inc/ppm.h ../inc/pnm.h $(DEPPNMLIB) $(CC) $(ALLCFLAGS) $(ALLLDFLAGS) -o $@ $@.c $(PNMLIB) -lm # Rules for objects. $(PBMOBJS) NULL6: ../inc/pbmplus.h ../inc/pbm.h $(CC) $(ALLCFLAGS) "-Dmain=$*_main" -c $*.c $(PGMOBJS) NULL7: ../inc/pbmplus.h ../inc/pbm.h ../inc/pgm.h $(CC) $(ALLCFLAGS) "-Dmain=$*_main" -c $*.c $(PPMOBJS) NULL8: ../inc/pbmplus.h ../inc/pbm.h ../inc/pgm.h ../inc/ppm.h $(CC) $(ALLCFLAGS) "-Dmain=$*_main" -c $*.c $(PNMOBJS) NULL9: ../inc/pbmplus.h ../inc/pbm.h ../inc/pgm.h ../inc/ppm.h ../inc/pnm.h $(CC) $(ALLCFLAGS) "-Dmain=$*_main" -c $*.c all: merge install: all install.merge install.man # Other dependencies.