#
# NET-BASE	A collection of programs that form the base set of the
#		NET-2 Networking Distribution for the LINUX operating
#		system.
#
# Version:	@(#)Makefile	0.32	01/16/94
#
# Author:	Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
#		Copyright 1988-1993 MicroWalt Corporation
#
#		Extensively modified from 01/21/94 onwards by
#		Alan Cox <A.Cox@swansea.ac.uk>
#		Copyright 1993-1994 Swansea University Computer Society
#
#		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.
#

NLS = -DNLS=0
#NLS = -DNLS=1

.EXPORT_ALL_VARIABLES:

CFLAGS	= -Wall -I. -I.. -Ilib -O2 $(O) $(NLS) -DIP_FW_F_MASQ #-DDEBUG
LDFLAGS	= -Llib -L../lib -s
LDLIBS	= -lsupport


PROGS	= slattach

#SUBDIRS	= nls
#all:		config.h version.h subdirs $(PROGS)
all:		config.h version.h $(PROGS)

install:
		install -s hostname netstat /bin/
		install -s ifconfig route ipfw /sbin/
		install -s arp rarp slattach plipconfig /usr/sbin/
		install -s hostname /usr/bin/dnsdomainname
		(cd man/en_US.88591 && install -m 644 hostname.1 \
			dnsdomainname.1 /usr/man/man1/ )
		(cd man/en_US.88591 && install -m 644 arp.8 ifconfig.8 ipfw.8 \
			netstat.8 plipconfig.8 rarp.8 route.8 slattach.8 \
			/usr/man/man8/ )

clean:
		rm -f *.o $(PROGS) *~
		@for i in lib; do make -C $$i clean; done
#		@for i in lib $(SUBDIRS); do cd $$i && make clean && cd ..; done

ifconfig:	lib/libsupport.a ifconfig.o
hostname:	hostname.o
plipconfig:	plipconfig.o
route:		lib/libsupport.a route.o
arp:		lib/libsupport.a arp.o
rarp:		lib/libsupport.a rarp.o
slattach:	lib/libsupport.a slattach.o
netstat:	lib/libsupport.a netstat.o
ipfw:		ipfw.o

#subdirs:	
#		@for i in $(SUBDIRS); do (cd $$i; $(MAKE)); done

lib/libsupport.a:
		@(cd lib ; $(MAKE))

netstat.o:	netstat.c
		$(CC) $(CFLAGS) -D__KERNEL__ -c $<

# End of Makefile.
