# 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: define which of the four sub-packages you want to make. PBM
# is required; PNM is recommended; and if you want PPM you must have PGM
# too. This means there are only six possibilities:
SUBDIRS = pbm pgm ppm pnm
# SUBDIRS = pbm pgm ppm
# SUBDIRS = pbm pgm pnm
# SUBDIRS = pbm pgm
# SUBDIRS = pbm pnm
# SUBDIRS = pbm
# CONFIGURE: gcc makes things go about 20% faster, but not everyone has it.
# Warning: do not use gcc's -finline-functions flag, it can produce incorrect
# code. (This is with gcc version 1.35, later versions may fix this.)
# CC = cc
CC = gcc -fstrength-reduce -fcombine-regs
# CONFIGURE: cc flags go here. Warning: do not use -O with gcc, it can
# produce incorrect code. (Again version 1.35. Yes, this is a separate
# bug from the -finline-functions bug.)
# CFLAGS = -O
CFLAGS = -g
# CFLAGS =
# CONFIGURE: ld flags go here.
# LDFLAGS = -s
LDFLAGS =
# CONFIGURE: Define the directory that you want the binaries copied to.
INSTALLBINARIES = /usr/new/pbm
# CONFIGURE: Define the _section_ that you want the manual sources copied to.
INSTALLMANUALS = l
all:
for i in $(SUBDIRS) ; do \
( cd $$i ; make $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'LDFLAGS=$(LDFLAGS)' 'INSTALLBINARIES=$(INSTALLBINARIES)' 'INSTALLMANUALS=$(INSTALLMANUALS)' all ); \
done
install:
for i in $(SUBDIRS) ; do \
( cd $$i ; make $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'LDFLAGS=$(LDFLAGS)' 'INSTALLBINARIES=$(INSTALLBINARIES)' 'INSTALLMANUALS=$(INSTALLMANUALS)' install ); \