MANDIR=/usr/local/man
BINDIR=/usr/bin
DAEMONDIR=/usr/sbin
INCLUDE=/usr/include
LIBDIR=/lib
BINS=snmpbulkwalk snmpget snmpnetstat snmpset snmptest snmptranslate \
	snmptrapd snmpwalk
LIB=libsnmp.so.2.1.2l3
HN=$(shell hostname | tr -d "\n" )
DN=$(shell domainname | tr -d "\n" )
FQDN=$(HN)\.$(DN)
IP=$(shell host $(FQDN)|grep address|cut -f 4 -d " ")



test:
	touch .test
	rm .test
	echo I show your hostname as \"$(HN)\" >> .test
	echo and your domainname as \"$(DN)\" >> .test
	echo making your fqdn \"$(FQDN)\". >>.test
	echo Your IP address is \"$(IP)\".>>.test
	echo If this is correct, type \"make install\". Otherwise,>>.test
	echo hard code the proper values into the makefile. >>.test
	echo ; cat .test | fold -w 79 -s ; echo ; echo ; rm .test

install:
	cp *.8 $(MANDIR)/man8
	cp *.5 $(MANDIR)/man5
	cp *.3 $(MANDIR)/man3
	cp *.1 $(MANDIR)/man1
	cp snmpd $(DAEMONDIR)
	cp $(BINS) $(BINDIR)
	cp $(LIB) $(LIBDIR)
	ln -s $(LIBDIR)/$(LIB) $(LIBDIR)/libsnmp.so.2
	mkdir $(INCLUDE)/snmp
	cp *.h $(INCLUDE)/snmp
	( cd etc ; installconf $(FQDN) $(IP) )
	