From d440ed819cd3bb06d1e34b841c1ede6dcd87842e Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Fri, 6 Dec 2024 23:52:32 +0200 Subject: [PATCH] lib/Makefile: fix out-of-tree build of lib/bt-exe.c Commit a522213 ("tccpe.c: never assume static...") removed the global -I$(TOP) for cleaner lib build, and ensured that it is added for bcheck.c as it now includes config.h, but forgot that bt-exe.c also needs config.h, as it includes ../tccrun.c which includes it. Also, the explicit tccrun.c prerequisite for bt-exe.c is not required, as all *.o lib files depend on $(TCC), which depends on libtcc, which depends on tccrun.c . Also, at win32/built-tcc.bat, while bcheck.c needs -I.. for config.h, bt-exe.c doesn't, as ../tccrun.c does find it where it expects it. --- lib/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Makefile b/lib/Makefile index 3eef8c46..6524d829 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -92,7 +92,8 @@ $(TOP)/%.o : %.c $(TCC) $S$(XCC) -c $< -o $@ $(XFLAGS) $(TOP)/bcheck.o : XFLAGS += $(BFLAGS) -I$(TOP) -$(TOP)/bt-exe.o : $(TOP)/tccrun.c +# includes tccrun.c, $(TOP) for config.h (tccrun.c prerequisite via $(TCC)) +$(TOP)/bt-exe.o : XFLAGS += -I$(TOP) $(X)crt1w.o : crt1.c $(X)wincrt1w.o : wincrt1.c