# makefile for cxref -- C cross referencing program # # Arnold Robbins, Information and Computer Science, Georgia Tech # gatech!arnold # Copyright (c) 1985 by Arnold Robbins. # All rights reserved. # This program may not be sold, but may be distributed # provided this header is included. # some files are system dependant, e.g. where sort is. # change the appropriate macro definitions and recompile. ### definitions of files to compile and load, and other targets for make SCANOBJS= docxref.o cscan.o SCANSRCS= docxref.c cscan.l CXREF = ncxref INCLS= constdefs.h basename.c PROGS= docxref fmtxref cxrfilt $(CXREF) SRCS= $(SCANSRCS) fmtxref.c cxrfilt.c $(CXREF).c DOCS= README makefile cxref.1 PRINTS= $(INCLS) $(SRCS) $(DOCS) # CFLAGS= -O -Drindex=strrchr CFLAGS= ### system dependant definitions, change when you install cxref # for my use during development, put in my bin, but see next few lines. DESTDIR= $(BIN) LIB= $(BIN) # when installing, use the lines below; change DESTDIR to local bin of choice. DESTDIR=/usr/local/bin LIB=/usr/local/lib/cxref MANDIR=/usr/local/man # where to put the man page, use 1 instead of l if you don't have a manl. MANSEC=l # lex library, may be -lln on some systems LEXLIB= -ll # may be /bin/sort on some systems SORT=/usr/bin/sort # printer program, prt is for me, use pr on other systems P=pr # the owner and group of the installed program. Both are 'admin' on our # system, but they may different on yours. OWNER= root GROUP= staff all: $(PROGS) @echo " all" done docxref: $(SCANOBJS) $(CC) $(CFLAGS) $(SCANOBJS) $(LEXLIB) -o $@ ./docxref test.c | SORT1 >test.tmp echo "There should be no differences found" diff test.tmp test.ok && rm -f test.tmp cscan.o docxref.o cxrfilt.o: $(INCLS) fmtxref: fmtxref.c $(CC) $(CFLAGS) $@.c $(LDFLAGS) -o $@ cxrfilt: cxrfilt.c $(CC) $(CFLAGS) $@.c $(LDFLAGS) -o $@ $(CXREF): cxref.c $(CC) $(CFLAGS) -DSRCDIR='"$(LIB)"' -DSORT='"$(SORT)"' cxref.c $(LDFLAGS) -o $@ print: $(P) $(PRINTS) | lpr -b 'Cxref Source' touch print2 print2: $(PRINTS) $(P) $? | lpr -b 'Cxref New Source' touch print2 ### edit this before installing!! install: $(PROGS) # don't remove my bin! # rm -fr $(LIB) rm -f $(DESTDIR)/$(CXREF) # mkdir $(LIB) cp $(CXREF) $(DESTDIR)/$(CXREF) cp docxref $(LIB)/docxref cp fmtxref $(LIB)/fmtxref cp cxrfilt $(LIB)/cxrfilt cp $(CXREF).1 $(MANDIR)/man$(MANSEC)/$(CXREF).$(MANSEC) # cd $(DESTDIR); chmod 711 cxref; chown $(OWNER) cxref; chgrp $(GROUP) cxref # cd $(LIB); chmod 711 docxref fmtxref cxrfilt # cd $(LIB); chown $(OWNER) docxref fmtxref cxrfilt # cd $(LIB); chgrp $(GROUP) docxref fmtxref cxrfilt clean: rm -f $(SCANOBJS) clobber: clean rm -f $(PROGS) print2