# $Id: GNUmakefile,v 1.17 1993/11/12 06:14:57 jraja Exp $
#
# GNUmakefile for AmiTCP/IP network utilities
#
# Copyright  1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
#                  Helsinki University of Technology, Finland.
#
# Created      : Fri May 14 17:43:05 1993 ppessi
# Last modified: Fri Nov 12 08:14:48 1993 jraja
#
# $Log: GNUmakefile,v $
# Revision 1.17  1993/11/12  06:14:57  jraja
# Added SCOPTIONS for the minimalistic utilities.
#
# Revision 1.16  1993/11/12  00:35:51  ppessi
# Added RELEASE
#
# Revision 1.15  1993/10/14  00:20:06  ppessi
# Moved some utilities to appl and devs directories.
#
# Revision 1.14  1993/08/12  09:26:08  jraja
# Removed unnecessary files from route.
#
# Revision 1.13  1993/08/11  00:28:41  ppessi
# Added netutil.doc into the distribution.
#
# Revision 1.12  1993/08/10  20:49:48  jraja
# Added agnet/SCOPTIONS.
#
# Revision 1.11  1993/08/09  15:47:50  jraja
# Moved agnet configuration files to ../env/sana2.
#
# Revision 1.10  1993/08/09  15:45:10  jraja
# Updated agnet distribution (ppessi).
#
# Revision 1.9  1993/08/02  14:00:25  jraja
# Fixed errors in Agnet file list.
#
# Revision 1.8  1993/08/02  13:39:11  jraja
# Added EmacsTcp binaries to the distribution.
#
# Revision 1.7  1993/08/02  01:21:06  ppessi
# Added Log. Fixed Agnet source typos.
#
#

#DIST = ../DIST
DIST_UTIL = $(DIST)/util
DIST_DOC = $(DIST)/doc

GENERIC = GNUmakefile Smakefile AMITCP.GNUmk AMITCP.SCmk SCOPTIONS

# Minimalistic utilites: (these still need the SCOPTIONS)
ARP = arp/arp.c arp/Smake.def 

IFCONFIG = ifconfig/ifconfig.c ifconfig/Smake.def 

PING = ping/ping.c ping/Smake.def 

# not minimalistic
INETD = inetd/inetd.c inetd/Smakefile inetd/inetd_rev.rev

LETNET = letnet/Smakefile letnet/letnet.h letnet/letnet.c letnet/sender.c 

NETSTAT = netstat/netstat.rexx

ONLINE = online/Smakefile online/online.c

ROUTE = route/Smakefile route/keywords.h route/route.c

UTILSRC = $(GENERIC) $(ARP) $(IFCONFIG) $(PING) \
	$(ROUTE) $(ONLINE) $(NETSTAT) $(INETD) $(LETNET)

AUTODOCSRC = arp/arp.c ifconfig/ifconfig.c inetd/inetd.c \
	letnet/letnet.c online/online.c ping/ping.c route/route.c 

AUTODOCER = /p/projects/ohtatcp/bin/autodoc

DIST: $(DIST_UTIL) # $(DIST_DOC)

$(DIST_UTIL): $(UTILSRC)
	test -d $(DIST) || mkdir $(DIST) 
	test -d $(DIST_UTIL) || mkdir $(DIST_UTIL)
	tar cf - $(UTILSRC) | (cd $(DIST_UTIL); tar xf -)

RELEASE: $(UTILSRC)
	for F in $(UTILSRC) ; do \
	  rlog -R $$F && { \
	    if ident -q $$F | egrep -v '\$$Log' | fgrep '$$' >/dev/null ; \
	      then rcs -q '-N$(RELEASE):$$' $$F ; \
	      else rcs -q '-N$(RELEASE):' $$F ;\
	    fi ; \
          } ;\
	done

$(DIST_DOC): $(AUTODOCSRC)
	test -d $(DIST) || mkdir $(DIST) 
	test -d $(DIST_DOC) || mkdir $(DIST_DOC)
	$(AUTODOCER) $(AUTODOCSRC) > $(DIST_DOC)/netutil.doc

util.lha: $(UTILSRC)
	rm -f ../$@
	lha a ../$@ $(UTILSRC)
