# Last edited on 2004-11-07 02:06:18 by stolfi # Makefile for libjspbm - J.Stolfi's pbmplus-related hacks LIBNAME = libjspbm # Location of Stolfi's libraries INC := /home/staff/stolfi/PUB/include LIB := /home/staff/stolfi/PUB/${PLATFORM}/lib # Location of the PBM libraries PBMPUB := /home/staff/stolfi/pkg/netpbm-1mar1994-1/PUB/${PLATFORM} PBMINC := ${PBMPUB}/include PBMLIB := ${PBMPUB}/lib HFILES = \ pgm_image.h \ pnm_image.h \ ppm_image.h \ ppmcmapx.h \ pgmmedcutx.h \ ppmmedcutx.h CFILES := \ pgm_image.c \ pnm_image.c \ ppm_image.c \ ppmcmapx.h \ pgmmedcutx.c \ ppmmedcutx.c HOFILES := ${subst .h,.ho,${HFILES}} OFILES := ${subst .c,.o,${CFILES}} LIBFILE = \ ${LIBNAME}.a .PHONY: all uninstall install test clean depend # all: uninstall clean install all: uninstall build install uninstall: ;\ ( cd ${INC} && rm -f ${HFILES} ${HOFILES} ) ;\ ( cd ${LIB} && rm -f ${LIBFILE} ) build: ${LIBFILE} install: ${HOFILES} ${HFILES} ${LIBFILE} cp -p ${HFILES} ${INC}/ cp ${HOFILES} ${INC}/ cp -p ${LIBFILE} ${LIB}/ test: cd tests && ${MAKE} all clean: -/bin/rm -f *.o *.ho *.a core DEPFILE := Deps.make ifeq "${PBMINC}/" "/usr/include/" IFLAGS := -I. -I${INC} else IFLAGS := -I. -I${INC} -I${PBMINC} endif depend: /bin/rm -f ${DEPFILE} extract-ho-deps ${IFLAGS} -I/usr/include ${HFILES} ${CFILES} \ | egrep -v ': /usr/include' \ > ${DEPFILE} GCCFLAGS = \ -O -g \ -Wall -Wpointer-arith -Wmissing-prototypes \ -DSYSV \ -fpcc-struct-return %.o: %.c gcc ${IFLAGS} ${GCCFLAGS} -c $*.c %.ho: %.h gcc ${IFLAGS} ${GCCFLAGS} -o $*.ho -c -x c $*.h \ || /bin/rm -f $*.ho ${LIBFILE}: ${OFILES} ;\ rm -f $*.a && ar crv $*.a ${OFILES} && ranlib $*.a include ${DEPFILE}