##
##  Copyright (c) 1991 Bolt Beranek and Newman, Inc.
##  All rights reserved.
##
##  Redistribution and use in source and binary forms are permitted
##  provided that: (1) source distributions retain this entire copyright
##  notice and comment, and (2) distributions including binaries display
##  the following acknowledgement:  ``This product includes software
##  developed by Bolt Beranek and Newman, Inc. and CREN/CSNET'' in the
##  documentation or other materials provided with the distribution and in
##  all advertising materials mentioning features or use of this software.
##  Neither the name of Bolt Beranek and Newman nor CREN/CSNET may be used
##  to endorse or promote products derived from this software without
##  specific prior written permission.
##
##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
##  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
##
##
##  Common make include file for Dialup IP.
##  Copyright (c) 1991 Bolt Beranek and Newman, Inc.
##  All rights reserved.
##
##  Redistribution and use in source and binary forms are permitted
##  provided that: (1) source distributions retain this entire copyright
##  notice and comment, and (2) distributions including binaries display
##  the following acknowledgement:  ``This product includes software
##  developed by Bolt Beranek and Newman, Inc. and CREN/CSNET'' in the
##  documentation or other materials provided with the distribution and in
##  all advertising materials mentioning features or use of this software.
##  Neither the name of Bolt Beranek and Newman nor CREN/CSNET may be used
##  to endorse or promote products derived from this software without
##  specific prior written permission.
##
##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
##  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
##

##  Some versions of make need this, else they will call the user's shell.
SHELL		= /bin/sh

##  Directory where the system is.
DIAL_BUILD	= ../

##  Directory paths.  See include/dialupip.h before changing these.
DIAL_ROOT	= /usr/dialupip
BIN_DIR		= $(DIAL_ROOT)/bin
LOG_DIR		= $(DIAL_ROOT)/log
CONFIG_DIR	= $(DIAL_ROOT)/config

##  Program flags.
#	Set this to -g or -O, as appropriate.
DEBUG_OR_OPT	= -O
#	Pre-processor definitions, for use below.
DEFS		= -I../h -DSTREAMS
#	C compiler flags.
CFLAGS		= $(DEFS) $(DEBUG_OR_OPT)
#	Linker flags.
LDFLAGS		= $(DEBUG_OR_OPT)
#	Lint flags.
LINTFLAGS	= $(DEFS)
#DIPLINTLIB	= $(DIAL_BUILD)/lib/llib-ldiputil.ln
#	Library.
#DIPLIB		= $(DIAL_BUILD)/lib/libdiputil.a


DSRCS	= dpd.c makecall.c readconfig.c runscript.c uucplock.c ppp.c	\
	  diprelease.c log.c progname.c recordpid.c strerror.c calllog.c
DOBJS	= dpd.o makecall.o readconfig.o runscript.o uucplock.o ppp.o	\
	  diprelease.o log.o progname.o recordpid.o strerror.o calllog.o

LSRCS	= dplogin.c readconfig.c log.c progname.c recordpid.c calllog.c	\
	  strerror.c ppp.c
LOBJS	= dplogin.o readconfig.o log.o progname.o recordpid.o calllog.o	\
	  strerror.o ppp.o


all:		dpd dplogin

clean:
	rm -f foo core tags lint a.out *.o dpd

install:	all
	cp dpd $(BIN_DIR)

lint:		dpd
	lint $(LINTFLAGS) -z $(DSRCS) $(DIPLINTLIB) >lint


##
dpd:		$(DOBJS)
	cc -o $@ $(LDFLAGS) $(DOBJS) $(DIPLIB)

dplogin:	$(LOBJS)
	cc -o $@ $(LDFLAGS) $(LOBJS) $(DIPLIB)
