#
# 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
#
# Modified:     Inaky Perez, <inaky@peloncho.fis.ucm.es>
#               The Copyright reminds in Uri and Fred, because
#               mine was an stupid add-on. Cheers :)
#
#		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.
#
# If you have all your locks in /var/lock, as FSSTND recommends (and
# that's exactly what I don't follow :-) - you'd need to define
# -DFSSTND and add this define to CFLAGS or such.

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

CC	= gcc
#CC	= gcc-elf

CFLAGS	= -DLINUX $(SKEYDEF) -DSECUREID -pipe -O6 -Wall -m486 -fomit-frame-pointer

LD	= ld
#LD	= gcc-elf

LDFLAGS	= -s -qmagic
#LDFLAGS = -v -s

SYSOBJS = /usr/lib/crt0.o
LIBS	= $(SKEYLIB) `$(CC) --print-libgcc-file-name` -lc

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

PROTOS	= slip.o ppp.o termp.o


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


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

install:	all
	-@cp /usr/sbin/dip ./dip-
	install -c -o root -g uucp -m 04755 -s dip /usr/sbin
	ln -sf /usr/sbin/dip /usr/sbin/diplogin
	install -c -m 0444 dip.8 /usr/man/man8
	-@echo "DIP is installed. Now please install/configure /etc/diphosts."

dip:		protocols.a $(OBJS)
		$(LD) $(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.
