
PROGS	= posix gentest tpwdb radtest grouptest

SRCS = $(addsuffix .c,$(PROGS))
OBJS = $(addsuffix .o,$(PROGS))

# rules
junk:
	@echo "this is not a top-level Makefile"
	exit 1

%.o : %.c
	$(CC) $(CFLAGS) -c $< -o $@

all:	${PROGS} ../libpwdb/libpwdb.a

posix: posix.o ../libpwdb/libpwdb.a
	$(CC) -o $@ $< ../libpwdb/libpwdb.a -lnsl

tpwdb: tpwdb.o ../libpwdb/libpwdb.a
	${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl

radtest: radtest.o ../libpwdb/libpwdb.a
	${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl

gentest: gentest.o ../libpwdb/libpwdb.a
	${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl

grouptest: grouptest.o ../libpwdb/libpwdb.a 
	${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl

clean:
	rm -f ${PROGS} *.o *~

.PHONY: install ../libpwdb/libpwdb.a

