## ####### 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 ######## ## # $Id: Makefile.mid,v 1.1 1998/07/31 18:25:07 vikas Exp $ # # Makefile for 'pingmon' # # This file is pretty complicated because the same objects create OSIpingmon # as well as IPpingmon. Only the compile time definitions are different. # One way was to have two separate Makefile's but passing the definitions # between three layers of 'make' is kinda hairy (3 layers since invoked from # the main 'nocol' makefile). # # Anyway, you can do the following: # # make PROTOCOL=IP # make PROTOCOL=OSI # ## SET THIS ## SET THIS # Directories needed by the program. # IPPING location of the IP ping program (useing multiping ?) # RPCPING location of the RPC ping (see under support/ dir) # OSIPING location of the OSI ping program #IPPING = /usr/etc/ping IPPING = $(BINDIR)/multiping RPCPING = $(BINDIR)/rpcping OSIPING = /usr/sunlink/bin/osiping ## SET THIS # Set the various defines for compile time defines: # -DMULTIPING if using IPPING = 'multiping' # PROGCDEFS = -DMULTIPING TARG = ippingmon osipingmon rpcpingmon OBJS = pingmon.o poll_sites.o ## The following is a bit hairy since we are trying to build two # similar targets with very minor differences. The idea is to # always build both targets (hence we delete the objects after # building the first target). Note that we need the INCLUDE directory... INCLUDEDIR = $(SRCDIR)/include all: $(TARG) @touch $(TARG) IFCpingmon # Delete the objects after making the first two targets. Leave them after # making the last target. ippingmon: IFCpingmon @rm -f $(OBJS) @make PROGCDEFS="$(PROGCDEFS) -DIPPING='\"$(IPPING)\"' " pingmon @mv pingmon ippingmon ; rm -f $(OBJS) @echo " ======== Made IP version of pingmon ========" ; echo "" osipingmon: IFCpingmon @rm -f $(OBJS) @make PROGCDEFS="$(PROGCDEFS) -DOSIPING='\"$(OSIPING)\"' " pingmon @mv pingmon osipingmon ; rm -f $(OBJS) @echo " ======== Made OSI version of pingmon ========" ; echo "" rpcpingmon: IFCpingmon @rm -f $(OBJS) @make PROGCDEFS="$(PROGCDEFS) -DRPCPING='\"$(RPCPING)\"' " pingmon @mv pingmon rpcpingmon @echo " ======== Made RPC version of pingmon ========" ; echo "" IFCpingmon: *.c $(INCLUDEDIR)/nocol.h $(INCLUDEDIR)/pingmon.h rm -f IFCpingmon pingmon: $(OBJS) $(CC) $(CFLAGS) $(OBJS) $(LIBS) $(PROGCDEFS) -o pingmon $(IPPING) $(OSIPING) $(RPCPING): IFC @-[ -f "$@" ] || \ { \ echo "WARNING: $@ does not exist" ;\ echo " Install $@ with proper owner and mode"; \ echo ' (Mode should be 4751 and owner should be root) '; \ exit 1 ;\ } # To force checking IFC: install: $(TARG) -for i in $(TARG); \ do [ -f $$i ] && $(INSTALL) -c -m 751 $$i $(BINDIR)/ ;done clean: rm -f $(DIRT) IFCpingmon pingmon rcs: @echo "Doing 'rcs' in 'pingmon'" @-for i in $(OBJS); do \ $(CO) -q `basename $$i .o`.c ;\ 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 ##########