#
# 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.24	08/26/93
#
# Author:	Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
#		Copyright 1988-1993 MicroWalt Corporation
#
#		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.
#

VERSION	= 0.24


.EXPORT_ALL_VARIABLES:

CC	= cc -O6 -Wall
LD	= cc

CFLAGS	= -DLINUX
LDFLAGS	= -N -s

LIBS	=


PROGS	= ifsetup ifconfig hostname route arp netstat kd
SUBDIRS	= dip wdsetup


all:		unpack $(PROGS) subdirs

install:	all
		@sh ./Install.sh

firsttime:	all
		@sh ./Install.sh firsttime

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

dist:
		@tar cfvz ../net-$(VERSION).tar.z *

unpack:
		@sh ./Unpack.sh

ifsetup:	ifsetup.c
		$(CC) $(LDFLAGS) -o ifsetup $(CFLAGS) ifsetup.c $(LIBS)

ifconfig:	ifconfig.c
		$(CC) $(LDFLAGS) -o ifconfig $(CFLAGS) ifconfig.c $(LIBS)

hostname:	hostname.c
		$(CC) $(LDFLAGS) -o hostname $(CFLAGS) hostname.c $(LIBS)

route:		route.c
		$(CC) $(LDFLAGS) -o route $(CFLAGS) route.c $(LIBS)

arp:		arp.c
		$(CC) $(LDFLAGS) -o arp $(CFLAGS) arp.c $(LIBS)

netstat:	netstat.c
		$(CC) $(LDFLAGS) -o netstat $(CFLAGS) -D__KERNEL__ -x c++ \
							netstat.c $(LIBS)

kd:		kd.c
		$(CC) $(LDFLAGS) -o kd $(CFLAGS) kd.c $(LIBS)

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


dummy:

# End of Makefile.
