head 1.12; access; symbols netbsd-11-0-RC6:1.12 netbsd-11-0-RC5:1.12 netbsd-11-0-RC4:1.12 netbsd-11-0-RC3:1.12 netbsd-11-0-RC2:1.12 netbsd-11-0-RC1:1.12 perseant-exfatfs-base-20250801:1.12 netbsd-11:1.12.0.2 netbsd-11-base:1.12 netbsd-10-1-RELEASE:1.7 perseant-exfatfs-base-20240630:1.8 perseant-exfatfs:1.8.0.2 perseant-exfatfs-base:1.8 netbsd-10-0-RELEASE:1.7 netbsd-10-0-RC6:1.7 netbsd-10-0-RC5:1.7 netbsd-10-0-RC4:1.7 netbsd-10-0-RC3:1.7 netbsd-10-0-RC2:1.7 netbsd-10-0-RC1:1.7 netbsd-10:1.7.0.6 netbsd-10-base:1.7 cjep_sun2x-base1:1.7 cjep_sun2x:1.7.0.4 cjep_sun2x-base:1.7 cjep_staticlib_x-base1:1.7 cjep_staticlib_x:1.7.0.2 cjep_staticlib_x-base:1.7; locks; strict; comment @# @; 1.12 date 2025.06.12.20.07.59; author rillig; state Exp; branches; next 1.11; commitid TvXDsjyvKE04KDYF; 1.11 date 2025.06.12.19.02.32; author rillig; state Exp; branches; next 1.10; commitid KVFL0xqz3NxBnDYF; 1.10 date 2025.03.30.09.51.49; author rillig; state Exp; branches; next 1.9; commitid veGmSzVhPiW2G4PF; 1.9 date 2025.01.10.23.00.38; author rillig; state Exp; branches; next 1.8; commitid vECOnwAU0SdlAZEF; 1.8 date 2024.04.27.20.23.22; author rillig; state Exp; branches 1.8.2.1; next 1.7; commitid qIkQtWMFex6p2P7F; 1.7 date 2020.10.09.06.44.42; author rillig; state Exp; branches; next 1.6; commitid 1Zdca0w9j8qcacrC; 1.6 date 2020.10.08.18.37.26; author rillig; state Exp; branches; next 1.5; commitid Mkmr0x8hNahp68rC; 1.5 date 2020.09.04.17.03.17; author rillig; state Exp; branches; next 1.4; commitid 2ICcWz99gRJkIKmC; 1.4 date 2020.08.23.17.51.24; author rillig; state Exp; branches; next 1.3; commitid F4fwmr4TsvYtmdlC; 1.3 date 2020.08.23.17.34.46; author rillig; state Exp; branches; next 1.2; commitid 9AsBDFFAQP23hdlC; 1.2 date 2020.08.16.14.39.50; author rillig; state Exp; branches; next 1.1; commitid z0CXYQ2EDNECwikC; 1.1 date 2020.07.27.18.51.03; author rillig; state Exp; branches; next ; commitid WgSmD7srtaWlyKhC; 1.8.2.1 date 2025.08.02.05.58.30; author perseant; state Exp; branches; next ; commitid 23j6GFaDws3O875G; desc @@ 1.12 log @make: add program name to stack traces from sub-makes @ text @Making remove-archive rm -f libprog.a Making libprog.a out-of-date archive.mk modmisc.mk varmisc.mk ar cru libprog.a archive.mk modmisc.mk varmisc.mk ranlib libprog.a Making create-archive out-of-date libprog.a Making list-archive out-of-date libprog.a ar t libprog.a archive.mk modmisc.mk varmisc.mk Making list-archive-wildcard out-of-date archive-suffix.mk archive.mk ternary.mk list-archive-wildcard: archive-suffix.mk list-archive-wildcard: archive.mk list-archive-wildcard: ternary.mk make: archive.mk:61: Error in source archive spec "libprog.a${UNDEF}(archive.mk) pre post" in make[1] in directory "" make: Fatal errors encountered -- cannot continue make: stopped making "list-archive-undef-archive" in unit-tests exit 1 make: archive.mk:68: Error in source archive spec "libprog.a" in make[1] in directory "" make: Fatal errors encountered -- cannot continue make: stopped making "list-archive-undef-member" in unit-tests exit 1 Making depend-on-existing-member out-of-date archive.mk depend-on-existing-member `depend-on-nonexistent-member' is up to date. Making remove-archive rm -f libprog.a begin library Examining libbad.a...up-to-date. Examining -lbad...up-to-date. Examining libgood.a...library...up-to-date. Examining -lgood...library...up-to-date. Examining library...nonexistent....PHONY node...out-of-date. Examining .END...nonexistent...nonexistent and no sources...out-of-date. end library exit status 0 @ 1.11 log @make: add quotes to "in directory" line in stack traces The other lines in stack traces use quotes as well. @ text @d22 1 a22 1 in directory "" d28 1 a28 1 in directory "" @ 1.10 log @make: use '"filename" line 123' for locations instead of 'filename:123' The format 'filename:123' is commonly used for identifying a location in a file. Text editors recognize it and allow quick navigation through it. The previous format was specific to make and would have required custom support in editors. The new format was already used in stack traces, except for the first line. Now all lines use the same format. @ text @d22 1 a22 1 in directory d28 1 a28 1 in directory @ 1.9 log @tests/make: test expressions based on undefined variables When an undefined variable is used in a conditional, make complains about "Malformed conditional", which is wrong since the conditional is well-formed but errors out during evaluation. In order to fix this wrong error message and preserve the remaining behavior, cover the places in which an expression is evaluated with undefined expressions being an error (VARE_EVAL_DEFINED), but with neither producing an error message nor handling errors. This combination results in the same behavior as evaluating the expressions in the mode that allows undefined variables to be used in expressions. @ text @d21 1 a21 1 make: "archive.mk" line 61: Error in source archive spec "libprog.a${UNDEF}(archive.mk) pre post" d27 1 a27 1 make: "archive.mk" line 68: Error in source archive spec "libprog.a" @ 1.8 log @tests/make: test detection of static library files @ text @d21 12 @ 1.8.2.1 log @Sync with HEAD @ text @a20 12 make: archive.mk:61: Error in source archive spec "libprog.a${UNDEF}(archive.mk) pre post" in make[1] in directory "" make: Fatal errors encountered -- cannot continue make: stopped making "list-archive-undef-archive" in unit-tests exit 1 make: archive.mk:68: Error in source archive spec "libprog.a" in make[1] in directory "" make: Fatal errors encountered -- cannot continue make: stopped making "list-archive-undef-member" in unit-tests exit 1 @ 1.7 log @make(1): use consistent order in .OODATE in test archive.mk @ text @d28 8 @ 1.6 log @make(1): make individual targets in test archive.mk visible This test still fails on FreeBSD, printing the "ar cru, ranlib" lines twice, and I don't know why. To get more insights into the inner details, without activating the full -dA logging, split the output into paragraphs, one per target. This change reveals another interesting detail: Dependencies without any commands (in this case create-archive) don't inherit the commands from .USEBEFORE and .USE sources. @ text @d16 1 a16 1 Making list-archive-wildcard out-of-date ternary.mk archive-suffix.mk archive.mk @ 1.5 log @make(1): fix expected file for archive test This test is currently disabled, therefore it didn't fail immediately. @ text @d1 1 d3 2 d7 4 d15 2 d20 2 d23 1 d25 1 d27 1 @ 1.4 log @make(1): in archive test, use wildcard that matches more than 1 file This is to make sure that the buffer used for "archive(member)" is properly reset after each member. @ text @d8 1 @ 1.3 log @make(1): add test for wildcards in archive dependency @ text @d9 1 @ 1.2 log @make(1): fix archive test At the beginning of that test, the library archive obviously does not exist yet. This test failure is a bit hard to detect since the test is disabled in usr.bin/make, but not in tests/usr.bin/make. This is because the latter just runs all .mk files as tests, no matter whether they are commented out or not. @ text @d8 1 @ 1.1 log @make(1): add very basic test for archive handling The whole code in arch.c had been uncovered by tests before. The code coverage shows that neither the archive name nor the member contain any $, even though archive.mk looks like it. It could be necessary to place the variable assignments below the dependency line, to force late evaluation. @ text @d1 1 d10 1 a10 1 rm libprog.a @