-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
528 lines (511 loc) · 16.6 KB
/
Makefile.am
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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS = sprut
sprut_SOURCES = anal.c gen.c tab.c main.c common.c anal.h gen.h tab.h common.h yacc.h \
AMMUNITION/objstack.c \
AMMUNITION/position.c \
AMMUNITION/allocate.c \
AMMUNITION/errors.c \
AMMUNITION/vlobject.c \
AMMUNITION/hashtab.c \
AMMUNITION/commline.c
nodist_sprut_SOURCES = yacc.c ird.c ird.h A1_base.sprut A1_syntax.sprut A1_value.sprut A1_test.sprut
CLEANFILES = yacc.c ird.c ird.h A1_base.sprut A1_syntax.sprut A1_value.sprut A1_test.sprut
sprut_CFLAGS = -I$(srcdir)/AMMUNITION
sprut_LDFLAGS = -static
dist_doc_DATA = sprut.txt sprut.info sprut.html sprut-1.html sprut-2.html sprut-3.html sprut-4.html sprut-5.html\
sprut.pdf sprut.dvi sprut.ps
dist_man_MANS = sprut.1
include_HEADERS = std_type.sprut std_mem.sprut std_bmem.sprut std_str.sprut std_pos.sprut
EXTRA_DIST = yacc.y sprut-ird.h sprut-ird.c A_test.sprut A_syntax.sprut A_value.sprut A_base.sprut\
ird.sprut\
sprut.tst README INSTALL sprut.sgml.in
ACLOCAL_AMFLAGS = -I m4
check : test
all-local:
dist-local:
# Delete all not needed for distribution.
distclean-local:
rm -f sprut.sgml sprut.tex sprut.log sprut.aux sprut.toc sprut.tmp sprut.out\
A1_test.sprut A1_syntax.sprut A1_value.sprut A1_base.sprut
ird.c : $(srcdir)/sprut-ird.c
cp $(srcdir)/sprut-ird.c $@
chmod +w $@
ird.h : $(srcdir)/sprut-ird.h
cp $(srcdir)/sprut-ird.h $@
chmod +w $@
sprut-anal.$(OBJEXT) sprut-gen.$(OBJEXT) sprut-tab.$(OBJEXT) sprut-main.$(OBJEXT) sprut-yacc.$(OBJEXT): ird.h
yacc.c: $(srcdir)/yacc.y
@echo must be because of error recovery \"conflicts: 2 shift/reduce\"
$(YACC) $(srcdir)/yacc.y
@echo
# This is necessary for MS-DOS YACC (BISON) and VMS POSIX YACC
if test ! -f y.tab.c && test -f y_tab.c;then mv y_tab.c $@;\
elif test ! -f y.tab.c && test -f ytab.c;then mv ytab.c $@;\
else mv y.tab.c $@;fi
# B-tests and test of `sprut' built on base `ird.sprut'
test : sprut A-test A1-test B-tests sprut-boot
@echo
@echo "translation of internal representation of sprut itself"
@echo ./sprut -macro -debug -access -set -copy $(srcdir)/ird.sprut
@if ./sprut -macro -debug -access -set -copy $(srcdir)/ird.sprut; then\
echo "+++ internal representation of sprut itself is ok";\
rm -f ird.c ird.h;\
else\
echo "*** internal representation of sprut itself is bad";\
echo " see \"$(srcdir)/ird.sprut\"";\
exit 1;\
fi
# Test semantically correct description (A-test).
A-test:
@echo
@echo A_test is executed
@echo C interface: non-flat structures and work with node fields
@if ./sprut -all -debug $(srcdir)/A_test.sprut; then\
if $(CC) A_test.c -o a.out; then\
echo "+++ A_test is ok";\
rm -f A_test.c A_test.h a.out;\
else\
echo "*** A_test is failed";\
echo " see \"$(srcdir)/A_test.sprut\", \"A_test.c\"";\
exit 1;\
fi;\
else\
echo "*** A_test is failed -- see \"$(srcdir)/A_test.sprut\"";\
exit 1;\
fi
@echo C interface: flat structures and non-flat work with node fields
@if ./sprut -all -debug -flat-structure $(srcdir)/A_test.sprut; then\
if $(CC) A_test.c -o a.out; then\
echo "+++ A_test is ok";\
rm -f A_test.c A_test.h a.out;\
else\
echo "*** A_test is failed";\
echo " see \"$(srcdir)/A_test.sprut\", \"A_test.c\"";\
exit 1;\
fi;\
else\
echo "*** A_test is failed -- see \"$(srcdir)/A_test.sprut\"";\
exit 1;\
fi
@echo C interface: non-flat structures and flat work with node fields
@if ./sprut -all -debug -flat $(srcdir)/A_test.sprut; then\
if $(CC) A_test.c -o a.out; then\
echo "+++ A_test is ok";\
rm -f A_test.c A_test.h a.out;\
else\
echo "*** A_test is failed";\
echo " see \"$(srcdir)/A_test.sprut\", \"A_test.c\"";\
exit 1;\
fi;\
else\
echo "*** A_test is failed -- see \"$(srcdir)/A_test.sprut\"";\
exit 1;\
fi
@echo C interface: flat structures and work with node fields
@if ./sprut -all -debug -flat -flat-structure $(srcdir)/A_test.sprut; then\
if $(CC) A_test.c -o a.out; then\
echo "+++ A_test is ok";\
rm -f A_test.c A_test.h a.out;\
else\
echo "*** A_test is failed";\
echo " see \"$(srcdir)/A_test.sprut\", \"A_test.c\"";\
exit 1;\
fi;\
else\
echo "*** A_test is failed -- see \"$(srcdir)/A_test.sprut\"";\
exit 1;\
fi
@echo C interface: Access and modification macros and functions
@if ./sprut -all -debug -macro $(srcdir)/A_test.sprut; then\
if $(CC) A_test.c -o a.out; then\
echo "+++ A_test is ok";\
rm -f A_test.c A_test.h a.out;\
else\
echo "*** A_test is failed";\
echo " see \"$(srcdir)/A_test.sprut\", \"A_test.c\"";\
exit 1;\
fi;\
else\
echo "*** A_test is failed -- see \"$(srcdir)/A_test.sprut\"";\
exit 1;\
fi
@echo C interface: Only access and modification macros
@if ./sprut -all -debug -only-macro $(srcdir)/A_test.sprut; then\
if $(CC) A_test.c -o a.out; then\
echo "+++ A_test is ok";\
rm -f A_test.c A_test.h a.out;\
else\
echo "*** A_test is failed";\
echo " see \"$(srcdir)/A_test.sprut\", \"A_test.c\"";\
exit 1;\
fi;\
else\
echo "*** A_test is failed -- see \"$(srcdir)/A_test.sprut\"";\
exit 1;\
fi
@echo C interface: Only access and modification functions
@if ./sprut -all -debug $(srcdir)/A_test.sprut; then\
if $(CC) A_test.c -o a.out; then\
echo "+++ A_test is ok";\
rm -f A_test.c A_test.h a.out;\
else\
echo "*** A_test is failed";\
echo " see \"$(srcdir)/A_test.sprut\", \"A_test.c\"";\
exit 1;\
fi;\
else\
echo "*** A_test is failed -- see \"$(srcdir)/A_test.sprut\"";\
exit 1;\
fi
@echo
@echo C++ interface: non-flat structures and work with node fields
@if ./sprut -c++ -all -debug $(srcdir)/A_test.sprut; then\
if $(CXX) A_test.cpp -o a.out; then\
echo "+++ A_test is ok";\
rm -f A_test.cpp A_test.h a.out;\
else\
echo "*** A_test is failed";\
echo " see \"$(srcdir)/A_test.sprut\", \"A_test.cpp\"";\
exit 1;\
fi;\
else\
echo "*** A_test is failed -- see \"$(srcdir)/A_test.sprut\"";\
exit 1;\
fi
@echo C++ interface: flat structures and non-flat work with node fields
@if ./sprut -c++ -all -debug -flat-structure $(srcdir)/A_test.sprut; then\
if $(CXX) A_test.cpp -o a.out; then\
echo "+++ A_test is ok";\
rm -f A_test.cpp A_test.h a.out;\
else\
echo "*** A_test is failed";\
echo " see \"$(srcdir)/A_test.sprut\", \"A_test.cpp\"";\
exit 1;\
fi;\
else\
echo "*** A_test is failed -- see \"$(srcdir)/A_test.sprut\"";\
exit 1;\
fi
@echo C++ interface: non-flat structures and flat work with node fields
@if ./sprut -c++ -all -debug -flat $(srcdir)/A_test.sprut; then\
if $(CXX) A_test.cpp -o a.out; then\
echo "+++ A_test is ok";\
rm -f A_test.cpp A_test.h a.out;\
else\
echo "*** A_test is failed";\
echo " see \"$(srcdir)/A_test.sprut\", \"A_test.cpp\"";\
exit 1;\
fi;\
else\
echo "*** A_test is failed -- see \"$(srcdir)/A_test.sprut\"";\
exit 1;\
fi
@echo C++ interface: flat structures and work with node fields
@if ./sprut -c++ -all -debug -flat -flat-structure $(srcdir)/A_test.sprut; then\
if $(CXX) A_test.cpp -o a.out; then\
echo "+++ A_test is ok";\
rm -f A_test.cpp A_test.h a.out;\
else\
echo "*** A_test is failed";\
echo " see \"$(srcdir)/A_test.sprut\", \"A_test.cpp\"";\
exit 1;\
fi;\
else\
echo "*** A_test is failed -- see \"$(srcdir)/A_test.sprut\"";\
exit 1;\
fi
@echo C++ interface: Access and modification macros and functions
@if ./sprut -c++ -all -debug -macro $(srcdir)/A_test.sprut; then\
if $(CXX) A_test.cpp -o a.out; then\
echo "+++ A_test is ok";\
rm -f A_test.cpp A_test.h a.out;\
else\
echo "*** A_test is failed";\
echo " see \"$(srcdir)/A_test.sprut\", \"A_test.cpp\"";\
exit 1;\
fi;\
else\
echo "*** A_test is failed -- see \"$(srcdir)/A_test.sprut\"";\
exit 1;\
fi
@echo C++ interface: Only access and modification macros
@if ./sprut -c++ -all -debug -only-macro $(srcdir)/A_test.sprut; then\
if $(CXX) A_test.cpp -o a.out; then\
echo "+++ A_test is ok";\
rm -f A_test.cpp A_test.h a.out;\
else\
echo "*** A_test is failed";\
echo " see \"$(srcdir)/A_test.sprut\", \"A_test.cpp\"";\
exit 1;\
fi;\
else\
echo "*** A_test is failed -- see \"$(srcdir)/A_test.sprut\"";\
exit 1;\
fi
@echo C++ interface: Only access and modification functions
@if ./sprut -c++ -all -debug $(srcdir)/A_test.sprut; then\
if $(CXX) A_test.cpp -o a.out; then\
echo "+++ A_test is ok";\
rm -f A_test.cpp A_test.h a.out;\
else\
echo "*** A_test is failed";\
echo " see \"$(srcdir)/A_test.sprut\", \"A_test.cpp\"";\
exit 1;\
fi;\
else\
echo "*** A_test is failed -- see \"$(srcdir)/A_test.sprut\"";\
exit 1;\
fi
# The same as A_test but without %double
A1_base.sprut: $(srcdir)/A_base.sprut
$(SED) "s/%double//g" $(srcdir)/A_base.sprut | $(SED) "s/A_/A1_/g" >$@
A1_syntax.sprut: $(srcdir)/A_syntax.sprut
$(SED) "s/%double//g" $(srcdir)/A_syntax.sprut | $(SED) "s/A_/A1_/g" >$@
A1_value.sprut: $(srcdir)/A_value.sprut
$(SED) "s/%double//g" $(srcdir)/A_value.sprut | $(SED) "s/A_/A1_/g" >$@
A1_test.sprut: $(srcdir)/A_test.sprut
$(SED) "s/^%double.*$$//g" $(srcdir)/A_test.sprut | $(SED) "s/A_/A1_/g" >$@
# Test semantically correct description without double (A1-test).
A1-test: A1_base.sprut A1_syntax.sprut A1_value.sprut A1_test.sprut
@echo
@echo A1_test is executed
@echo C interface: non-flat structures and work with node fields
@if ./sprut -all -debug A1_test.sprut; then\
if $(CC) A1_test.c -o a.out; then\
echo "+++ A1_test is ok";\
rm -f A1_test.c A1_test.h a.out;\
else\
echo "*** A1_test is failed";\
echo " see \"A1_test.sprut\", \"A1_test.c\"";\
exit 1;\
fi;\
else\
echo "*** A1_test is failed -- see \"A1_test.sprut\"";\
exit 1;\
fi
@echo C interface: flat structures and non-flat work with node fields
@if ./sprut -all -debug -flat-structure A1_test.sprut; then\
if $(CC) A1_test.c -o a.out; then\
echo "+++ A1_test is ok";\
rm -f A1_test.c A1_test.h a.out;\
else\
echo "*** A1_test is failed";\
echo " see \"A1_test.sprut\", \"A1_test.c\"";\
exit 1;\
fi;\
else\
echo "*** A1_test is failed -- see \"A1_test.sprut\"";\
exit 1;\
fi
@echo C interface: non-flat structures and flat work with node fields
@if ./sprut -all -debug -flat A1_test.sprut; then\
if $(CC) A1_test.c -o a.out; then\
echo "+++ A1_test is ok";\
rm -f A1_test.c A1_test.h a.out;\
else\
echo "*** A1_test is failed";\
echo " see \"A1_test.sprut\", \"A1_test.c\"";\
exit 1;\
fi;\
else\
echo "*** A1_test is failed -- see \"A1_test.sprut\"";\
exit 1;\
fi
@echo C interface: flat structures and work with node fields
@if ./sprut -all -debug -flat -flat-structure A1_test.sprut; then\
if $(CC) A1_test.c -o a.out; then\
echo "+++ A1_test is ok";\
rm -f A1_test.c A1_test.h a.out;\
else\
echo "*** A1_test is failed";\
echo " see \"A1_test.sprut\", \"A1_test.c\"";\
exit 1;\
fi;\
else\
echo "*** A1_test is failed -- see \"A1_test.sprut\"";\
exit 1;\
fi
@echo C interface: Access and modification macros and functions
@if ./sprut -all -debug -macro A1_test.sprut; then\
if $(CC) A1_test.c -o a.out; then\
echo "+++ A1_test is ok";\
rm -f A1_test.c A1_test.h a.out;\
else\
echo "*** A1_test is failed";\
echo " see \"A1_test.sprut\", \"A1_test.c\"";\
exit 1;\
fi;\
else\
echo "*** A1_test is failed -- see \"A1_test.sprut\"";\
exit 1;\
fi
@echo C interface: Only access and modification macros
@if ./sprut -all -debug -only-macro A1_test.sprut; then\
if $(CC) A1_test.c -o a.out; then\
echo "+++ A1_test is ok";\
rm -f A1_test.c A1_test.h a.out;\
else\
echo "*** A1_test is failed";\
echo " see \"A1_test.sprut\", \"A1_test.c\"";\
exit 1;\
fi;\
else\
echo "*** A1_test is failed -- see \"A1_test.sprut\"";\
exit 1;\
fi
@echo C interface: Only access and modification functions
@if ./sprut -all -debug A1_test.sprut; then\
if $(CC) A1_test.c -o a.out; then\
echo "+++ A1_test is ok";\
rm -f A1_test.c A1_test.h a.out;\
else\
echo "*** A1_test is failed";\
echo " see \"A1_test.sprut\", \"A1_test.c\"";\
exit 1;\
fi;\
else\
echo "*** A1_test is failed -- see \"A1_test.sprut\"";\
exit 1;\
fi
@echo
@echo C++ interface: non-flat structures and work with node fields
@if ./sprut -c++ -all -debug A1_test.sprut; then\
if $(CXX) A1_test.cpp -o a.out; then\
echo "+++ A1_test is ok";\
rm -f A1_test.cpp A1_test.h a.out;\
else\
echo "*** A1_test is failed";\
echo " see \"A1_test.sprut\", \"A1_test.cpp\"";\
exit 1;\
fi;\
else\
echo "*** A1_test is failed -- see \"A1_test.sprut\"";\
exit 1;\
fi
@echo C++ interface: flat structures and non-flat work with node fields
@if ./sprut -c++ -all -debug -flat-structure A1_test.sprut; then\
if $(CXX) A1_test.cpp -o a.out; then\
echo "+++ A1_test is ok";\
rm -f A1_test.cpp A1_test.h a.out;\
else\
echo "*** A1_test is failed";\
echo " see \"A1_test.sprut\", \"A1_test.cpp\"";\
exit 1;\
fi;\
else\
echo "*** A1_test is failed -- see \"A1_test.sprut\"";\
exit 1;\
fi
@echo C++ interface: non-flat structures and flat work with node fields
@if ./sprut -c++ -all -debug -flat A1_test.sprut; then\
if $(CXX) A1_test.cpp -o a.out; then\
echo "+++ A1_test is ok";\
rm -f A1_test.cpp A1_test.h a.out;\
else\
echo "*** A1_test is failed";\
echo " see \"A1_test.sprut\", \"A1_test.cpp\"";\
exit 1;\
fi;\
else\
echo "*** A1_test is failed -- see \"A1_test.sprut\"";\
exit 1;\
fi
@echo C++ interface: flat structures and work with node fields
@if ./sprut -c++ -all -debug -flat -flat-structure A1_test.sprut; then\
if $(CXX) A1_test.cpp -o a.out; then\
echo "+++ A1_test is ok";\
rm -f A1_test.cpp A1_test.h a.out;\
else\
echo "*** A1_test is failed";\
echo " see \"A1_test.sprut\", \"A1_test.cpp\"";\
exit 1;\
fi;\
else\
echo "*** A1_test is failed -- see \"A1_test.sprut\"";\
exit 1;\
fi
@echo C++ interface: Access and modification macros and functions
@if ./sprut -c++ -all -debug -macro A1_test.sprut; then\
if $(CXX) A1_test.cpp -o a.out; then\
echo "+++ A1_test is ok";\
rm -f A1_test.cpp A1_test.h a.out;\
else\
echo "*** A1_test is failed";\
echo " see \"A1_test.sprut\", \"A1_test.cpp\"";\
exit 1;\
fi;\
else\
echo "*** A1_test is failed -- see \"A1_test.sprut\"";\
exit 1;\
fi
@echo C++ interface: Only access and modification macros
@if ./sprut -c++ -all -debug -only-macro A1_test.sprut; then\
if $(CXX) A1_test.cpp -o a.out; then\
echo "+++ A1_test is ok";\
rm -f A1_test.cpp A1_test.h a.out;\
else\
echo "*** A1_test is failed";\
echo " see \"A1_test.sprut\", \"A1_test.cpp\"";\
exit 1;\
fi;\
else\
echo "*** A1_test is failed -- see \"A1_test.sprut\"";\
exit 1;\
fi
@echo C++ interface: Only access and modification functions
@if ./sprut -c++ -all -debug A1_test.sprut; then\
if $(CXX) A1_test.cpp -o a.out; then\
echo "+++ A1_test is ok";\
rm -f A1_test.cpp A1_test.h a.out;\
else\
echo "*** A1_test is failed";\
echo " see \"A1_test.sprut\", \"A1_test.cpp\"";\
exit 1;\
fi;\
else\
echo "*** A1_test is failed -- see \"A1_test.sprut\"";\
exit 1;\
fi
@rm -r A1_base.sprut A1_syntax.sprut A1_value.sprut A1_test.sprut
# Test only semantically incorrect descriptions (B-tests).
B-tests:
@echo
@echo B_tests are executed
$(SHELL) $(srcdir)/sprut.tst
# Make `sprut' by `ird.sprut'.
sprut-boot: sprut
@echo
./sprut -macro -debug -access -set -copy $(srcdir)/ird.sprut
@echo Make \"sprut\" on the base of \"$(srcdir)/ird.sprut\"
make sprut
# Creation of documentation
doc :
nroff -man $(srcdir)/sprut.1 | $(AWK) '{gsub (/.\b/,"");gsub (/.\200\230/,"\140");gsub (/.\200\231/,"\047");gsub (/\033\[[140]m/,"");gsub (/\033\[2[24]m/,"");print;}' > sprut.tmp
$(AWK) '{if($$0 == "%%%")\
{while ((getline line < "sprut.tmp") > 0)\
print line;close("sprut.tmp")}\
else print;}' $(srcdir)/sprut.sgml.in > sprut.sgml
rm -f sprut.tmp
linuxdoc -B txt --papersize=letter -f sprut.sgml
mv sprut.txt $(srcdir)
linuxdoc -B html --papersize=letter sprut.sgml
if test -f sprut-1.html;then\
for i in sprut-*.html;do\
mv $$i $(srcdir)/$$i;\
done;\
fi
mv sprut.html $(srcdir)/sprut.html
linuxdoc -B info --papersize=letter sprut.sgml
if test -f sprut.info;then\
for i in sprut.info*;do\
mv $$i $(srcdir)/$$i;\
done;\
fi
linuxdoc -B latex --papersize=letter sprut.sgml
if test ! -f sprut.dvi\
-o -f sprut.tex -a sprut.tex -nt sprut.dvi; then\
latex sprut.tex; latex sprut.tex;\
fi
mv sprut.dvi $(srcdir)/sprut.dvi
dvips -o $(srcdir)/sprut.ps $(srcdir)/sprut.dvi
ps2pdf $(srcdir)/sprut.ps $(srcdir)/sprut.pdf