From ae8c2499d66b3a2086fd85ff9a5901d752612863 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 26 Apr 2018 06:26:15 -0700 Subject: 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. --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) 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) -- cgit v1.2.3