#
# SCCS_ID - "@(#)Makefile (TWG)       1.5     89/09/08 "
#
# @(#) Copyright 1988.  The Wollongong Group, Inc.  All Rights Reserved.
#
SOURCES = if.c in.c ip_icmp.c ip_route.c ip_input.c ip_output.c ip_twg.c \
	  ip_main.c ip_subr.c
OBJECTS = if.o in.o ip_icmp.o ip_route.o ip_input.o ip_output.o ip_twg.o \
	  ip_main.o ip_subr.o
LINTS	= if.ln in.ln ip_icmp.ln ip_route.ln ip_input.ln ip_output.ln \
	  ip_twg.ln ip_main.ln ip_subr.ln
MODULE	= ip
DRIVER	= ip.o

BINDIST = ../../../bindist
SRCDIST = ../../../srcdist
INSTALL	= /etc/conf
MISCLIB	= ../twgmisc/twgmisc.a
# Force these modules to be loaded from MISCLIB
ULIST	= -u up_ok_ack -u iocreply

SHELL	= /bin/sh
OPTS	= -O
DEFINES =#-DDEBUG -DDEBUG_TRACE
INCLUDE = -I../../../include
LINTDEF = -DLINT -DNO_SCCS_ID
LDFLAGS = -r

include	../../../make.pre

DEFS	= -DKERNEL -DINKERNEL -DINET $(DEFINES)
CFLAGS	= $(OPTS) $(INCLUDE) $(DEFS)

#	$(LD) -r $(OBJECTS) $(ULIST) $(MISCLIB)

$(DRIVER) all: $(OBJECTS)
	$(LD) $(LDFLAGS) -o $(DRIVER) -r $(OBJECTS) 
	mcs -c $(DRIVER)

bindist : $(DRIVER)
	cp $(DRIVER) $(BINDIST)/user/usr/sys/lib

install : $(DRIVER)
	cp $(DRIVER) $(INSTALL)/usr/sys/lib

srcdist :
	cp $(SOURCES) Makefile $(SRCDIST)/user/kernel/src/$(MODULE)

lint :
	lint $(INCLUDE) $(LINTDEF) $(DEFS) -c if.c
	lint $(INCLUDE) $(LINTDEF) $(DEFS) -c in.c
	lint $(INCLUDE) $(LINTDEF) $(DEFS) -c ip_icmp.c
	lint $(INCLUDE) $(LINTDEF) $(DEFS) -c ip_input.c
	lint $(INCLUDE) $(LINTDEF) $(DEFS) -c ip_output.c
	lint $(INCLUDE) $(LINTDEF) $(DEFS) -c ip_route.c
	lint $(INCLUDE) $(LINTDEF) $(DEFS) -c ip_twg.c
	lint $(INCLUDE) $(LINTDEF) $(DEFS) -c ip_main.c
	lint $(INCLUDE) $(LINTDEF) $(DEFS) -c ip_subr.c
	lint -u $(LINTS)

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

clobber : clean
	rm -f $(DRIVER)

.c.s: $*.c
	$(CC) $(CFLAGS) -S $*.c
