[174] | 1 | # makefile for cxref -- C cross referencing program |
---|
| 2 | # |
---|
| 3 | # Arnold Robbins, Information and Computer Science, Georgia Tech |
---|
| 4 | # gatech!arnold |
---|
| 5 | # Copyright (c) 1985 by Arnold Robbins. |
---|
| 6 | # All rights reserved. |
---|
| 7 | # This program may not be sold, but may be distributed |
---|
| 8 | # provided this header is included. |
---|
| 9 | |
---|
| 10 | # some files are system dependant, e.g. where sort is. |
---|
| 11 | # change the appropriate macro definitions and recompile. |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | ### definitions of files to compile and load, and other targets for make |
---|
| 15 | |
---|
| 16 | SCANOBJS= docxref.o cscan.o |
---|
| 17 | SCANSRCS= docxref.c cscan.l |
---|
| 18 | |
---|
| 19 | CXREF = cxref |
---|
| 20 | INCLS= constdefs.h basename.c |
---|
| 21 | PROGS= docxref fmtxref cxrfilt $(CXREF) |
---|
| 22 | SRCS= $(SCANSRCS) fmtxref.c cxrfilt.c $(CXREF).c |
---|
| 23 | DOCS= README makefile cxref.1 |
---|
| 24 | |
---|
| 25 | PRINTS= $(INCLS) $(SRCS) $(DOCS) |
---|
| 26 | |
---|
| 27 | CFLAGS= -O |
---|
| 28 | |
---|
| 29 | ### system dependant definitions, change when you install cxref |
---|
| 30 | |
---|
| 31 | # for my use during development, put in my bin, but see next few lines. |
---|
[175] | 32 | DESTDIR= |
---|
| 33 | CONFDIR=/usr/athena |
---|
[174] | 34 | LIB= /usr/athena/lib/cxref |
---|
| 35 | |
---|
| 36 | # where to put the man page, use 1 instead of l if you don't have a manl. |
---|
| 37 | MANSEC=1 |
---|
| 38 | |
---|
| 39 | # lex library, may be -lln on some systems |
---|
| 40 | LEXLIB= -ll |
---|
| 41 | |
---|
| 42 | # may be /bin/sort on some systems |
---|
| 43 | SORT=/usr/bin/sort |
---|
| 44 | |
---|
| 45 | # printer program, prt is for me, use pr on other systems |
---|
| 46 | P=pr |
---|
| 47 | |
---|
| 48 | # the owner and group of the installed program. Both are 'admin' on our |
---|
| 49 | # system, but they may different on yours. |
---|
| 50 | OWNER= root |
---|
| 51 | GROUP= staff |
---|
| 52 | |
---|
| 53 | all: $(PROGS) |
---|
| 54 | @echo " all" done |
---|
| 55 | |
---|
| 56 | docxref: $(SCANOBJS) |
---|
| 57 | $(CC) $(SCANOBJS) $(LEXLIB) -o $@ |
---|
| 58 | |
---|
| 59 | cscan.o docxref.o cxrfilt.o: $(INCLS) |
---|
| 60 | |
---|
| 61 | fmtxref: fmtxref.c |
---|
| 62 | $(CC) $(CFLAGS) $@.c $(LDFLAGS) -o $@ |
---|
| 63 | |
---|
| 64 | cxrfilt: cxrfilt.c |
---|
| 65 | $(CC) $(CFLAGS) $@.c $(LDFLAGS) -o $@ |
---|
| 66 | |
---|
| 67 | $(CXREF): $(CXREF).c |
---|
| 68 | $(CC) $(CFLAGS) -DSRCDIR='"$(LIB)"' -DSORT='"$(SORT)"' $@.c $(LDFLAGS) -o $@ |
---|
| 69 | |
---|
| 70 | print: |
---|
| 71 | $(P) $(PRINTS) | lpr -b 'Cxref Source' |
---|
| 72 | touch print2 |
---|
| 73 | |
---|
| 74 | print2: $(PRINTS) |
---|
| 75 | $(P) $? | lpr -b 'Cxref New Source' |
---|
| 76 | touch print2 |
---|
| 77 | |
---|
| 78 | install: $(PROGS) |
---|
[175] | 79 | rm -fr $(DESTDIR)$(LIB) |
---|
| 80 | rm -f $(DESTDIR)$(CONFDIR)/cxref |
---|
| 81 | mkdir $(DESTDIR)$(LIB) |
---|
[3361] | 82 | install -c -s -m 755 -o $(OWNER) -g $(GROUP) $(CXREF) \ |
---|
[175] | 83 | $(DESTDIR)$(CONFDIR)/$(CXREF) |
---|
[174] | 84 | for i in docxref fmtxref cxrfilt; do \ |
---|
[3361] | 85 | install -c -s -m 755 -o $(OWNER) -g $(GROUP) $$i \ |
---|
[175] | 86 | $(DESTDIR)$(LIB)/$$i; \ |
---|
[174] | 87 | done |
---|
| 88 | |
---|
[3361] | 89 | install -c -m 644 cxref.1 $(DESTDIR)/usr/man/man$(MANSEC)/cxref.$(MANSEC) |
---|
[174] | 90 | |
---|
| 91 | clean: |
---|
| 92 | rm -f $(SCANOBJS) |
---|
| 93 | rm -f $(PROGS) print2 |
---|
| 94 | |
---|
| 95 | |
---|
[2157] | 96 | depend: |
---|
[2663] | 97 | touch Make.depend; makedepend -fMake.depend ${CFLAGS} ${SRCS} |
---|
[2157] | 98 | |
---|
| 99 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
---|
| 100 | |
---|
| 101 | docxref.o: docxref.c /usr/include/stdio.h /usr/include/ctype.h basename.c |
---|
| 102 | cscan.o: cscan.l constdefs.h |
---|
| 103 | fmtxref.o: fmtxref.c /usr/include/stdio.h /usr/include/ctype.h basename.c |
---|
| 104 | cxrfilt.o: cxrfilt.c /usr/include/stdio.h constdefs.h basename.c |
---|
| 105 | cxref.o: cxref.c /usr/include/stdio.h /usr/include/ctype.h |
---|
| 106 | cxref.o: /usr/include/signal.h /usr/include/sys/types.h |
---|
| 107 | cxref.o: /usr/include/sys/stat.h basename.c |
---|