1 ###############################################################################
3 # Makefile for compiling Prop 2.3.x
5 ###############################################################################
7 include ..
/Makefile.config
10 PROP_OPTS_BASIC
= -strict
$(CC_INCLUDE
) -save_space
-report
-v2
11 PROP_OPTS
= $(PROP_OPTS_BASIC
) -O14
13 CC_INCLUDE
= -I..
/include
14 #COPTS = -O6 -pedantic
16 CFLAGS
= $(CC_INCLUDE
) $(CPP_OPTS
)
17 LINKFLAGS
= -L..
/lib
-lprop
$(LDOPTS
) -lm
18 #LINKFLAGS = /LIBPATH:../lib-src libprop.lib
20 OUTPUT
:= prop
$(DOTEXE
)
23 # These are the prop include files
26 ir.ph ast.ph basics.ph parsegen.ph keywords.ph parser.ph \
27 collection.ph setl-ast.ph setlgen.ph matchcom.ph \
28 trs.ph timespace.ph env.ph funmap.ph metasyntax.ph \
29 pat.ph list.ph grsgen.ph graphtype.ph graphedges.ph \
30 aggen.ph datatype.ph listimpl.ph rwmix.ph
31 # dataflow.ph bitfield.ph wam.ph constraint.ph logicgen.ph
34 # These are the prop source files
37 persistgen.pcc gcgen.pcc printgen.pcc \
38 matchcom.pcc matchgen.pcc infgen.pcc type.pcc \
39 printing.pcc datagen.pcc codegen.pcc compiler.pcc indexing.pcc \
40 ast.pcc constr.pcc parsegen.pcc lexeme.pcc lexer.pcc \
41 trs.pcc trs2.pcc trs3.pcc \
42 rwgen.pcc rwgen2.pcc rwgen3.pcc rwgen4.pcc rwgen5.pcc \
43 lawgen.pcc parser-util.pcc parser.pcc setl-ast.pcc \
44 documentation.pcc collection.pcc setlgen.pcc setltype.pcc \
45 timespace.pcc env.pcc funmap.pcc metasyntax.pcc \
46 pat.pcc grsgen.pcc selector.pcc \
47 graphtype.pcc graphrep.pcc graphops.pcc graphreport.pcc \
48 classdef.pcc prop-main.pcc \
49 aggen.pcc datatype.pcc instance.pcc list.pcc \
50 visualize.pcc visual2.pcc rwmix.pcc
51 # dataflow.pcc bitfield.pcc constraint.pcc logicgen.pcc wam.pcc
54 # These are the normal .h files (not generated by prop)
56 NORMAL_H_SRC
= author.h automake.h classdef.h codegen.h compiler.h \
57 config.h datagen.h functortab.h hashtab.h infgen.h labelgen.h \
58 options.h rwgen.h textbuf.h type.h visualize.h
60 # These are the normal .cc files (not generated by prop)
62 NORMAL_C_SRC
= automake.
cc frontend.
cc functortab.
cc \
63 hashtab.
cc labelgen.
cc options.
cc \
64 patchlev.
cc patenv.
cc process.
cc textbuf.
cc
67 # .h files generated by prop
69 GEN_H_SRC
=$(PROP_H_SRC
:.ph
=.h
)
72 # .cc files generated by prop
74 GEN_C_SRC
=$(PROP_C_SRC
:.pcc
=.
cc)
77 # all files generated by prop
79 GEN_SRC
= $(GEN_H_SRC
) $(GEN_C_SRC
)
84 H_SRC
= $(GEN_H_SRC
) $(NORMAL_H_SRC
)
89 C_SRC
= $(GEN_C_SRC
) $(NORMAL_C_SRC
)
94 SRC
= $(H_SRC
) $(C_SRC
)
99 OBJS
= $(patsubst %.
cc,%.
$(OBJ
),$(C_SRC
))
105 $(call MKEXE
,$@
,$(OBJS
) $(LINKFLAGS
))
109 # Regenerate source only
113 debug
: $(SRC
) $(OBJS
)
114 $(CC
) $(OBJS
) -g
-o
$(OUTPUT
) $(LINKFLAGS
)
116 profile
: $(SRC
) $(OBJS
)
117 $(CC
) $(OBJS
) -pg
-g
-o
$(OUTPUT
) $(LINKFLAGS
)
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 object files and prop binary
137 # Remove all object files and generated code
148 @awk
'BEGIN { printf "Number of classes = "; }' </dev
/null
149 @grep
"^class " *.h | grep
-v
";" | wc
-l
159 wc
[a-z
]*.pcc
[a-z
]*.ph
164 # Generate dependencies
167 @echo Remaking prop dependency
168 $(PROP
) -M
$(PROP_OPTS
) $(PROP_C_SRC
) $(PROP_H_SRC
) >depends1 ||
rm -f depends1
169 @echo Remaking g
++ dependency
170 $(CC
) -MM
$(CFLAGS
) $(C_SRC
) >depends2 ||
rm -f depends2
176 $(PROP
) $(PROP_OPTS_BASIC
) $<
178 $(PROP
) $(PROP_OPTS
) $<
180 $(PROP
) $(PROP_OPTS
) $<
182 $(call MKOBJ
,$@
,$(CFLAGS
) $<)
185 $(CC
) $@.
cc -o
$@
-O6
$(CFLAGS
) $(LINKFLAGS
)