#
# Warning: you may need more libraries than are included here on the
# build line.  The agent frequently needs various libraries in order
# to compile pieces of it, but is OS dependent and we can't list all
# the combinations here.  Instead, look at the libraries that were
# used when linking the snmpd master agent and copy those to this
# file.
#


ROOT=./
include $(ROOT)/makeRules
LIB_DIR = lib

SUBSYS = nms.sys 

LIBS = -lnms 

NET_LIBS = -lnetsnmp -lnetsnmpagent -lnetsnmphelpers -lm -lnetsnmpmibs	

USR_LIB = -L/usr/lib

TARGET= subAgent 

# if ucd-snmp was compiled with openssl support
#CRYPTO=-L/usr/local/ssl/lib -lcrypto

CRYPTO=-L/usr/lib -lcrypto		

SYSLIBS=-L/usr/lib -ldl -lpopt -lz 
#-lrpm 					#Asawari 08/04/04 and 12/04/04

#WRAP=-L/usr/lib -lwrap

# shared library flags (assumes gcc)
DLFLAGS=-fPIC -shared

SUBVAR =  ${SUBSYS:.sys=}


all: $(SUBSYS)
	$(CC) -L/home/a1/b2/c3/d4/ -L/a1/b2/c3/d4/e5/snmp/net-snmp/agent/mibgroup/examples/NMS_LAN/ -o $(TARGET) -L/usr/local/lib $(NET_LIBS) -Llib $(LIBS) $(SYSLIBS) $(CRYPTO) -lwipl2Api	


%.sys :
	cd $*; $(MAKE); 
clean:
	@for subdir in $(SUBVAR);  \
	do \
	echo "Cleaning Subsystem: $$subdir..."; \
	(cd $$subdir; $(MAKE)  clean;) \
	done ;
	$(RM) $(TARGET);

build:
	$(CC) -o subAgent -L/usr/local/lib $(NET_LIBS) -Llib $(LIBS) $(SYSLIBS) $(CRYPTO)
