-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
102 lines (75 loc) · 2.47 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# 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 = cxref
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 -traditional
### 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
# 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=prt
# the owner and group of the installed program. Both are 'admin' on our
# system, but they may different on yours.
OWNER= admin
GROUP= admin
all: $(PROGS)
@echo " all" done
docxref: $(SCANOBJS)
$(CC) $(SCANOBJS) $(LEXLIB) -o $@
cscan.o docxref.o cxrfilt.o: $(INCLS)
fmtxref: fmtxref.c
$(CC) $(CFLAGS) [email protected] $(LDFLAGS) -o $@
cxrfilt: cxrfilt.c
$(CC) $(CFLAGS) [email protected] $(LDFLAGS) -o $@
$(CXREF): $(CXREF).c
$(CC) $(CFLAGS) -DSRCDIR='"$(LIB)"' -DSORT='"$(SORT)"' [email protected] $(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 /usr/man/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