#
# Where to install the data (check config.h)
#
DESTDIR=/usr/local/bin
#
# Define the flags needed to load the GNU database library
#
DBM_LIB=-lgdbm

CC=gcc
CFLAGS=-Wall -g 

FILES = \
	README \
	Makefile \
	defs.h \
	gdbm_class.h \
	option.c \
	option.h \
	p-scan.sh \
	p_data.c \
	p_data.h  \
	pq.1 \
	pq.c \
	proto.1 \
	proto.c \
	linux-scan.sh \
	linux-pwhere.sh

PROTO_OBJS = proto.o p_data.o option.o
PQ_OBJS = pq.o p_data.o option.o

all: proto pq 
doc: pq.ps proto.ps

install: proto pq
	install -c proto $(DESTDIR)/bin
	install -c pq $(DESTDIR)/bin
	install -c pq.1 $(DESTDIR)/man/man1
	install -c pq.1 $(DESTDIR)/man/man1

pq.ps: pq.1
	groff -man pq.1 >pq.ps

proto.ps: proto.1
	groff -man proto.1 >proto.ps

pq: $(PQ_OBJS)
	$(CC) $(CFLAGS) -o pq $(PQ_OBJS) $(DBM_LIB)

proto: $(PROTO_OBJS)
	$(CC) $(CFLAGS) -o proto $(PROTO_OBJS) $(DBM_LIB)

clean:
	rm -f proto pq *.o

share:
	sharmaker $(FILES) >proto.share

tar:
	tar cvf proto.tar $(FILES)

.KEEP_STATE:
