From c3561f9d56e45835c63d47acfaba89a0eb51437b Mon Sep 17 00:00:00 2001 From: Nexoniarz Date: Fri, 23 Oct 2026 23:21:43 +0200 Subject: [PATCH] make: a clean build no longer stops at lwIP From a clean tree the first make failed with "no rule to make target build/lwip/core/init.o": a pattern rule is only used when its prerequisite exists or can be made, and before the unpack lwIP's .c files were neither. A second make worked, which is why it went unseen. The unpack now claims the .c files. And sysroot-install waits for it, because its own make -C ports unpacked lwIP too, and two unzips under -j collided. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01S1giNvrHTrPMPw7V6x1kQ4 --- Makefile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 36f3828..b507b08 100644 --- a/Makefile +++ b/Makefile @@ -965,6 +965,17 @@ $(BUILD)/lwip/%.o: $(LWIPDIR)/%.c | $(LWIPDIR) $(LWIPDIR): $(MAKE) -C ports lwip +# And say that unpacking is what makes lwIP's .c files. Without this, a clean +# build fails at once with "no rule to make build/lwip/core/init.o": make +# picks a pattern rule only if every prerequisite exists or can be made, and +# before the unpack init.c is neither -- the order-only $(LWIPDIR) above +# would have created it, but make never gets that far. A second `make` +# worked, because by then the first had unpacked it. PRECIOUS because make +# deletes what it thinks it made along a chain of pattern rules. +$(LWIPDIR)/%.c: | $(LWIPDIR) + @test -f $@ +.PRECIOUS: $(LWIPDIR)/%.c + # uACPI's headers for its own files and for kernel/acpi/, and the same # configuration for both: a define seen by one side and not the other changes # the size of structures they pass between them. Builtin string functions, @@ -1308,7 +1319,9 @@ etc-install: $(SCHINIT_JOBS) $(ETC_PLAIN) $(ETC_ZSH) $(LOGO_ASCII) $(SRV_FILES) # not mounted over and the marker file would be visible in them. SYSROOT_DIRS = dev proc sys run tmp root -sysroot-install: $(addprefix $(SYSROOT)/bin/, $(CMDS)) etc-install +# After lwIP is unpacked: `make -C ports` below unpacks it too, and the two +# unzips running at once under -j trip over each other. +sysroot-install: $(addprefix $(SYSROOT)/bin/, $(CMDS)) etc-install | $(LWIPDIR) @mkdir -p $(addprefix $(SYSROOT)/, $(SYSROOT_DIRS)) ifdef WINHOST @echo "ports: skipped (Windows host) -- musl/mksh/toybox are used as already staged in $(SYSROOT)"