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
17 CFLAGS
= $(CC_INCLUDE
) $(COPTS
)
18 #LINKFLAGS = -L../lib -lprop $(LDOPTS) -lm
19 LINKFLAGS
= /LIBPATH
:..
/lib-src libprop.lib
21 OUTPUT
:= prop
$(DOTEXE
)
24 # These are the prop include files
27 ir.ph ast.ph basics.ph parsegen.ph keywords.ph parser.ph \
28 collection.ph setl-ast.ph setlgen.ph matchcom.ph \
29 trs.ph timespace.ph env.ph funmap.ph metasyntax.ph \
30 pat.ph list.ph grsgen.ph graphtype.ph graphedges.ph \
31 aggen.ph datatype.ph listimpl.ph rwmix.ph
32 # dataflow.ph bitfield.ph wam.ph constraint.ph logicgen.ph
35 # These are the prop source files
38 persistgen.pcc gcgen.pcc printgen.pcc \
39 matchcom.pcc matchgen.pcc infgen.pcc type.pcc \
40 printing.pcc datagen.pcc codegen.pcc compiler.pcc indexing.pcc \
41 ast.pcc constr.pcc parsegen.pcc lexeme.pcc lexer.pcc \
42 trs.pcc trs2.pcc trs3.pcc \
43 rwgen.pcc rwgen2.pcc rwgen3.pcc rwgen4.pcc rwgen5.pcc \
44 lawgen.pcc parser-util.pcc parser.pcc setl-ast.pcc \
45 documentation.pcc collection.pcc setlgen.pcc setltype.pcc \
46 timespace.pcc env.pcc funmap.pcc metasyntax.pcc \
47 pat.pcc grsgen.pcc selector.pcc \
48 graphtype.pcc graphrep.pcc graphops.pcc graphreport.pcc \
49 classdef.pcc prop-main.pcc \
50 aggen.pcc datatype.pcc instance.pcc list.pcc \
51 visualize.pcc visual2.pcc rwmix.pcc
52 # dataflow.pcc bitfield.pcc constraint.pcc logicgen.pcc wam.pcc
55 # These are the normal .h files (not generated by prop)
57 NORMAL_H_SRC
= author.h automake.h classdef.h codegen.h compiler.h \
58 config.h datagen.h functortab.h hashtab.h infgen.h labelgen.h \
59 options.h rwgen.h textbuf.h type.h visualize.h
61 # These are the normal .cc files (not generated by prop)
63 NORMAL_C_SRC
= automake.
cc frontend.
cc functortab.
cc \
64 hashtab.
cc labelgen.
cc options.
cc \
65 patchlev.
cc patenv.
cc process.
cc textbuf.
cc
68 # .h files generated by prop
70 GEN_H_SRC
=$(PROP_H_SRC
:.ph
=.h
)
73 # .cc files generated by prop
75 GEN_C_SRC
=$(PROP_C_SRC
:.pcc
=.
cc)
78 # all files generated by prop
80 GEN_SRC
= $(GEN_H_SRC
) $(GEN_C_SRC
)
85 H_SRC
= $(GEN_H_SRC
) $(NORMAL_H_SRC
)
90 C_SRC
= $(GEN_C_SRC
) $(NORMAL_C_SRC
)
95 SRC
= $(H_SRC
) $(C_SRC
)
100 OBJS
= $(patsubst %.
cc,%.
$(OBJ
),$(C_SRC
))
106 $(call MKEXE
,$@
,$(OBJS
) $(LINKFLAGS
))
110 # Regenerate source only
114 debug
: $(SRC
) $(OBJS
)
115 $(CC
) $(OBJS
) -g
-o
$(OUTPUT
) $(LINKFLAGS
)
117 profile
: $(SRC
) $(OBJS
)
118 $(CC
) $(OBJS
) -pg
-g
-o
$(OUTPUT
) $(LINKFLAGS
)
121 tar -cvf
- [a-z
]*.h
[a-z
]*.
cc [a-z
]*.
[ply
]* *.
tex \
122 banner testprop testprop2 Makefile README \
123 | gzip
>prop-2.1.
tar.gz
126 # Remove object files only
132 # Remove object files and prop binary
138 # Remove all object files and generated code
149 @awk
'BEGIN { printf "Number of classes = "; }' </dev
/null
150 @grep
"^class " *.h | grep
-v
";" | wc
-l
160 wc
[a-z
]*.pcc
[a-z
]*.ph
165 # Generate dependencies
168 @echo Remaking prop dependency
169 $(PROP
) -M
$(PROP_OPTS
) $(PROP_C_SRC
) $(PROP_H_SRC
) >depends1 ||
rm -f depends1
170 @echo Remaking g
++ dependency
171 $(CC
) -MM
$(CFLAGS
) $(C_SRC
) >depends2 ||
rm -f depends2
177 $(PROP
) $(PROP_OPTS_BASIC
) $<
179 $(PROP
) $(PROP_OPTS
) $<
181 $(PROP
) $(PROP_OPTS
) $<
183 $(call MKOBJ
,$@
,$(CFLAGS
) $<)
186 $(CC
) $@.
cc -o
$@
-O6
$(CFLAGS
) $(LINKFLAGS
)