From 9839778f3bd081740cc4967e95e113e852d3db79 Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Sat, 8 Aug 2026 04:08:13 +0900 Subject: [PATCH] make: derive precise tool prerequisites; scope tools to run targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per-binary source lists corrected against the real import closures (strace of each cold sep build): every wwstage tool gains lib/types/types.ww, wwdump_ww/w6c_ww gain lib/math/{floats,math}.ww and drop the no-longer-imported lib/fmt/fmt.ww, ww_ww drops lib/strconv/strconv.ww, and WWTEST_SRC gains the strconv split plus math. Wrapper test binaries link only libwcc.a — the runtime tools they exec move to the run targets that launch them, so a .ww edit no longer relinks 111 carrier binaries. test-compiler-smoke declares the w6a_ww/w6l_ww/ww_ww fleet its WW cell actually drives (latent fresh-clone gap); test-package replaces the blanket all with its exact tool set; test-lang/test-library name the cstage subset they invoke. --- Makefile | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 7868f98e..3c2ab7ef 100644 --- a/Makefile +++ b/Makefile @@ -55,8 +55,10 @@ WWTEST_BIN = $(BIN)/wwtest WWTEST_SRC = cmd/wwtest/wwtest.ww \ internal/wwpackage/package.ww lib/os/exec/exec.ww \ lib/ascii/ascii.ww lib/bytes/bytes.ww \ - lib/encoding/utf8/utf8.ww lib/os/os.ww lib/rt/malloc.ww \ - lib/strconv/strconv.ww \ + lib/encoding/utf8/utf8.ww lib/math/floats.ww lib/math/math.ww \ + lib/os/os.ww lib/rt/malloc.ww \ + lib/strconv/decimal.ww lib/strconv/ftos.ww lib/strconv/ftos_data.ww \ + lib/strconv/stof.ww lib/strconv/stof_data.ww lib/strconv/strconv.ww \ lib/strings/strings.ww lib/temp/temp.ww lib/time/time.ww \ lib/types/types.ww @@ -179,7 +181,7 @@ $(BIN)/wwdump_ww: selfhost/cmd/wwdump/main.ww \ selfhost/cmd/wcc/cgen.ww selfhost/cmd/wcc/cgenexpr.ww \ selfhost/cmd/wcc/cgenstmt.ww selfhost/cmd/wcc/cgenutil.ww \ selfhost/cmd/wcc/cgendecl.ww \ - lib/os/os.ww lib/rt/malloc.ww lib/time/time.ww lib/strconv/strconv.ww lib/strconv/stof_data.ww lib/strconv/decimal.ww lib/strconv/stof.ww lib/strconv/ftos_data.ww lib/strconv/ftos.ww lib/strings/strings.ww lib/bytes/bytes.ww lib/encoding/utf8/utf8.ww lib/ascii/ascii.ww lib/errors/errors.ww lib/io/io.ww lib/io/stream.ww lib/io/types.ww lib/memio/memio.ww lib/fmt/fmt.ww \ + lib/os/os.ww lib/rt/malloc.ww lib/time/time.ww lib/strconv/strconv.ww lib/strconv/stof_data.ww lib/strconv/decimal.ww lib/strconv/stof.ww lib/strconv/ftos_data.ww lib/strconv/ftos.ww lib/strings/strings.ww lib/bytes/bytes.ww lib/encoding/utf8/utf8.ww lib/ascii/ascii.ww lib/errors/errors.ww lib/io/io.ww lib/io/stream.ww lib/io/types.ww lib/math/floats.ww lib/math/math.ww lib/memio/memio.ww lib/types/types.ww \ $(BIN)/ww $(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \ $(LIB)/libwwrt.a | $(BIN) @mkdir -p $(WWBUILD)/wwdump_ww @@ -199,7 +201,7 @@ $(BIN)/w6c_ww: selfhost/cmd/w6c/main.ww \ selfhost/cmd/wcc/cgen.ww selfhost/cmd/wcc/cgenexpr.ww \ selfhost/cmd/wcc/cgenstmt.ww selfhost/cmd/wcc/cgenutil.ww \ selfhost/cmd/wcc/cgendecl.ww \ - lib/os/os.ww lib/rt/malloc.ww lib/time/time.ww lib/strconv/strconv.ww lib/strconv/stof_data.ww lib/strconv/decimal.ww lib/strconv/stof.ww lib/strconv/ftos_data.ww lib/strconv/ftos.ww lib/strings/strings.ww lib/bytes/bytes.ww lib/encoding/utf8/utf8.ww lib/ascii/ascii.ww lib/errors/errors.ww lib/io/io.ww lib/io/stream.ww lib/io/types.ww lib/memio/memio.ww lib/fmt/fmt.ww \ + lib/os/os.ww lib/rt/malloc.ww lib/time/time.ww lib/strconv/strconv.ww lib/strconv/stof_data.ww lib/strconv/decimal.ww lib/strconv/stof.ww lib/strconv/ftos_data.ww lib/strconv/ftos.ww lib/strings/strings.ww lib/bytes/bytes.ww lib/encoding/utf8/utf8.ww lib/ascii/ascii.ww lib/errors/errors.ww lib/io/io.ww lib/io/stream.ww lib/io/types.ww lib/math/floats.ww lib/math/math.ww lib/memio/memio.ww lib/types/types.ww \ $(BIN)/ww $(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \ $(LIB)/libwwrt.a | $(BIN) @mkdir -p $(WWBUILD)/w6c_ww @@ -217,6 +219,7 @@ $(BIN)/w6a_ww: selfhost/cmd/w6a/main.ww selfhost/cmd/w6a/opcodes.ww \ selfhost/cmd/w6a/asm.ww selfhost/cmd/w6a/obj.ww \ lib/os/os.ww lib/rt/malloc.ww lib/time/time.ww \ lib/strings/strings.ww lib/bytes/bytes.ww lib/encoding/utf8/utf8.ww \ + lib/types/types.ww \ $(BIN)/ww $(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \ $(LIB)/libwwrt.a | $(BIN) @mkdir -p $(WWBUILD)/w6a_ww @@ -235,6 +238,7 @@ $(BIN)/w6l_ww: selfhost/cmd/w6l/main.ww selfhost/cmd/w6l/sym.ww \ selfhost/cmd/w6l/out.ww \ lib/os/os.ww lib/rt/malloc.ww lib/time/time.ww \ lib/strings/strings.ww lib/bytes/bytes.ww lib/encoding/utf8/utf8.ww \ + lib/types/types.ww \ $(BIN)/ww $(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \ $(LIB)/libwwrt.a | $(BIN) @mkdir -p $(WWBUILD)/w6l_ww @@ -249,7 +253,7 @@ $(BIN)/w6l_ww: selfhost/cmd/w6l/main.ww selfhost/cmd/w6l/sym.ww \ # w6c/w6a/w6l like the C driver. $(BIN)/ww_ww: selfhost/cmd/ww/main.ww lib/os/exec/exec.ww \ lib/os/os.ww lib/rt/malloc.ww \ - lib/time/time.ww lib/strconv/strconv.ww \ + lib/time/time.ww lib/types/types.ww \ lib/strings/strings.ww lib/bytes/bytes.ww lib/encoding/utf8/utf8.ww \ $(BIN)/ww $(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \ $(LIB)/libwwrt.a | $(BIN) @@ -322,7 +326,9 @@ $(PACKAGE_TEST_BIN): $(PACKAGE_TEST_SRC) $(WWTEST_BIN) \ -I $(CURDIR)/internal $(CURDIR)/test/package/package_test.ww @mv $(WWBUILD)/test_package/main $@ -test-package: all $(PACKAGE_TEST_BIN) +test-package: $(PACKAGE_TEST_BIN) $(WWTEST_BIN) $(BIN)/ww $(BIN)/ww_ww \ + $(BIN)/w6c $(BIN)/w6c_ww $(BIN)/w6a $(BIN)/w6a_ww \ + $(BIN)/w6l $(BIN)/w6l_ww $(LIB)/libwwrt.a @WW_PACKAGE_REPO=$(CURDIR) $(CURDIR)/$(PACKAGE_TEST_BIN) # ---- directories ------------------------------------------------------- @@ -380,7 +386,7 @@ $(BIN)/test_400_w6c: test/wcc/400_w6c.c \ $(CC) $(CFLAGS) $(INCS) -Icmd/w6c -o $@ $< \ $(OBJ)/w6c/cgen.o $(OBJ)/w6c/txt.o $(LIB)/libwcc.a -$(BIN)/test_%: test/wcc/%.c test/wcc/wwtestpkg.h $(WRAPPER_TOOLS) | $(BIN) +$(BIN)/test_%: test/wcc/%.c test/wcc/wwtestpkg.h $(LIB)/libwcc.a | $(BIN) $(CC) $(CFLAGS) $(INCS) -o $@ $< $(LIB)/libwcc.a # Native library tests execute their source owner directly. The retired C @@ -415,24 +421,26 @@ test-unit: $(UNIT_BINS) done # One compile-only declarative fixture is the ordinary C/WW smoke slice. -test-compiler-smoke: $(WWFIXTURE_BIN) $(BIN)/w6c_ww +test-compiler-smoke: $(WWFIXTURE_BIN) $(BIN)/w6c_ww $(BIN)/w6a_ww \ + $(BIN)/w6l_ww $(BIN)/ww_ww @$(CURDIR)/$(WWFIXTURE_BIN) -j 1 \ -run compiler.r78_strict_package_main_accept # Complete declarative corpus plus the residual native artifact/integration # gates that cannot be represented by a single compiler fixture. -test-compiler: $(WWFIXTURE_BIN) $(WWFIXTURE_TOOLS) $(COMPILER_WRAPPER_BINS) +test-compiler: $(WWFIXTURE_BIN) $(WRAPPER_TOOLS) $(COMPILER_WRAPPER_BINS) @$(CURDIR)/$(WWFIXTURE_BIN) -j $(JOBS) @set -e; for t in $(COMPILER_WRAPPER_BINS); do \ echo "compiler artifact $$t"; BIN=$(CURDIR)/$(BIN) $(CURDIR)/$$t; \ done -test-lang: cstage +test-lang: $(BIN)/ww $(BIN)/w6c $(BIN)/w6a $(BIN)/w6l $(LIB)/libwwrt.a @set -e; for f in $(wildcard test/lang/*_test.ww); do \ echo "ww test $$f"; $(BIN)/ww test $$f; \ done -test-library: cstage $(BIN)/w6c_ww $(LIBRARY_STANDALONE_SOURCES) +test-library: $(BIN)/ww $(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \ + $(LIB)/libwwrt.a $(BIN)/w6c_ww $(LIBRARY_STANDALONE_SOURCES) @set -e; for f in $(LIBRARY_TESTS); do \ echo "ww test $$f"; \ $(BIN)/ww test -I $(CURDIR)/lib/ww $$f; \ @@ -444,17 +452,17 @@ test-library: cstage $(BIN)/w6c_ww $(LIBRARY_STANDALONE_SOURCES) $(CURDIR)/$(BIN)/w6c_ww $(CURDIR)/$$f > /dev/null; \ done -test-native-byteid: $(BYTEID_WRAPPER_BINS) +test-native-byteid: $(WRAPPER_TOOLS) $(BYTEID_WRAPPER_BINS) @set -e; for t in $(BYTEID_WRAPPER_BINS); do \ echo "byte-id $$t"; BIN=$(CURDIR)/$(BIN) $(CURDIR)/$$t; \ done -test-bootstrap-native: $(BOOTSTRAP_WRAPPER_BINS) +test-bootstrap-native: $(WRAPPER_TOOLS) $(BOOTSTRAP_WRAPPER_BINS) @set -e; for t in $(BOOTSTRAP_WRAPPER_BINS); do \ echo "bootstrap $$t"; BIN=$(CURDIR)/$(BIN) $(CURDIR)/$$t; \ done -test-platform: $(PLATFORM_WRAPPER_BINS) +test-platform: $(WRAPPER_TOOLS) $(PLATFORM_WRAPPER_BINS) @set -e; for t in $(PLATFORM_WRAPPER_BINS); do \ echo "platform $$t"; BIN=$(CURDIR)/$(BIN) $(CURDIR)/$$t; \ done