summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-04-26 06:26:15 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-04-26 06:26:15 -0700
commit1cc9c700b06b243d8037791aab3bf0b7e2dfe687 (patch)
tree8349d67795c6d504f79e3d171c88a37cb7435d75
parentc23fd46d841d8d452c02ae4fc796042f2fb86424 (diff)
downloadtxr-1cc9c700b06b243d8037791aab3bf0b7e2dfe687.tar.gz
txr-1cc9c700b06b243d8037791aab3bf0b7e2dfe687.tar.bz2
txr-1cc9c700b06b243d8037791aab3bf0b7e2dfe687.zip
build: fix failure due to .tlo compilation order.
On newer GNU Make versions, $(wildcard ...) doesn't sort its results, and so we compile .tlo files in an arbitrary order. For the most part, this is fine. However, there is a complicated circular dependency involving the error.tl file requiring it to be compiled first. * Makefile (STLIB_EARLY_PATS, STDLIB_EARLY_TLOS, STDLIB_LATE_TLOS): New variables. Use these to express a dependency which causes error.tlo to be built first.
-rw-r--r--Makefile6
1 files changed, 6 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index b2815e9c..66298ddb 100644
--- a/Makefile
+++ b/Makefile
@@ -67,6 +67,10 @@ STDLIB_SRCS := $(wildcard share/txr/stdlib/*.tl)
STDLIB_TLOS := $(patsubst %.tl,%.tlo,$(STDLIB_SRCS))
STDLIB_TLOS2 := $(patsubst %.tl,%.tlo2,$(STDLIB_SRCS))
+STDLIB_EARLY_PATS := %/error.tlo # these must be compiled first
+STDLIB_EARLY_TLOS := $(filter $(STDLIB_EARLY_PATS),$(STDLIB_TLOS))
+STDLIB_LATE_TLOS := $(filter-out $(STDLIB_EARLY_TLOS),$(STDLIB_TLOS))
+
ifneq ($(have_git),)
SRCS := $(addprefix $(top_srcdir),\
$(filter-out lex.yy.c y.tab.c y.tab.h,\
@@ -219,6 +223,8 @@ endif
all: $(BUILD_TARGETS) stage1 stage2
+$(STDLIB_LATE_TLOS): $(STDLIB_EARLY_TLOS)
+
stage1: $(STDLIB_TLOS)
stage2: $(STDLIB_TLOS2)