# 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.
#

CFLAGS	= ${O} -Wall -I. -I.. -Ilib #-DDEBUG
LDFLAGS	= -Llib -N
LDLIBS	= -lsupport

PROGS	= ifconfig hostname arp netstat route slattach rarp

all:		$(PROGS)

install:	all
		install -s hostname /bin
		(cd /usr/bin; ln -sf /bin/hostname domainname)
		install -s -m744 ifconfig route /sbin
		install -s -m744 arp netstat rarp slattach /usr/sbin
		install -m644 man/arp.8      /usr/man/man8/
		install -m644 man/ifconfig.8 /usr/man/man8/
		install -m644 man/netstat.8  /usr/man/man8/
		install -m644 man/route.8    /usr/man/man8/
		install -m644 man/slattach.8 /usr/man/man8/
		install -m644 man/nfs.5      /usr/man/man5/
		install -m644 man/resolver.5 /usr/man/man5/
		install -m644 man/rpc.5      /usr/man/man5/
		install -m644 man/hostname.1 /usr/man/man1/
		(cd /usr/man/man1; ln -sf hostname.1 domainname.1)

clean:
		rm -f *.o $(PROGS)
		(cd lib && make clean)

ifconfig:	lib/libsupport.a ifconfig.o
hostname:	lib/libsupport.a hostname.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

lib/libsupport.a:
		(cd lib ; $(MAKE) "CFLAGS=${CFLAGS}")

# End of Makefile.
