## ####### Makefile.head for nocol ######## # # $Header: /home/vikas/src/nocol/RCS/Makefile.head,v 1.3 2000/01/19 04:08:08 vikas Exp $ ## # Set ROOTDIR here to a directory where everything will be installed # (etc, data). 'netconsole' does a chroot to this directory when it runs. #SRCDIR= `pwd` #ROOTDIR= /usr/local/nocol #MANDIR = $(ROOTDIR)/man #MANEXT = n #NLOG_HOST = nocol.navya.com # host running the noclogd daemon #OPSMAIL = ops@your.domain # periodical condition reports # Set the SHELL else make will fail on good old IRIX... (sigh!!) SHELL=/bin/sh ROOTDIR=/usr/local/nocol SRCDIR=/mnt/gmirror/ports/net-mgmt/nocol/work/nocol-4.3.1 MANDIR=/usr/local/nocol/man MANEXT=n LOGHOST=darwintel OPSMAIL=nocol-ops@darwintel CRITMAIL=nocol-crit@darwintel PERL=/usr/local/bin/perl OS_LIBS= OS_CFLAGS= AR=ar r RANLIB=ranlib INSTALL=install # BINDIR where the programs are installed # ETCDIR location of configuration files # PIDDIR where programs create their pid files and error files # DATADIR where datafiles for monitoring programs are created # MSGSDIR for message files that the nocol display shows in # in the 'messages' sub-window # HELPDIR where helpfiles for webnocol are kept. # EXAMPLESDIR directory to store example config files BINDIR= $(ROOTDIR)/bin ETCDIR= $(ROOTDIR)/etc PIDDIR= $(ROOTDIR)/run DATADIR= $(ROOTDIR)/data MSGSDIR= $(ROOTDIR)/msgs HELPDIR= $(ROOTDIR)/help EXAMPLESDIR= $(ETCDIR)/samples ## # NOCOL specific definitions: # -DNOCOL Always defined. # -DNOMULTIPING If you dont want to use 'multiping'. # NOCOLDEFS = -DNOCOL # #'GCC' earlier than 2.x might fail on Sparc # -DDEBUG # CC = gcc CFLAGS = -O $(NOCOLDEFS) $(OS_CFLAGS) -I$(SRCDIR)/include LIBS = -L$(SRCDIR)/lib $(OS_LIBS) -lnocol YACC = yacc ## # Following is so that all the sub-Makefile's can do a rm $(DIRT) # in their 'clean' DIRT = $(OBJS) $(TARG) *.o core a.out ## ####### END Makefile.head ######## ## # $Header: /home/vikas/src/nocol/RCS/Makefile.mid,v 1.4 2000/04/06 19:35:08 vikas Exp $ # # Makefile for 'nocol'. This file simply calls on other Makefiles in # the subdirectories to do all the work. All the definitions are used # by the other Makefiles which then do all the compile time definitions. # # To 'make' for only one program, use # make "SRCS=trapmon" [install|clean] # REV = "4.3.1" package=nocol OS=Darwin 8.0.1 WHOAMI=/usr/bin/whoami # Which programs are to be compiled and installed. # etherload ethernet load and pps monitor # eventselect print out events that match certain criterion # genmon Generic monitoring interface (ascii to nocol struct) # netconsole the nocol display for all the monitored data # noclog the noclogd logging daemon # nsmon Nameserver monitor # perlnocol Perl interface and associated monitors # pingmon Reachability monitors (ICMP, RPC, OSI) # portmon Check TCP ports on various machines. # radiusmon Check udp radius monitor # tknocol Tcl/Tk interface to nocol events (needs ndaemon) # tpmon Data thruput monitor # trapmon SNMP trap monitor # utility Small utility programs # doc Documentation and manual pages # SRCS = lib eventselect etherload genmon netconsole noclog nsmon ntpmon \ perlnocol pingmon portmon radiusmon tknocol tpmon trapmon \ utility webnocol doc support/multiping support/rpcping ## # This is the list of files that need to be 'tar-red'. Using the FF option # in the tar command and also excluding the RCS directories further down. DIST = COPYRIGHT HISTORY INSTALL README \ Makefile.dist Makefile.mid Makefile.head Makefile.tail Configure \ cmu-snmp include contrib html $(SRCS) ## # Following files are excluded from the distribution NOTDIST = makefile etherload/docs local-stuff support/mping \ cmu-snmp/bin cmu-snmp/lib cmu-snmp/man cmu-snmp/etc all: @-if [ "$(OS)" = "" ]; then \ OS=`uname -s -r`; \ else \ if [ "$(OS)" != "`uname -s -r`" ]; then \ echo "WARNING- MAKEFILES CONFIGURED FOR $(OS), NOT `uname -s -r`";\ fi; \ fi; \ echo "BUILDING NOCOL revision $(REV) for $(OS) $$OS" ;\ for i in $(SRCS); do \ if [ -d $$i ]; then \ (echo "" ; echo "MAKING IN $$i" ; echo "----------" ; \ cd $$i ; make $(MFLAGS) OS="$$OS" ;) \ fi ;\ done ## Ultrix make balked at the tests for directories, hence the second test install: lib -[ -d $(ROOTDIR) ] || mkdir $(ROOTDIR) -[ -d $(DATADIR) ] || mkdir $(DATADIR) -[ -d $(ETCDIR) ] || mkdir $(ETCDIR) -[ -d $(PIDDIR) ] || mkdir $(PIDDIR) -[ -d $(EXAMPLESDIR) ] || mkdir $(EXAMPLESDIR) -[ -d $(BINDIR) ] || mkdir $(BINDIR) -[ -d $(MSGSDIR) ] || mkdir $(MSGSDIR) -[ -d $(HELPDIR) ] || mkdir $(HELPDIR) @[ -d $(ROOTDIR) ] && [ -d $(DATADIR) ] && [ -d $(ETCDIR) ] \ && [ -d $(BINDIR) ] @-(touch NoColL ; $(INSTALL) -c -m 750 NoColL /tmp/;) >/dev/null 2>&1 ; @(if [ -f /tmp/NoColL ]; then rm -f NoColL /tmp/NoColL; else \ echo "YOU HAVE AN INCOMPATIBLE install, use 'myinstall' instead" ;\ echo "Else prefix your shell PATH with BSD style install" ;\ rm -f NoColL /tmp/NoColL ; exit 1 ; fi) @echo make $(MFLAGS) install ; @-for i in $(SRCS); do \ ( echo "" ; echo "MAKING IN $$i" ; echo "----------" ; cd $$i ; \ make $(MFLAGS) install ; ) ;\ done @echo "Installing sample config files under $(EXAMPLESDIR)/..." @-for i in */*-confg; do \ $(INSTALL) -m 444 -c $$i $(EXAMPLESDIR)/ ;\ done @echo "" ; echo " NOW su AND DO A make root " ## This should probably be in each individual sub-dirs makefile... root: @if [ "`$(WHOAMI)`" = "root" ]; then \ echo "Installing the following programs SUID under $(BINDIR)";\ echo " multiping etherload trapmon" ;\ $(INSTALL) -m 4711 -c support/multiping/multiping $(BINDIR) ;\ $(INSTALL) -m 4710 -c etherload/etherload $(BINDIR) ;\ $(INSTALL) -m 4710 -c trapmon/trapmon $(BINDIR) ;\ else \ echo "PLEASE RUN make root AS root (currently `whoami`)" ;\ fi tar: nocol.tar nocol.tar: @-rm -f nocol-$(REV).tar.gz @TEMPD=/var/tmp/t/nocol-$(REV) ;\ [ -d $$TEMPD ] || mkdir /var/tmp/t $$TEMPD ;\ if [ ! -d $$TEMPD ]; then \ echo "Fatal: cannot create directory $$TEMPD";\ exit 1 ; \ else \ rm -f $$TEMPD/XCLUDEFILES;\ fi ;\ echo "Creating list of exclude files and directories" ;\ for i in $(DIST) ; do \ find $$i \( -name RCS -o -name '*~' \) -print >>$$TEMPD/XCLUDEFILES;\ done ;\ for i in $(NOTDIST) ; do \ echo "$$i" >> $$TEMPD/XCLUDEFILES ;\ done ;\ echo "Copying src files to tmp location" ;\ tar cfX - $$TEMPD/XCLUDEFILES $(DIST) | (cd $$TEMPD; tar xf -) ;\ rm -f $$TEMPD/XCLUDEFILES ;\ echo "Creating distribution tar file" ;\ ( cd $$TEMPD/ ; \ cp Makefile.dist Makefile ; rm -f config.cache ;\ cd .. ; tar cf - nocol-$(REV) ) >nocol-$(REV).tar;\ ls -l nocol-$(REV).tar @rm -rf /var/tmp/t clean: for i in $(SRCS); do \ if [ -d $$i ]; then \ (cd $$i ; if [ -f Makefile ]; then make clean; \ else make -f Makefile.mid clean ; fi ) ; \ fi ;\ done # Cleanup everything ready to send out for distribution cleanall: clean rm -f config.cache Makefile.bak */Makefile.bak cp Makefile.dist Makefile @-for i in */Makefile.mid */*/Makefile.mid; do \ rm -f `echo $$i | sed 's/\.mid//'` ;\ done rcs: @-for i in $(SRCS); do \ (cd $$i ; make $(MFLAGS) rcs ; ) ;\ done ### ## ####### Makefile.tail ####### # # $Header: /home/vikas/src/nocol/RCS/Makefile.tail,v 1.3 2000/01/19 04:08:08 vikas Exp $ # # Define TARG to be the binaries and ETCFILES to put into ETCDIR .c.o: $(CC) $(CFLAGS) $(PROGCDEFS) -c $< installdir: @[ -d $(ROOTDIR) ] || mkdir $(ROOTDIR) @[ -d $(ETCDIR) ] || mkdir $(ETCDIR) @[ -d $(PIDDIR) ] || mkdir $(PIDDIR) @[ -d $(BINDIR) ] || mkdir $(BINDIR) @[ -d $(DATADIR) ] || mkdir $(DATADIR) @[ -d $(MSGSDIR) ] || mkdir $(MSGSDIR) @[ -d $(EXAMPLESDIR) ] || mkdir -p $(EXAMPLESDIR) depend: mkdep $(CFLAGS) `echo $(OBJS) | sed 's/\.o[ $]+/\.c/g'` ## ######## END Makefile.tail ##########