CC = gcc
LINK = $(CC)
CFLAGS = -O2 -pipe -fomit-frame-pointer #-Wall
DEFINES = #-DFUNMESSAGE #-DOLDMESSAGE
LDFLAGS = -s

SRC = sliplogin.c statistic.c scanfile.c translate.c
OBJ = $(SRC:.c=.o)
LIBS = #-lshadow

#
#You should really edit /etc/group to limit access to sliplogin
#otherwise sliplogin has to be executable for the world.
#
# SLIPGROUP = slip

TARGETS = sliplogin 

all: $(TARGETS)
	@echo done

sliplogin: $(OBJ) 
	$(LINK) $(OBJ) $(LIBS) $(LDFLAGS) -o $@

clean:
	rm -f $(OBJ) core sliplogin

install: sliplogin
	install -s -o root -g dip -m 4750 sliplogin ${DEBDIR}/usr/sbin
	install -o root -g root -m 0644 sliplogin.8 ${DEBDIR}/usr/man/man8
	install -o root -g root -m 0755 -d ${DEBDIR}/usr/doc/net/sliplogin
	install -o root -g root -m 0644 TROUBLE_SHOOTING ${DEBDIR}/usr/doc/net/sliplogin/trouble.txt
	install -o root -g root -m 0644 README.dynamic ${DEBDIR}/usr/doc/net/sliplogin/dynamic.txt
	install -o root -g root -m 0644 README.nis ${DEBDIR}/usr/doc/net/sliplogin/nis.txt
	gzip -9fv ${DEBDIR}/usr/doc/net/sliplogin/trouble.txt
	gzip -9fv ${DEBDIR}/usr/doc/net/sliplogin/dynamic.txt
	gzip -9fv ${DEBDIR}/usr/doc/net/sliplogin/nis.txt
#	install -m4754 sliplogin /sbin
#	install -m644 sliplogin.8 /usr/man/man8
#	chgrp $(SLIPGROUP) /sbin/sliplogin
#	@echo "Don't forget to edit slip.hosts, slip.login and slip.logout"
#	@echo "and copy these files to the proper place (/etc)."

depend:
	makedepend $(SRC)

ci:
	ci -m"I hate log messages!" -t-"I hate description prompts!" -l $(SRC) Makefile

co:
	co $(SRC) Makefile

.c.o: 
	$(CC) $(CFLAGS) $(DEFINES) -c $<

