forked from jhenin/spiff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
173 lines (133 loc) · 4.81 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#
# START OF LOCAL CONFIGURATION INFORMATION
# change the following lines to reflect your local environment
#
#
# name of the directory into which the binary should be installed
# used only when you use 'make install'
#
INSDIR=/usr/tmp
#
# choose one from each of 1) 2) and 3) below
#
#
# 1) SELECTION OF OPERATING SYSTEM VARIETY
# choose a) b) or c)
#
# a) for BSD derivitives, enable the following line
OSFLAG=
# b) for XENIX systems, enable the following line
#OSFLAG=-DXENIX
# b) for other A.T. and T. derivitives, enable the following line
#OSFLAG=-DATT
#
# 2) SELECTION OF TERMINAL CONTROL LIBRARY
# choose either of a) b) or c)
#
# a) if you use termcap, enable the following lines
#TFLAG=-DM_TERMCAP
#TLIB=/lib/libtermcap.a
# b) if you are using terminfo on a XENIX machine, enable the following lines
#TFLAG=-DM_TERMINFO
#TLIB=tinfo
# c) if you use terminfo on any other type of machine,
# enable the following lines
#
# These both work on HPUX ...
#
#TFLAG=-DM_TERMINFO -DM_TERMCAP
#TLIB=Hcurses /lib/libtermcap.a
#
TFLAG=-DM_TERMINFO
TLIB=ncurses
#
# 3) SELECTION OF WINDOW MANAGER AVAILABILITY
#
# if you have the Bellcore's MGR window manager, enable the following lines
#VISFLAG=-DMGR
#VISLIB=/usr/public/pkg/mgr/lib/libmgr.a
#MGRINCDIR=-I/usr/public/pkg/mgr/include
#MGRINCS=$(MGRINC)/dump.h $(MGRINC)/term.h $(MGRINC)/restart.h $(MGRINC)/window.h
#
# END OF LOCAL CONFIGRATION INFORMATION, the rest of this
# file may be modified only at great risk
# -- caveat hackor
#
# Copyright (c) 1988 Bellcore
# All Rights Reserved
# Permission is granted to copy or use this program, EXCEPT that it
# may not be sold for profit, the copyright notice must be reproduced
# on copies, and credit should be given to Bellcore where it is due.
# BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
#
CC=cc
OBJ= spiff.o output.o compare.o float.o strings.o exact.o miller.o parse.o command.o comment.o tol.o line.o token.o floatrep.o misc.o visual.o
CFILES= spiff.c output.c compare.c float.c strings.c exact.c miller.c parse.c command.c comment.c tol.c line.c floatrep.c token.c misc.c visual.c
HFILES=misc.h strings.h line.h float.h floatrep.h tol.h command.h comment.h token.h edit.h parse.h compare.h flagdefs.h exact.h miller.h visual.h output.h
OTHER=README Makefile Sample.1 Sample.2 Sample.3 Sample.4 paper.ms paper.out
MANPAGE=spiff.1
CFLAGS=$(OSFLAG) $(TFLAG) $(VISFLAG) -ansi -DNOCHATTER
default: spiff
spiff: $(OBJ)
$(CC) $(CFLAGS) -o spiff $(OBJ) $(VISLIB) -l$(TLIB)
spiff.o: spiff.c misc.h line.h token.h tol.h command.h edit.h parse.h compare.h flagdefs.h exact.h miller.h visual.h
visual.o: visual.c misc.h visual.h $(MGRINCS)
$(CC) -c $(CFLAGS) $(MGRINCDIR) visual.c
misc.o: misc.c visual.h misc.h
parse.o: parse.c misc.h line.h command.h float.h tol.h comment.h parse.h token.h flagdefs.h
# @echo compiler may report 4 statement not reached warning messages for parse.c
$(CC) $(CFLAGS) -c parse.c
command.o: command.c float.h tol.h misc.h
comment.o: comment.c misc.h comment.h
tol.o: tol.c tol.h float.h
output.o: output.c output.h misc.h edit.h flagdefs.h
compare.o: compare.c misc.h strings.h float.h tol.h token.h line.h compare.h flagdefs.h
# @echo compiler may report 1 statement not reached warning message for compare.c
$(CC) $(CFLAGS) -c compare.c
float.o: float.c misc.h strings.h float.h floatrep.h
floatrep.o: floatrep.c misc.h strings.h floatrep.h
strings.o: strings.c misc.h strings.h
exact.o: exact.c exact.h misc.h edit.h
miller.o: miller.c miller.h misc.h edit.h token.h
token.o: token.c token.h misc.h
line.o: line.c line.h misc.h
clean:
rm -f *.o spiff
clobber: clean
rm -f spiff
ci:
ci -l -q '-m $(CIMSG)' $(CFILES) $(HFILES) $(OTHER) $(MANPAGE)
col:
co -l $(CFILES) $(HFILES) $(OTHER) $(MANPAGE)
cirev:
ci -l -r$(REV) '-m $(CIMSG)' $(CFILES) $(HFILES) $(OTHER) $(MANPAGE)
cirel:
ci -l -q -sRel $(CFILES) $(HFILES) $(OTHER) $(MANPAGE)
lint:
lint $(CFLAGS) $(CFILES)
cpio:
for i in $(CFILES) $(HFILES) $(OTHER) $(MANPAGE); do echo $$i; done | cpio -ocv > spiff.cpio
cmd:
-$(CMD) $(CFILES) $(HFILES) $(OTHER) $(MANPAGE)
pot_luck_install:
mv spiff $(INSDIR)/bin
cp $(MANPAGE) $(INSDIR)/man/man1
BINDIR=/opt/spiff/bin
MANDIR=/opt/spiff/man/man1
DOCDIR=/opt/spiff/doc
EGDIR=/opt/spiff/lib
install:
if [ -d $(BINDIR) ]; then set +x; \
else (set -x; mkdirhier $(BINDIR)); fi
bsdinst -c -s spiff $(BINDIR)
if [ -d $(EGDIR) ]; then set +x; \
else (set -x; mkdirhier $(EGDIR)); fi
for i in Sample.1 Sample.2 Sample.3 Sample.4; do \
(set -x; bsdinst -c -m 0644 $$i $(EGDIR)); \
done
if [ -d $(MANDIR) ]; then set +x; \
else (set -x; mkdirhier $(MANDIR)); fi
bsdinst -c -m 0644 spiff.1 $(MANDIR)
if [ -d $(DOCDIR) ]; then set +x; \
else (set -x; mkdirhier $(DOCDIR)); fi
bsdinst -c -m 0644 paper.ms $(DOCDIR)