## ####### 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/lib/RCS/Makefile.mid,v 1.2 2000/01/27 05:02:21 vikas Exp $ # # Makefile.mid for nocol 'lib'. This file also builds the CMU-SNMP lib. # ## include Makefile.head # NLOG_HOST host where the noclogd logging daemon runs # LOGHOST = darwintel # directory for CMU snmp sources. Thie SNMP library will be built here CMUSNMP = $(SRCDIR)/cmu-snmp ## # Library calls not a part of your system. Define NEEDOBJS here. # These will be compiled into 'lib/libnocol' # putenv.o for putenv() library call - on NeXT # NEEDOBJS = ## Any program specific defines or libraries. Dir names should not have # trailing '/' PROGCDEFS = -DETCDIR=\"$(ETCDIR)\" -DDATADIR=\"$(DATADIR)\" \ -DPIDDIR=\"$(PIDDIR)\" -DNLOG_HOST=\"$(LOGHOST)\" PROGLIBS = TARG = libnocol.a OBJS= $(NEEDOBJS) bsdsignal.o eventlog.o event_utils.o misc.o \ fgetline.o getdate.o all: $(TARG) CMUSNMP $(TARG): $(OBJS) /bin/rm -f $(TARG) $(AR) $(TARG) $(OBJS) $(RANLIB) $(TARG) @echo "Created $(TARG) in `pwd`" CMUSNMP: @echo 'Making the new CMU SNMP library under $(CMUSNMP)' @cd $(CMUSNMP)/snmp ; \ if [ ! -f Makefile ]; then \ ./configure --quiet --prefix=$(CMUSNMP) --disable-shared ; \ fi ; \ make CC="$(CC)" MIBDIR=\"$(ETCDIR)\" all ; \ if [ ! -f $(CMUSNMP)/lib/libsnmp.a ]; then \ make install_inc ; make install_static ; \ fi ## For testing, to make a standalone version using -DTEST getdate: getdate.y @/bin/rm -f y.tab.c $(YACC) getdate.y $(CC) $(CFLAGS) -DTEST y.tab.c -o $@ @/bin/rm -f y.tab.c ## Putting this rule here just to be able to print out a message about # the 13 shift/reduce conflicts from yacc. getdate.o: getdate.y @/bin/rm -f y.tab.c @echo "Expect 13 shift/reduce conflicts from $(YACC) : " $(YACC) $< $(CC) $(CFLAGS) -c y.tab.c -o $@ @/bin/rm -f y.tab.c install: $(TARG) clean: @-cd $(CMUSNMP)/snmp ; make realclean ; \ rm -rf $(CMUSNMP)/lib $(CMUSNMP)/include $(CMUSNMP)/man $(CMUSNMP)/etc @-cd $(CMUSNMP)/snmpapps ; make realclean rm -f $(DIRT) getdate ## ####### 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 ##########