-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile.in
305 lines (286 loc) · 8.54 KB
/
makefile.in
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
#****************************************************************
#Copyright (c) 1993 Bell Communications Research, Inc. (Bellcore)
#
#Permission to use, copy, modify, and distribute this material
#for any purpose and without fee is hereby granted, provided
#that the above copyright notice and this permission notice
#appear in all copies, and that the name of Bellcore not be
#used in advertising or publicity pertaining to this
#material without the specific, prior written permission
#of an authorized representative of Bellcore. BELLCORE
#MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY
#OF THIS MATERIAL FOR ANY PURPOSE. IT IS PROVIDED "AS IS",
#WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
#****************************************************************
# $Header: /u/saul/atac/src/RCS/Makefile,v 3.21 94/04/05 09:22:08 saul Exp $
#
# Makefile for ATAC. See README.
#
#
#-----------------------------------------------$Log: Makefile,v $
# Revision 3.21 94/04/05 09:22:08 saul
# Don't append contact info to README
#
# Revision 3.20 94/04/04 09:46:08 jrh
# Add Release Copyright
#
# Revision 3.19 93/09/01 16:59:41 ewk
# Change installation of tutorial/makefile to tutorial/Makefile.
#
# Revision 3.18 93/08/09 12:49:11 saul
# loguse
#
# Revision 3.17 93/07/13 11:13:26 ewk
# Add atacLD and atacLD.1 information.
#
# Revision 3.16 93/07/11 09:03:27 saul
# continue after chmod on man1 fails
# drop install date from Version
#
# Revision 3.15 93/06/07 15:38:20 ewk
# Now ignores failed attempts to remove directories in .../lib/atac.
#
# Revision 3.14 93/05/17 12:24:57 ewk
# Added chmod calls to make lib/src, lib/tutorial, man/man1,
# and man/cat1 directories executable (755).
#
# Revision 3.13 93/05/14 16:02:28 ewk
# Revised chmod calls to explicitly set permissions in bin, lib, and man.
#
# Revision 3.12 93/05/05 11:28:32 ewk
# Removed the "print" target. Specified all "rm's" and "chmod's"
# in the bin and man/man1 directories to avoid effecting user
# created executables and man pages. Added a "chmod" to tutorial
# target. Changed permissions so man pages are not made executable.
#
# Revision 3.11 93/05/03 16:40:26 ewk
# Removed comments at end of lines not portable to Pyramid.
# Also, moved and added "rm" and "chmod" calls to avoid
# problems overwriting or appending to existing files during
# installation.
#
# Revision 3.10 93/04/29 17:01:57 ewk
# Changed to reflect the name changes from atacLib
# to ataclib and atacMin to atacmin.
#
# Revision 3.9 93/04/15 10:46:32 saul
# Avoid sh cannot create durring installation.
# Change contact to atac@****.bellcore.com
#
# Revision 3.8 93/04/08 10:51:46 saul
# install all .1 files (man pages).
#
# Revision 3.7 93/03/31 11:57:29 saul
# syntax error.
#
# Revision 3.6 93/03/31 11:36:23 saul
# Change sence of if so false is in else branch. Pyramid needs this.
#
# Revision 3.5 93/03/26 10:52:41 saul
# Install atac_to_bin.
#
# Revision 3.4 93/03/16 07:48:21 saul
# need "else; true;". Correct err msg for ommitted INSTALLDIR
#
# Revision 3.3 93/03/15 15:43:48 saul
# Installation improvements (LIBDIR, MANDIR, etc.)
#
# Revision 3.2 93/02/23 13:13:51 saul
# traditional vs ansi cpp configurations
#
# Revision 3.1 92/12/03 08:59:29 saul
# newform/pg portability
#
# Revision 3.0 92/11/06 07:42:49 saul
# propagate to version 3.0
#
# Revision 2.23 92/10/30 10:00:44 saul
# add CFLAGS=-I.. remove -Dvoid=int
#
# Revision 2.22 92/10/29 11:18:32 saul
# New installation procedure.
#
#-----------------------------------------------end of log
SHELL=/bin/sh
@SET_MAKE@
prefix=@prefix@
INSTALLDIR = @exec_prefix@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
CFLAGS = -I.. -DHAVE_CONFIG_H @CFLAGS@
BINDIR=$(INSTALLDIR)/bin
LIBDIR=$(INSTALLDIR)/lib
SRCDIR=$(LIBDIR)/atac/src
TUTORIALDIR=$(LIBDIR)/atac/tutorial
MANDIR=$(INSTALLDIR)/man
system: ATAC_I ATACYSIS ATAC_CPP TOOLS
clean:
cd atac_i; $(MAKE) clean
cd atacysis; $(MAKE) clean
cd atac_cpp; $(MAKE) clean
cd tools; $(MAKE) clean
distclean: clean
rm -f config.* makefile install
install: system LIB BIN MAN TUTORIAL
install.source: SOURCE
uninstall:
-@$(LIBDIR)/atac/loguse $(LIBDIR)/atac install uninstall $(BINDIR) \
>/dev/null 2>/dev/null
rm -fr $(LIBDIR)/atac
rm -f $(BINDIR)/atac
rm -f $(BINDIR)/atacCC
rm -f $(BINDIR)/atacLD
rm -f $(BINDIR)/ataclib
rm -f $(BINDIR)/atacmin
rm -f $(BINDIR)/atactm
rm -f $(MANDIR)/man1/atac.1
rm -f $(MANDIR)/man1/atacCC.1
rm -f $(MANDIR)/man1/atacLD.1
rm -f $(MANDIR)/man1/ataclib.1
rm -f $(MANDIR)/man1/atacmin.1
rm -f $(MANDIR)/man1/atactm.1
rm -f $(MANDIR)/cat1/atac*
ATAC_I:
@cd atac_i; $(MAKE) "CFLAGS=$(CFLAGS)"
ATACYSIS: ATAC_I
@cd atacysis; $(MAKE) "CFLAGS=$(CFLAGS)"
ATAC_CPP:
@cd atac_cpp; $(MAKE) "CFLAGS=$(CFLAGS)"
TOOLS:
@cd tools; $(MAKE) "CFLAGS=$(CFLAGS)"
#
# create install directories as needed
#
$(BINDIR) \
$(LIBDIR)/atac \
$(MANDIR)/cat1 \
$(MANDIR)/man1 \
$(SRCDIR) \
$(TUTORIALDIR) :
sh mkdirs.sh $@
#
# install lib
#
LIB: $(BINDIR) $(LIBDIR)/atac
@ $(INSTALL_PROGRAM) tools/loguse $(LIBDIR)/atac
-@$(LIBDIR)/atac/loguse $(LIBDIR)/atac install old $(BINDIR) \
>/dev/null 2>/dev/null
-@rm -f $(LIBDIR)/atac/*
@:
@: README
@:
@echo "See $(MANDIR)/man1/atac.1 for more info." >>$(LIBDIR)/atac/README
@echo "#$(LIBDIR)/atac/README created" >&2
@:
@: Version
@:
$(INSTALL_DATA) Version $(LIBDIR)/atac/Version
@:
@: ansi_cpp
@:
@rm -f cpp_ansi.c cpp_ansi
@echo '#define m(a) "a"' >cpp_ansi.c
@chmod u+w cpp_ansi.c
@echo "main(){return *(m(x))=='x';}" >>cpp_ansi.c
@cc -o cpp_ansi cpp_ansi.c
-@if ./cpp_ansi; \
then \
echo "Default ANSI cpp" >$(LIBDIR)/atac/cpp_ansi; \
echo "#Default ANSI cpp" >&2; \
else \
echo "#Default non-ANSI cpp" >&2; \
fi
-@rm -f cpp_ansi cpp_ansi.c
@:
@: lib
@:
$(INSTALL_PROGRAM) atac_i/atac_i $(LIBDIR)/atac
$(INSTALL_PROGRAM) atac_cpp/atac_cpp $(LIBDIR)/atac
$(INSTALL_PROGRAM) atacysis/atacysis $(LIBDIR)/atac
$(INSTALL_PROGRAM) atacysis/atac_to_bin $(LIBDIR)/atac
$(INSTALL_PROGRAM) tools/minimize $(LIBDIR)/atac
$(INSTALL_PROGRAM) tools/hili $(LIBDIR)/atac
$(INSTALL_DATA) tools/predefs.c $(LIBDIR)/atac
$(INSTALL_DATA) tools/atac_rt.o $(LIBDIR)/atac
$(INSTALL_PROGRAM) tools/loguse $(LIBDIR)/atac
@touch $(LIBDIR)/atac/log
$(CC) -E tools/predefs.c | sed -n 's/^XxX//p' >$(LIBDIR)/atac/predefs
@chmod 666 $(LIBDIR)/atac/log
-@$(LIBDIR)/atac/loguse $(LIBDIR)/atac install new $(BINDIR) \
>/dev/null 2>/dev/null
#
# install bin
#
BIN: $(BINDIR)
@rm -f $(BINDIR)/atac
@rm -f $(BINDIR)/atacCC
@rm -f $(BINDIR)/atacLD
@rm -f $(BINDIR)/ataclib
@rm -f $(BINDIR)/atacmin
@rm -f $(BINDIR)/atactm
@:
@: atac
@:
@sed '/^EXPAND/,$$d' tools/atac >$(BINDIR)/atac
@chmod u+w $(BINDIR)/atac
-@if newform </dev/null; \
then \
echo "EXPAND='newform -i'" >>$(BINDIR)/atac; \
else \
echo "EXPAND='expand'" >>$(BINDIR)/atac; \
fi 2>/dev/null >/dev/null
-@if more -s </dev/null; \
then \
echo "MORE='more -s'" >>$(BINDIR)/atac; \
else \
echo "MORE='pg -f'" >>$(BINDIR)/atac; \
fi
@sed '1,/^MORE/d' tools/atac >>$(BINDIR)/atac
@echo "#$(BINDIR)/atac created" >&2
chmod 755 $(BINDIR)/atac
@:
@: ataclib
@:
@echo "#!/bin/sh" >$(BINDIR)/ataclib
@chmod u+w $(BINDIR)/ataclib
echo "echo $(LIBDIR)/atac" >>$(BINDIR)/ataclib
chmod 755 $(BINDIR)/ataclib
@:
@: bin
@:
$(INSTALL_PROGRAM) tools/atacCC $(BINDIR)
$(INSTALL_PROGRAM) tools/atacLD $(BINDIR)
$(INSTALL_PROGRAM) tools/atacmin $(BINDIR)
$(INSTALL_PROGRAM) atacysis/atactm $(BINDIR)
#
# install man
#
MAN: $(MANDIR)/man1 $(MANDIR)/cat1
-@chmod 755 $(MANDIR)/man1 2>/dev/null
-@chmod 755 $(MANDIR)/cat1 2>/dev/null
sh -c 'for i in atac*.1;do rm -f $(MANDIR)/man1/$$i $(MANDIR)/cat1/$$i;done'
$(INSTALL_DATA) atac*.1 $(MANDIR)/man1
#
# install tutorial
#
TUTORIAL: $(TUTORIALDIR)
@chmod 755 $(TUTORIALDIR)
rm -f $(TUTORIALDIR)/*
$(INSTALL_DATA) tutorial/Makefile $(TUTORIALDIR)
$(INSTALL_DATA) tutorial/input1 $(TUTORIALDIR)
$(INSTALL_DATA) tutorial/input2 $(TUTORIALDIR)
$(INSTALL_DATA) tutorial/input3 $(TUTORIALDIR)
$(INSTALL_DATA) tutorial/main.c $(TUTORIALDIR)
$(INSTALL_DATA) tutorial/wc.c $(TUTORIALDIR)
#
# install source
#
SOURCE: $(SRCDIR)
@chmod 755 $(SRCDIR)
rm -f $(SRCDIR)/*
@ $(INSTALL_DATA) atac_cpp/cccp.c $(SRCDIR)
@ $(INSTALL_DATA) atac_cpp/cexp.y $(SRCDIR)
@ $(INSTALL_DATA) atac_cpp/obstack.c $(SRCDIR)
@ $(INSTALL_DATA) atac_cpp/obstack.h $(SRCDIR)
@ $(INSTALL_DATA) atac_cpp/version.c $(SRCDIR)