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. |
---|
32 | DESTDIR= /usr/athena/ |
---|
33 | LIB= /usr/athena/lib/cxref |
---|
34 | |
---|
35 | # where to put the man page, use 1 instead of l if you don't have a manl. |
---|
36 | MANSEC=1 |
---|
37 | |
---|
38 | # lex library, may be -lln on some systems |
---|
39 | LEXLIB= -ll |
---|
40 | |
---|
41 | # may be /bin/sort on some systems |
---|
42 | SORT=/usr/bin/sort |
---|
43 | |
---|
44 | # printer program, prt is for me, use pr on other systems |
---|
45 | P=pr |
---|
46 | |
---|
47 | # the owner and group of the installed program. Both are 'admin' on our |
---|
48 | # system, but they may different on yours. |
---|
49 | OWNER= root |
---|
50 | GROUP= staff |
---|
51 | |
---|
52 | all: $(PROGS) |
---|
53 | @echo " all" done |
---|
54 | |
---|
55 | docxref: $(SCANOBJS) |
---|
56 | $(CC) $(SCANOBJS) $(LEXLIB) -o $@ |
---|
57 | |
---|
58 | cscan.o docxref.o cxrfilt.o: $(INCLS) |
---|
59 | |
---|
60 | fmtxref: fmtxref.c |
---|
61 | $(CC) $(CFLAGS) $@.c $(LDFLAGS) -o $@ |
---|
62 | |
---|
63 | cxrfilt: cxrfilt.c |
---|
64 | $(CC) $(CFLAGS) $@.c $(LDFLAGS) -o $@ |
---|
65 | |
---|
66 | $(CXREF): $(CXREF).c |
---|
67 | $(CC) $(CFLAGS) -DSRCDIR='"$(LIB)"' -DSORT='"$(SORT)"' $@.c $(LDFLAGS) -o $@ |
---|
68 | |
---|
69 | print: |
---|
70 | $(P) $(PRINTS) | lpr -b 'Cxref Source' |
---|
71 | touch print2 |
---|
72 | |
---|
73 | print2: $(PRINTS) |
---|
74 | $(P) $? | lpr -b 'Cxref New Source' |
---|
75 | touch print2 |
---|
76 | |
---|
77 | install: $(PROGS) |
---|
78 | rm -fr $(LIB) |
---|
79 | rm -f $(DESTDIR)/cxref |
---|
80 | mkdir $(LIB) |
---|
81 | install -s -m 755 -o $(OWNER) -g $(GROUP) $(CXREF) $(DESTDIR)/$(CXREF) |
---|
82 | for i in docxref fmtxref cxrfilt; do \ |
---|
83 | install -s -m 755 -o $(OWNER) -g $(GROUP) $$i $(LIB)/$$i; \ |
---|
84 | done |
---|
85 | |
---|
86 | install -m 644 cxref.1 /usr/man/man$(MANSEC)/cxref.$(MANSEC) |
---|
87 | |
---|
88 | clean: |
---|
89 | rm -f $(SCANOBJS) |
---|
90 | rm -f $(PROGS) print2 |
---|
91 | |
---|
92 | |
---|