# Make file for gated3.0/src directory
#
# Things you might want to change.  Pass them in on the command line:
# ROOT - should point to the root where the commands will be installed
#        (e.g. /deliver/INETSVCS/indnetwk)

ROOT=

# to 10.0
# built in src/obj directory
OBJPRODUCTS= /usr/sbin/gated \
	/usr/sbin/ripquery \
	/usr/sbin/ospf_monitor \
	/usr/sbin/gdc

# in conf directory
CONFPRODUCTS=/usr/examples/gated/README \
	/usr/examples/gated/bgp-ospf \
	/usr/examples/gated/hp-ospf-nbma \
	/usr/examples/gated/ospf \
	/usr/examples/gated/rip.quiet \
	/usr/examples/gated/rip.routed \
	/usr/examples/gated/rip.slip \
	/usr/examples/gated/udel.edu

# in src directory
SRCPRODUCTS=/usr/newconfig/etc/gated.conf

# in gated3.0 directory
CONVERSION=/usr/examples/gated/conv_config \
	/usr/examples/gated/README.conv \
	/usr/examples/gated/Copyright

#Install database name
INSTALLDB=/source/INETSVCS/$(LOGNAME)/config/installdb

#Script called to parse the install deliverable
INSTALLSCPT=/source/INETSVCS/$(LOGNAME)/config/install_script

# Defaults file containing the shell, compiler options, etc
BUILDRULES=/source/INETSVCS/$(LOGNAME)/config/defaults

include ${BUILDRULES}

#Commands used by this Makefiel
MKDIR=/usr/bin/mkdir
CP=/usr/bin/cp

default: all

all: clean build install

clean:
	$(ECHO) "Clobbering... gated"
	$(RM) -f *.o *.a gated 
	$(RM) -rf obj

build: 
	$(ECHO) "Building... gated" 
	$(RM) -rf obj
	$(MKDIR) obj
	$(CP) Config obj
	$(ECHO) "make config"
	$(MAKE) -f Makefile.gated config
	cd obj ; \
	$(CP) ../task_sig.h . ; \
	$(ECHO) "make gated" ; \
	$(MAKE) CFLAGS='$(CFLAGS) -Wp,-H256000 -Wl,-aarchive' LDFLAGS='$(LDFLAGS)' 

install:
	for file in $(SRCPRODUCTS) ; do \
		$(INSTALLSCPT) $$file $(INSTALLDB) ;  \
	done
	cd obj ;  \
	for file in $(OBJPRODUCTS) ; do \
		$(INSTALLSCPT) $$file $(INSTALLDB) ;  \
	done
	cd ../conf ; \
	for file in $(CONFPRODUCTS) ; do \
		$(INSTALLSCPT) $$file $(INSTALLDB) ;  \
	done
	cd .. ; \
	for file in $(CONVERSION) ; do \
		$(INSTALLSCPT) $$file $(INSTALLDB) ;  \
	done
