#
# Makefile for Rhapsody
#
#
# Intel flags:
# ------------
#
# ARCHFLAGS = -arch i386
# 
#
# PPC flags:
# ------------
#
# ARCHFLAGS = -arch ppc -mlong-branch
#


BINDIR = /usr/local/ppp/bin
MANDIR = /usr/local/ppp/man
ETCDIR = /usr/local/ppp/etc

#
# If you change this pathname, you must also change the path
# in and rc.local (or rc.ppp).
#
LKS_DIR=/usr/bin/kern_loader/ppp/

#
# NPPP=x      The number of ppp interfaces you want to create
#
# VJC            If defined, enables VJ header compression
#
# PPP_COMPRESS   If defined, enables BSD packet compression
#
# HAS_BROKEN_TIOCSPGRP Fixes broken IOCTL with NeXT serial drivers
#
# OLD_MUX        Fixes double buffer problem with the MuX serial
#                driver.
#
# NBPFILTER       If defined, adds hooks for the Berkley Packet Filter
#                If this symbol is defined, you must load the
#                bpf_reloc LKS _BEFORE_ you load the ppp_reloc LKS.
#                See the ./bpf directory for more information.    
#
# NETBUF_PROXY   Enable proxy routines for custom Netbuf handling
#
# CHECK_BOUNDS   Turn on bounds checking on netbufs.  NETBUF_PROXY
#                must be enabled for this to work.
#
# OPTIMIZE_PPPREND Enable an optimization supported by the NeXT serial
#                  drivers.  Basically they buffer characters for an
#                  interrupt and call ppprend.
#
# NEW_CLOCAL     Used to enable the new code that sets CLOCAL.  Else,
#                the old code is used.
#
#
#

DFLAGS = -DINET -DKERNEL -D_KERNEL -DMACH -DMACH_USER_API -DPOSIX_KERN \
	-DNPPP=2 -DVJC -DPPP_COMPRESS \
	-DDEBUG -DNEW_CLOCAL -DOPTIMIZE_PPPREND

IFLAGS = -I. -I.. -I../pppd -I../net

CFLAGS = -pipe -static $(ARCHFLAGS) $(DFLAGS) $(IFLAGS) 

OBJS = bsd-comp.o if_ppp.o ppp-deflate.o ppp_tty.o slcompress.o zlib.o
SRCS = $(OBJS:.o=.c)


#
# Default target
#
all:	ppp_reloc


install: all
	/bin/mkdirs $(ETCDIR) $(LKS_DIR)
	if (test ! -r /etc/ppp)	then (ln -s $(ETCDIR) /etc/ppp)	fi
	install -c -m 644 -o root -g daemon ppp_reloc $(LKS_DIR)
	touch $(ETCDIR)/options


ppp_reloc:	$(OBJS) Load_Commands.sect
	kl_ld $(ARCHFLAGS) -n ppp -l Load_Commands.sect -u Unload_Commands.sect \
	       -i ppp_instance -o $@ $(OBJS)

clean:
	rm -f ppp_reloc core make $(OBJS) *~ 


$(SRCS): if_pppvar.h slcompress.h Makefile
