#
# dip		Dialup IP connection support program.
#		Makefile for LINUX.
#
# Version:	@(#)Makefile.LINUX	1.30	08/18/94
#
# Author:	Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
#		Copyright 1988-1993 MicroWalt Corporation
#	
# Modified:     Uri Blumenthal, <uri@watson.ibm.com>
#               Copyright 1994 IBM T. J. Watson Research Center
#
#		This program is free software; you can redistribute it
#		and/or  modify it under  the terms of  the GNU General
#		Public  License as  published  by  the  Free  Software
#		Foundation;  either  version 2 of the License, or  (at
#		your option) any later version.
#

# If you want to include S/Key authentication, un-comment the next
# 2 lines. You will need libskey.a from the skey-linux-1.1b package
# (available on sunsite.unc.edu in
# /pub/Linux/system/Network/sunacm/Programs/User/skey)
# If libskey.a is not in /usr/lib then add the path to it in the 
# SKEYLIB define below.
# Some of S/Key sources is here in skey directory, probably enough
# to build libskey.a, but I haven't tested it...
#
# If you're retarded and insist on binary locks - you may try
# -DHAVE_V2_LOCKFILES=1 flag. I haven't debugged it and will
# not accept any complains if this doesn't work as you
# would like (:-). I don't use it myself, won't test
# it and won't care.

#SKEYDEF	= -DSKEY
#SKEYLIB	= -L/usr/local/lib -lskey

CC	= gcc -pipe -O6 -Wall -m486 -fomit-frame-pointer
LD	= gcc

CFLAGS	= -DLINUX $(SKEYDEF)
LDFLAGS	= -s -N 

LIBS	= $(SKEYLIB) 


VERSION	= 3.3.7g


# Object modules.
OBJS	= main.o config.o daemon.o tty.o attach.o \
	  term.o modem.o command.o login.o 

PROTOS	= slip.o ppp.o


.c.o:		dip.h $<
		$(CC) $(CFLAGS) -c $<


all:		dip
	-@echo "DIP is built successfully."

install:	all
	-@cp /usr/sbin/dip ./dip-
	-@cp -f dip /usr/sbin/dip
	-@cp -f man/dip.8 /usr/man/man8
	-@chown root.uucp /usr/sbin/dip
	-@chown bin.bin /usr/man/man8/dip.8
	-@chmod 04755 /usr/sbin/dip
	-@chmod 0644 /usr/man/man8/dip.8
	-@echo "DIP is installed. Now please install/configure /etc/diphosts."

dist:
		@tar cfvz ../dip-$(VERSION).tar.gz *

dip:		protocols.a $(OBJS)
		$(CC) $(LDFLAGS) -o dip $(OBJS) protocols.a $(LIBS)

protocols.a:	$(PROTOS)
		ar rcs protocols.a $(PROTOS)

clean:
		rm -f core *.o *.a

clobber:	clean
		rm -f dip

dummy:

# End of Makefile.
