# Make file for gated3.0/dev_kit/10.0/emanate/sub/ospf 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=
TOP = ../../..
GATED_SRC = ../../../..
MAKE_HOME = ../emanate/sub/ospf

# built in src/obj directory
OBJPRODUCTS= /usr/sbin/ospfagt

#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=/bin/mkdir
CP=/usr/bin/cp

default: all

all: clean build install

clean:
	$(ECHO) "Clobbering... gatedagt and OSPF MIBs files"
	$(RM) -f *.o ospfagt

build: 
	$(ECHO) "Building... gated OSPF subagent" 
	cd $(TOP)/bin ; \
	sh bin_shar ; \
	cd ../lib ; \
	sh lib_shar ; \
	cd $(MAKE_HOME)
	$(MAKE)  LDFLAGS="$(LDFLAGS)" -f Makefile.ospfagt startover
	$(CP) -f $(GATED_SRC)/src/hp_mib/ospf.my .
	$(CP) -f $(GATED_SRC)/src/ospf_hpmib.h . 
	$(MAKE) LDFLAGS="$(LDFLAGS)" -f Makefile.ospfagt
	$(CP) -f $(GATED_SRC)/src/hp_mib/k_ospf.c . 
	$(CP) -f $(GATED_SRC)/src/hp_mib/v_ospf.c . 
	$(MAKE) LDFLAGS="$(LDFLAGS)" -f Makefile.ospfagt

install:
	for file in $(OBJPRODUCTS) ; do \
		$(INSTALLSCPT) $$file $(INSTALLDB) ;  \
	done
