From 89e96734e0f155ba8258411df1dbf38e5c0ff809 Mon Sep 17 00:00:00 2001 From: Adrian Thurston Date: Sun, 15 Dec 2019 13:39:14 +0200 Subject: build system fixes 1. The version.h file needs to be listed in BUILT_SOURCES ahead of it's use in a sources list. 2. The gen/if[123].h files, even though they are listed in BUILT_SOURCES, are not getting built ahead of their use in include files. Solution here is to list dependency explicitly. See note in source file. refs #87 --- colm/Makefile.am | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/colm/Makefile.am b/colm/Makefile.am index fe594521..071dfb22 100644 --- a/colm/Makefile.am +++ b/colm/Makefile.am @@ -71,7 +71,7 @@ colmincdir = $(includedir)/colm colminc_HEADERS = $(RUNTIME_HDR) -BUILT_SOURCES = include/colm +BUILT_SOURCES = version.h include/colm if EXTERNAL_COLM @@ -115,14 +115,20 @@ gen/if1.h: tar/bootstrap1.tar gen/if1.cc: tar/bootstrap1.tar tar -C gen -xmf $< if1.cc +# Listing if1.h in BUILT_SOURCES isn't sufficient because it depends on the +# building of bootstrap0. Automake wants to put all built sources into a list +# of files built before ANYTHING else (which includes bootstrap0). Not sure if +# it is rejected by automake or make. But in any case, it doesn't work. Fixed +# with the following additional dependency. +BUILT_SOURCES += gen/parse1.c gen/if1.h gen/if1.cc +loadinit.cc: gen/if1.h + bootstrap1_CXXFLAGS = $(common_CFLAGS) -DLOAD_INIT bootstrap1_CFLAGS = $(common_CFLAGS) -bootstrap1_SOURCES = loadinit.h loadinit.cc main.cc +bootstrap1_SOURCES = loadinit.h loadinit.cc main.cc version.h nodist_bootstrap1_SOURCES = gen/if1.h gen/if1.cc gen/parse1.c bootstrap1_LDADD = libprog.a libcolm.la -BUILT_SOURCES += gen/parse1.c gen/if1.h gen/if1.cc - # # Bootstrap2: The input program is specified using the colm grammar used in # bootstrap1, plus some rewrite rules that implement the final parts of @@ -144,11 +150,13 @@ gen/if2.h: tar/bootstrap2.tar gen/if2.cc: tar/bootstrap2.tar tar -C gen -xmf $< if2.cc + BUILT_SOURCES += gen/parse2.c gen/if2.h gen/if2.cc +loadcolm.cc: gen/if2.h bootstrap2_CXXFLAGS = $(common_CFLAGS) -DLOAD_COLM bootstrap2_CFLAGS = $(common_CFLAGS) -bootstrap2_SOURCES = loadcolm.h loadcolm.cc main.cc +bootstrap2_SOURCES = loadcolm.h loadcolm.cc main.cc version.h nodist_bootstrap2_SOURCES = gen/if2.h gen/if2.cc gen/parse2.c bootstrap2_LDADD = libprog.a libcolm.la @@ -169,15 +177,14 @@ gen/if3.cc: tar/bootstrap3.tar tar -C gen -xmf $< if3.cc BUILT_SOURCES += gen/parse3.c gen/if3.h gen/if3.cc +#loadcolm.cc: gen/if3.h colm_CXXFLAGS = $(common_CFLAGS) -DLOAD_COLM colm_CFLAGS = $(common_CFLAGS) -colm_SOURCES = loadcolm.h loadcolm.cc main.cc +colm_SOURCES = loadcolm.h loadcolm.cc main.cc version.h nodist_colm_SOURCES = gen/if3.h gen/if3.cc gen/parse3.c colm_LDADD = libprog.a libcolm.la -BUILT_SOURCES += version.h include/colm - include/colm: mkdir -p include ln -s .. include/colm -- cgit v1.2.1