blob: e007bcfe59f4c0a71845c0a786fc419c095a1715 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
#
# Copyright 2007-2012 Adrian Thurston <thurston@complang.org>
#
# This file is part of Colm.
#
# Colm is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Colm is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Colm; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
INCLUDES = -I$(top_srcdir)/aapl
bin_PROGRAMS = colm
noinst_PROGRAMS = bootstrap0 bootstrap1
RUNTIME_SRC = \
map.c pdarun.c list.c input.c debug.c \
codevect.c pool.c string.c tree.c bytecode.c program.c
RUNTIME_HDR = \
bytecode.h config.h defs.h debug.h pool.h input.h \
pdarun.h map.h tree.h program.h colm.h
lib_LIBRARIES = libcolm.a
noinst_LIBRARIES = libprog.a
libcolm_a_SOURCES = $(RUNTIME_SRC)
libcolm_a_CFLAGS = -I..
common_CFLAGS = \
-Wall \
-DPREFIX='"$(prefix)"' \
-I..
libprog_a_SOURCES = \
buffer.h bytecode.h colm.h debug.h dotgen.h fsmcodegen.h fsmgraph.h \
input.h keyops.h map.h parsedata.h \
parsetree.h pcheck.h pdacodegen.h pdagraph.h pdarun.h pool.h redbuild.h \
redfsm.h rtvector.h tree.h version.h global.h colm.h parser.h \
\
resolve.cc synthesis.cc parsetree.cc \
fsmstate.cc fsmbase.cc fsmattach.cc fsmmin.cc \
fsmgraph.cc pdagraph.cc pdabuild.cc pdacodegen.cc fsmcodegen.cc \
redfsm.cc fsmexec.cc redbuild.cc closure.cc fsmap.cc \
dotgen.cc pcheck.cc ctinput.cc declare.cc codegen.cc \
exports.cc compiler.cc parser.cc
libprog_a_CXXFLAGS = $(common_CFLAGS)
bootstrap0_CXXFLAGS = $(common_CFLAGS) -DBOOTSTRAP0
bootstrap0_SOURCES = bootstrap.cc bootstrap0.cc bootstrap0.h main.cc
bootstrap0_LDADD = libprog.a libcolm.a
bootstrap1_CXXFLAGS = $(common_CFLAGS) -DBOOTSTRAP1
bootstrap1_CFLAGS = $(common_CFLAGS) -DBOOTSTRAP1
bootstrap1_SOURCES = exports1.h exports1.cc parse1.c bootstrap.cc \
bootstrap1.cc bootstrap1.h main.cc
bootstrap1_LDADD = libprog.a libcolm.a
colm_CXXFLAGS = $(common_CFLAGS)
colm_CFLAGS = $(common_CFLAGS)
colm_SOURCES = lmparse.h lmscan.h lmparse.cc lmscan.cc \
bootstrap2.cc exports2.h exports2.cc parse2.c main.cc
colm_LDADD = libprog.a libcolm.a
colmincdir = $(includedir)/colm
colminc_HEADERS = $(RUNTIME_HDR)
parse1.c: bootstrap0
$(builddir)/bootstrap0 -L -o parse1.c -e exports1.h -c exports1.cc
exports1.h: parse1.c
exports1.cc: parse1.c
parse2.c: bootstrap1 colm.lm
$(builddir)/bootstrap1 -L -o parse2.c -e exports2.h -c exports2.cc < colm.lm
exports2.h: parse2.c
exports2.cc: parse2.c
bootstrap1-exports1.o: exports1.h exports1.cc parse1.c
bootstrap1-bootstrap1.o: exports1.h exports1.cc parse1.c
colm-exports2.o: exports2.h exports2.cc parse2.c
colm-bootstrap2.o: exports2.h exports2.cc parse2.c
BUILT_SOURCES = \
version.h lmscan.cc lmparse.h lmparse.cc
version.h: Makefile
echo '#define VERSION "$(PACKAGE_VERSION)"' > version.h
echo '#define PUBDATE "$(PUBDATE)"' >> version.h
if BUILD_PARSERS
lmparse.h: lmparse.kh
$(KELBT) -o $@ $<
lmparse.cc: lmparse.kl lmparse.kh
$(KELBT) -o $@ $<
lmscan.cc: lmparse.h
lmscan.cc: lmscan.rl
$(RAGEL) -G2 -o $@ $<
CLEANFILES = $(BUILT_SOURCES)
endif
|