1 ##############################################################################
2 # Makefile for compiling the sample programs in this directory
3 # You *must* have prop and adlib already compiled.
4 ##############################################################################
7 # C++ compiler setup (assume gcc)
10 CINCLUDE= -I../include
13 CFLAGS = $(COPTS) $(CINCLUDE)
14 LDFLAGS = -L../lib -lprop $(LDOPTS)
18 # The executable. I assume you have set up the directory hierarchy
26 # -l generate no #line directives
27 # -f generate fast tables
28 # -r generate a long report listing
35 PROP_SRC= inference.pcc rewriting2.pcc rewriting3.pcc \
36 rewriting5.pcc rewriting6.pcc rewriting7.pcc \
37 logical_patterns.pcc \
38 regexp.pcc list1.pcc list2.pcc printer1.pcc \
40 persist1.pcc persist2.pcc persist3.pcc \
41 tuple.pcc insertion_sort.pcc merge_sort.pcc bubble_sort.pcc \
42 test_gc2.pcc test_gc3.pcc test_gc4.pcc \
44 test_gc9.pcc test_gc10.pcc test_gc11.pcc \
45 test_gc12.pcc test_gc18.pcc \
46 prop1.pcc prop2.pcc prop3.pcc prop4.pcc prop5.pcc prop6.pcc \
47 prop7.pcc prop8.pcc prop9.pcc
50 # Generated C++ source from prop
52 SRC = $(PROP_SRC:.pcc=.cc)
55 # Compiled demo programs
57 PROGS= inference logical_patterns \
58 qa1 qa2 qa3 qa5 qa6 qa7 qa8 \
59 rewriting2 rewriting3 rewriting5 rewriting6 rewriting7 \
60 regexp list1 list2 printer1 \
62 persist1 persist2 persist3 \
63 tuple insertion_sort merge_sort bubble_sort \
64 test_gc1 test_gc2 test_gc3 test_gc4 test_gc5 test_gc6 test_gc7 \
65 test_gc8 test_gc9 test_gc10 test_gc11 test_gc12 test_gc13 test_gc14 \
66 test_gc15 test_gc16 test_gc17 test_gc18 test_gc19 test_gc20 \
67 test_gc21 test_gc22 test_gc23 test_gc24 \
68 prop1 prop2 prop3 prop4 prop5 prop6 prop7 prop8 prop9
73 PROP_LOG= rewriting.report rewriting2.report rewriting3.report
80 build: $(SRC) $(PROGS)
83 $(RM) -f $(SRC) *.report
85 $(RM) -f $(PROP_LOG) $(PROGS)
90 for p in $(PROGS); do \
91 echo "[Running $$p]"; \
92 (echo "20" | ./$$p); \
93 if [ $$? != 0 ]; then \
95 echo "[$$p has failed.]"; \
96 echo "$$p has failed." >>TESTLOG; \
99 if [ $$FAILED = 1 ]; then \
100 echo "See TESTLOG for failed tests."; \
103 echo "All tests ran successfully."; \
106 prop4.cc: prop4.pcc $(PROP)
107 $(PROP) $(PROP_OPTS) -save_space -O15 $(@:.cc=.pcc)
109 $(PROP) $(PROP_OPTS) $(@:.cc=.pcc)
111 $(PROP) $(PROP_OPTS) $(@:.h=.ph)
112 prop3: prop3.cc ../lib/libprop.a
113 $(CC) $(CFLAGS) -fno-implicit-templates -o $@ $@.cc $(LDFLAGS)
115 prop4: prop4.cc ../lib/libprop.a
116 $(CC) $(CFLAGS) -fno-implicit-templates -o $@ $@.cc $(LDFLAGS)
118 %: %.cc ../lib/libprop.a
119 $(CC) $(CFLAGS) -o $@ $@.cc $(LDFLAGS)