source: trunk/athena/bin/cxref/Makefile @ 175

Revision 175, 2.2 KB checked in by treese, 38 years ago (diff)
Fixed installation (DESTDIR macro was used wrong).
Line 
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
16SCANOBJS= docxref.o cscan.o
17SCANSRCS= docxref.c cscan.l
18
19CXREF = cxref
20INCLS= constdefs.h basename.c
21PROGS= docxref fmtxref cxrfilt $(CXREF)
22SRCS=  $(SCANSRCS) fmtxref.c cxrfilt.c $(CXREF).c
23DOCS=  README makefile cxref.1
24
25PRINTS= $(INCLS) $(SRCS) $(DOCS)
26
27CFLAGS= -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.
32DESTDIR=
33CONFDIR=/usr/athena
34LIB= /usr/athena/lib/cxref
35
36# where to put the man page, use 1 instead of l if you don't have a manl.
37MANSEC=1
38
39# lex library, may be -lln on some systems
40LEXLIB= -ll
41
42# may be /bin/sort on some systems
43SORT=/usr/bin/sort
44
45# printer program, prt is for me, use pr on other systems
46P=pr
47
48# the owner and group of the installed program.  Both are 'admin' on our
49# system, but they may different on yours.
50OWNER= root
51GROUP= staff
52
53all: $(PROGS)
54        @echo " all" done
55
56docxref: $(SCANOBJS)
57        $(CC) $(SCANOBJS) $(LEXLIB) -o $@
58
59cscan.o docxref.o cxrfilt.o: $(INCLS)
60
61fmtxref: fmtxref.c
62        $(CC) $(CFLAGS) $@.c $(LDFLAGS) -o $@
63
64cxrfilt: cxrfilt.c
65        $(CC) $(CFLAGS) $@.c $(LDFLAGS) -o $@
66
67$(CXREF): $(CXREF).c
68        $(CC) $(CFLAGS) -DSRCDIR='"$(LIB)"' -DSORT='"$(SORT)"' $@.c $(LDFLAGS) -o $@
69
70print:
71        $(P) $(PRINTS) | lpr -b 'Cxref Source'
72        touch print2
73
74print2: $(PRINTS)
75        $(P) $? | lpr -b 'Cxref New Source'
76        touch print2
77
78install: $(PROGS)
79        rm -fr $(DESTDIR)$(LIB)
80        rm -f $(DESTDIR)$(CONFDIR)/cxref
81        mkdir $(DESTDIR)$(LIB)
82        install -s -m 755 -o $(OWNER) -g $(GROUP) $(CXREF) \
83                $(DESTDIR)$(CONFDIR)/$(CXREF)
84        for i in docxref fmtxref cxrfilt; do \
85                install -s -m 755 -o $(OWNER) -g $(GROUP) $$i \
86                $(DESTDIR)$(LIB)/$$i; \
87        done
88
89        install -m 644 cxref.1 $(DESTDIR)/usr/man/man$(MANSEC)/cxref.$(MANSEC)
90
91clean:
92        rm -f $(SCANOBJS)
93        rm -f $(PROGS) print2
94
95
Note: See TracBrowser for help on using the repository browser.