1 ###############################################################################
3 # Makefile for compiling Prop 2.3.x
5 ###############################################################################
8 CC_INCLUDE = -I../include
11 CFLAGS = $(CC_INCLUDE) $(COPTS)
12 LDFLAGS = -L../lib -lprop $(LDOPTS) $(gcc-iostream-lib) -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
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
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)
78 H_SRC= $(GEN_H_SRC) $(NORMAL_H_SRC)
83 C_SRC= $(GEN_C_SRC) $(NORMAL_C_SRC)
88 SRC= $(H_SRC) $(C_SRC)
99 $(CC) $(OBJ) -o $@ $(LDFLAGS)
106 $(CC) $(OBJ) -o prop $(LDFLAGS)
109 # Regenerate source only
114 $(CC) $(OBJ) -g -o prop $(LDFLAGS)
116 profile: $(SRC) $(OBJ)
117 $(CC) $(OBJ) -pg -g -o prop $(LDFLAGS)
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
131 # Remove all object files and generated code
142 @awk 'BEGIN { printf "Number of classes = "; }' </dev/null
143 @grep "^class " *.h | grep -v ";" | wc -l
153 wc [a-z]*.pcc [a-z]*.ph
158 # Generate dependencies
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
170 $(PROP) $(PROP_OPTS_BASIC) $<
172 $(PROP) $(PROP_OPTS) $<
174 $(PROP) $(PROP_OPTS) $<
176 $(CC) -c $(CFLAGS) -fexternal-templates $<
178 $(CC) -c $(CFLAGS) $<
181 $(CC) $@.cc -o $@ -O6 $(CFLAGS) $(LDFLAGS)