summaryrefslogtreecommitdiff
path: root/colm/Makefile.am
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2019-10-15 17:49:25 -0300
committerAdrian Thurston <thurston@colm.net>2019-10-15 18:01:10 -0300
commit49ad3f194f4b188abc663c83b05ba7908b773afa (patch)
tree7ffea2eaabe9ba9bc8c368609b52ca5f7e07c41f /colm/Makefile.am
parentb017550ee702067d43c9b20a22ec75997e270d25 (diff)
downloadcolm-49ad3f194f4b188abc663c83b05ba7908b773afa.tar.gz
added --with-colm option for building colm parser with an external colm
By default the package will bootstrap, but when working on the parser it is possible to break building of colm itself. This is a major nuisance, so allow building with an external colm, skipping the bootstrap process.
Diffstat (limited to 'colm/Makefile.am')
-rw-r--r--colm/Makefile.am42
1 files changed, 28 insertions, 14 deletions
diff --git a/colm/Makefile.am b/colm/Makefile.am
index e1e758fd..cce19986 100644
--- a/colm/Makefile.am
+++ b/colm/Makefile.am
@@ -25,7 +25,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/aapl -Iinclude
AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS = colm
-noinst_PROGRAMS = bootstrap0 bootstrap1
RUNTIME_SRC = \
map.c pdarun.c list.c input.c stream.c debug.c \
@@ -38,7 +37,6 @@ RUNTIME_HDR = \
pdarun.h map.h type.h tree.h struct.h program.h colm.h internal.h
lib_LTLIBRARIES = libcolm.la
-
noinst_LIBRARIES = libprog.a
libcolm_la_SOURCES = $(RUNTIME_SRC)
@@ -69,18 +67,6 @@ libprog_a_SOURCES = \
libprog_a_CXXFLAGS = $(common_CFLAGS)
-bootstrap0_CXXFLAGS = $(common_CFLAGS) -DCONS_INIT
-bootstrap0_SOURCES = consinit.cc consinit.h main.cc
-bootstrap0_LDADD = libprog.a libcolm.la
-
-bootstrap1_CXXFLAGS = $(common_CFLAGS) -DLOAD_INIT
-bootstrap1_CFLAGS = $(common_CFLAGS)
-bootstrap1_SOURCES = \
- loadinit.h loadinit.cc main.cc
-nodist_bootstrap1_SOURCES = \
- gen/if1.h gen/if1.cc gen/parse1.c
-bootstrap1_LDADD = libprog.a libcolm.la
-
colm_CXXFLAGS = $(common_CFLAGS) -DLOAD_COLM
colm_CFLAGS = $(common_CFLAGS)
colm_SOURCES = \
@@ -93,6 +79,32 @@ colmincdir = $(includedir)/colm
colminc_HEADERS = $(RUNTIME_HDR)
+if EXTERNAL_COLM
+
+gen/parse2.c: $(EXTERNAL_COLM)/bin/colm prog.lm
+ mkdir -p gen
+ $(EXTERNAL_COLM)/bin/colm -c -o gen/parse2.c -e gen/if2.h -x gen/if2.cc prog.lm
+
+gen/if2.h: gen/parse2.c
+gen/if2.cc: gen/parse2.c
+
+gen/colm-if2.$(OBJEXT): gen/if2.h gen/if2.cc gen/parse2.c
+colm-loadcolm.$(OBJEXT): gen/if2.h gen/if2.cc gen/parse2.c
+
+else
+
+noinst_PROGRAMS = bootstrap0 bootstrap1
+
+bootstrap0_CXXFLAGS = $(common_CFLAGS) -DCONS_INIT
+bootstrap0_SOURCES = consinit.cc consinit.h main.cc
+bootstrap0_LDADD = libprog.a libcolm.la
+
+bootstrap1_CXXFLAGS = $(common_CFLAGS) -DLOAD_INIT
+bootstrap1_CFLAGS = $(common_CFLAGS)
+bootstrap1_SOURCES = loadinit.h loadinit.cc main.cc
+nodist_bootstrap1_SOURCES = gen/if1.h gen/if1.cc gen/parse1.c
+bootstrap1_LDADD = libprog.a libcolm.la
+
gen/parse1.c: bootstrap0$(EXEEXT)
mkdir -p gen
$(builddir)/bootstrap0 -c -o gen/parse1.c -e gen/if1.h -x gen/if1.cc
@@ -113,6 +125,8 @@ bootstrap1-loadinit.$(OBJEXT): gen/if1.h gen/if1.cc gen/parse1.c
gen/colm-if2.$(OBJEXT): gen/if2.h gen/if2.cc gen/parse2.c
colm-loadcolm.$(OBJEXT): gen/if2.h gen/if2.cc gen/parse2.c
+endif
+
BUILT_SOURCES = version.h include/colm
include/colm: