
CFLAGS = -O

# Where to put lwf
LWF = /usr/local/lwf

# Where to put the man page
MAN = /usr/man/manl/lwf.l

# Where to put the PostScript prologue file
PROLOGUE = /usr/local/lib/lwf.prologue

# Environment options:
#
# -DPR=\"where pr is if not /bin/pr\"
# -DSYSV			For System V (assumes SYSV-style pr)
# -DREVERSE=0		Set to non-zero if page reversal is to be the default
# -DHOSTNAME=\"yourhostname\"	If you don't have the hostname() system call
ENV = -DPROLOGUE=\"$(PROLOGUE)\" -DREVERSE=0

lwf: lwf.o range.o
	cc -s -o lwf lwf.o range.o -lm

lwf.o: lwf.c
	cc $(CFLAGS) -c $(ENV) lwf.c

range.o: range.c
	cc $(CFLAGS) -c range.c

# Create the program to demonstrate and debug the range checking routine
range: range.c
	cc $(CFLAGS) -DRANGE_DEBUG -o range range.c

install: lwf lwf.man
	cp prologue $(PROLOGUE)
	chmod 0644 $(PROLOGUE)
	cp lwf $(LWF)
	chmod 0755 $(LWF)
	ls -l $(LWF)
	cp lwf.man $(MAN)
	rm -f lwf lwf.o range.o

lint:
	lint -abchx $(ENV) lwf.c

clean:
	rm -f core lwf lwf.o range.o

