# Makefile for pbmplus. # # Copyright (C) 1989, 1991, 1994, 1999 by Jef Poskanzer. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, provided # that the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation. This software is provided "as is" without express or # implied warranty. # CONFIGURE: which compiler to use, plus any compiler-specific flags. CC = cc # CONFIGURE: general compiler flags go here. CFLAGS = -O -ansi -pedantic -U__STRICT_ANSI__ -Wall -Wpointer-arith -Wshadow -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wno-long-long # CONFIGURE: loader flags go here. LDFLAGS = -s # CONFIGURE: If you have an X11-style rgb color names file, define its # path here (leave off the .txt extension). This is used by PPM to parse # color names into rgb values. If you don't have such a file, comment # this out and use the alternative hex and decimal forms to specify # colors (see pgmtoppm.1 for details). RGBDEF = -DRGB_DB=\"/usr/X11R6/lib/X11/rgb.txt\" # CONFIGURE: PBMPLUS's support for TIFF files depends on the library from # Sam Leffler's TIFF software package. To configure PBMPLUS to use the # library: first, if necessary, fetch and build the TIFF software. If # you're using FreeBSD, you can just get your sysadmin to cd to # /usr/ports/graphics/tiff and do a make install. Finally, uncomment # the following seven definitions. # # Libtiff is pretty good about portability, but there are some machines # it has problems on. If you run into problems, you may wish to contact # the libtiff folks directly. TIFFDEF = -DLIBTIFF TIFFDIR = /usr/local/lib TIFFINC = -I$(TIFFDIR) TIFFLIB = -L$(TIFFDIR) -ltiff DEPTIFFLIB = $(TIFFDIR)/libtiff.a PNMTIFFBINS = tifftopnm pnmtotiff PNMTIFFOBJS = tifftopnm.o pnmtotiff.o # CONFIGURE: Normally the Makefile builds and installs separate binaries for # each program. However, on some systems (especially those without shared # libraries) this can mean a lot of space. In this case you might try # building a "merge" instead. The idea here is to link all the binaries # together into one huge executable, with a tiny dispatch program as the # main. Then the merged binary is installed with file-system links for # each program it includes. The dispatch routine can tell which program # to run by looking at argv[0]. # # Note that if you make a "merge", the executables don't get created # until you do the install. all: binaries install: install.bin install.scripts install.man #all: merge #install: install.merge install.scripts install.man # CONFIGURE: Define the directory that you want the binaries copied to. # If you need scripts and binaries to be in different directories, you # can set that up too. INSTBINS = /usr/local/bin/pbmplus INSTSCRIPTS = $(INSTBINS) # CONFIGURE: Define the directories that you want the manual sources copied to, # plus the suffix you want them to have. INSTMANS1 = /usr/local/man/man1 SUFMANS1 = 1 INSTMANS3 = /usr/local/man/man3 SUFMANS3 = 3 INSTMANS5 = /usr/local/man/man5 SUFMANS5 = 5 # CONFIGURE: Normally the man pages are installed using "cp". By changing # this define you can use something else, for example a script that calls # compress or pack. MANCP = cp # End of configurable definitions. MAKE = make SUBDIRS = config libpnm appls extras binaries install.bin merge install.merge install.scripts install.man clean: for i in $(SUBDIRS) ; do \ ( cd $$i ; pwd ; $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' \ 'LDFLAGS=$(LDFLAGS)' 'RGBDEF=$(RGBDEF)' 'TIFFDEF=$(TIFFDEF)' \ 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' \ 'DEPTIFFLIB=$(DEPTIFFLIB)' 'PNMTIFFBINS=$(PNMTIFFBINS)' \ 'PNMTIFFOBJS=$(PNMTIFFOBJS)' 'INSTBINS=$(INSTBINS)' \ 'INSTSCRIPTS=$(INSTSCRIPTS)' 'INSTMANS1=$(INSTMANS1)' \ 'SUFMANS1=$(SUFMANS1)' 'INSTMANS3=$(INSTMANS3)' \ 'SUFMANS3=$(SUFMANS3)' 'INSTMANS5=$(INSTMANS5)' \ 'SUFMANS5=$(SUFMANS5)' 'MANCP=$(MANCP)' $@ ) ; \ done