use typename
[prop.git] / prop-src / Makefile
blob523bb1c47528661fd28aa1ff4a69d731fdc2586b
1 ###############################################################################
3 # Makefile for compiling Prop 2.3.x
5 ###############################################################################
6 PROP = ../bin/prop
7 CC = g++
8 CC_INCLUDE = -I../include
9 COPTS = -O6 -pedantic
10 LDOPTS = -lg++
11 CFLAGS = $(CC_INCLUDE) $(COPTS)
12 LDFLAGS = -L../lib -lprop $(LDOPTS) -lm
13 PROP_OPTS_BASIC = -strict $(CC_INCLUDE) -save_space -report -v2
14 PROP_OPTS = $(PROP_OPTS_BASIC) -O14
17 # These are the prop include files
19 PROP_H_SRC= \
20 ir.ph ast.ph basics.ph parsegen.ph keywords.ph parser.ph \
21 collection.ph setl-ast.ph setlgen.ph matchcom.ph \
22 trs.ph timespace.ph env.ph funmap.ph metasyntax.ph \
23 pat.ph list.ph grsgen.ph graphtype.ph graphedges.ph \
24 aggen.ph datatype.ph listimpl.ph rwmix.ph
25 # dataflow.ph bitfield.ph wam.ph constraint.ph logicgen.ph
28 # These are the prop source files
30 PROP_C_SRC= \
31 persistgen.pcc gcgen.pcc printgen.pcc \
32 matchcom.pcc matchgen.pcc infgen.pcc type.pcc \
33 printing.pcc datagen.pcc codegen.pcc compiler.pcc indexing.pcc \
34 ast.pcc constr.pcc parsegen.pcc lexeme.pcc lexer.pcc \
35 trs.pcc trs2.pcc trs3.pcc \
36 rwgen.pcc rwgen2.pcc rwgen3.pcc rwgen4.pcc rwgen5.pcc \
37 lawgen.pcc parser-util.pcc parser.pcc setl-ast.pcc \
38 documentation.pcc collection.pcc setlgen.pcc setltype.pcc \
39 timespace.pcc env.pcc funmap.pcc metasyntax.pcc \
40 pat.pcc grsgen.pcc selector.pcc \
41 graphtype.pcc graphrep.pcc graphops.pcc graphreport.pcc \
42 classdef.pcc prop-main.pcc \
43 aggen.pcc datatype.pcc instance.pcc list.pcc \
44 visualize.pcc visual2.pcc rwmix.pcc
45 # dataflow.pcc bitfield.pcc constraint.pcc logicgen.pcc wam.pcc
48 # These are the normal .h files (not generated by prop)
50 NORMAL_H_SRC= author.h automake.h classdef.h codegen.h compiler.h \
51 config.h datagen.h functortab.h hashtab.h infgen.h labelgen.h \
52 options.h rwgen.h textbuf.h type.h visualize.h
54 # These are the normal .cc files (not generated by prop)
56 NORMAL_C_SRC= automake.cc frontend.cc functortab.cc \
57 hashtab.cc labelgen.cc options.cc \
58 patchlev.cc patenv.cc process.cc textbuf.cc
61 # .h files generated by prop
63 GEN_H_SRC=$(PROP_H_SRC:.ph=.h)
66 # .cc files generated by prop
68 GEN_C_SRC=$(PROP_C_SRC:.pcc=.cc)
71 # all files generated by prop
73 GEN_SRC= $(GEN_H_SRC) $(GEN_C_SRC)
76 # all .h files
78 H_SRC= $(GEN_H_SRC) $(NORMAL_H_SRC)
81 # all .cc files
83 C_SRC= $(GEN_C_SRC) $(NORMAL_C_SRC)
86 # all files
88 SRC= $(H_SRC) $(C_SRC)
91 # all object files
93 OBJ = $(C_SRC:.cc=.o)
96 # How to build prop
98 prop: $(SRC) $(OBJ)
99 $(CC) $(OBJ) -g -o $@ $(LDFLAGS)
100 # strip $@
103 # Relink prop
105 build-prop:
106 $(CC) $(OBJ) -o prop $(LDFLAGS)
107 strip $@
109 # Regenerate source only
111 src: $(SRC)
113 debug: $(SRC) $(OBJ)
114 $(CC) $(OBJ) -g -o prop $(LDFLAGS)
116 profile: $(SRC) $(OBJ)
117 $(CC) $(OBJ) -pg -g -o prop $(LDFLAGS)
119 tar:
120 tar -cvf - [a-z]*.h [a-z]*.cc [a-z]*.[ply]* *.tex \
121 banner testprop testprop2 Makefile README \
122 | gzip >prop-2.1.tar.gz
125 # Remove object files only
127 clean:
128 rm -f *.o
131 # Remove all object files and generated code
133 spotless: clean
134 rm -f $(GEN_SRC)
136 depends1:
137 touch depends1
138 depends2:
139 touch depends2
141 classes:
142 @awk 'BEGIN { printf "Number of classes = "; }' </dev/null
143 @grep "^class " *.h | grep -v ";" | wc -l
145 test: test1
147 test1:
148 ./testprop
149 test2:
150 ./testprop2
153 wc [a-z]*.pcc [a-z]*.ph
154 genwc:
155 wc $(GEN_SRC)
158 # Generate dependencies
160 depends:
161 @echo Remaking prop dependency
162 $(PROP) -M $(PROP_OPTS) $(PROP_C_SRC) $(PROP_H_SRC) >depends1 || rm -f depends1
163 @echo Remaking g++ dependency
164 $(CC) -MM $(CFLAGS) $(C_SRC) >depends2 || rm -f depends2
166 include depends1
167 include depends2
169 T%.cc: T%.pcc
170 $(PROP) $(PROP_OPTS_BASIC) $<
171 %.h: %.ph
172 $(PROP) $(PROP_OPTS) $<
173 %.cc: %.pcc
174 $(PROP) $(PROP_OPTS) $<
175 %.o: %.cc
176 $(CC) -c $(CFLAGS) $<
178 T%: T%.cc
179 $(CC) $@.cc -o $@ -O6 $(CFLAGS) $(LDFLAGS)