aboutsummaryrefslogtreecommitdiff
path: root/testsuite/make.tests (follow)
Commit message (Collapse)AuthorAgeFilesLines
* make: fixes to test scriptRon Yorston2022-12-121-0/+3
| | | | | | | | Unset MAKEFLAGS in the test script so it works if it's run using a version of make that has options which pdpmake doesn't understand. Return $FAILCOUNT as the exit status so the number of failures can be reported.
* make: changes to suffix substitution in macro expansionRon Yorston2022-11-161-0/+11
| | | | | | | | | | | | | | The POSIX standard defines suffix substitution in macro expansion as taking the form: $(string1 [: subst1 =[ subst2 ]]) Since 'subst1' isn't bracketed a value must be supplied. Enforce this in POSIX mode. As a non-POSIX extension an empty 'subst1' is permitted with 'subst2' being added to all words unconditionally. If both 'subst1' and 'subst2' are empty the words are returned unchanged.
* make: use correct test for valid macro nameRon Yorston2022-11-131-0/+13
| | | | | The test for valid macro names in POSIX mode was incorrect: it shouldn't have allowed '-'.
* make: fix typo in inference rule handlingRon Yorston2022-11-041-23/+24
| | | | | | | A typo in the previous commit caused dyndep() to process inference rules incorrectly. This didn't affect the results of the test suite when extensions were allowed but it caused the test 'Inference rule with explicit rule for prerequisite' to fail in POSIX mode.
* make: fixes to inference rulesRon Yorston2022-11-031-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Austin Group defect report 875 clarifies some aspects of inference rules. The crux of the issue is related to chained inference rules so it doesn't affect POSIX mode. The test makefile looks like this: .SUFFIXES: .a .b .c .a.c: @echo .a.c .b.c: @echo .b.c test.c: test.b test.a: test.b: The correct output is deemed to be '.a.c'. Additional complications are: - whether or not the prerequisite files are present; - the use of the suffixes '.a' and '.c' may result in the builtin inference rule '.c.a' being considered. In favourable circumstances pdpmake managed to give the correct result, in unfavourable it reported circular dependencies or segfaulted. Changes to fix these issues are: - When prerequisites are being recursively built the standard says: 'Upon recursion, each prerequisite shall become a target itself.' Follow this requirement. - At the end of make() the target being built should have its time (as represented by n_tim in struct name) updated when any action has been taken. - When dyndep() is looking for prerequisites it should: * skip candidates that are in the process of being built; * consider whether an explicit candidate is a target, not whether it has any commands associated with it. pdpmake now behaves similarly to GNU make when presented with makefiles like the above. bmake gives the incorrect output '.b.c'.
* make: comments in macro expansions and command linesRon Yorston2022-11-011-0/+18
| | | | | | | | | | | | | | The POSIX specification says: There are three kinds of comments: blank lines, empty lines, and a <number-sign> ('#') and all following characters up to the first unescaped <newline> character. Most implementations don't treat '#' in a macro expansion or a command line as the start of a comment. POSIX doesn't mention either of these exceptions. Permit the exceptions as a non-POSIX extension.
* make: fix test for .WAIT so bmake passesRon Yorston2022-11-011-1/+1
| | | | | Use $? instead of $^ in the test for .WAIT. bmake supports .WAIT but not $^.
* make: different treatment for escaped NL in macro in commandRon Yorston2022-10-301-0/+13
| | | | | | | Austin Group defect report 1549 has been accepted. It requires that an escaped newline inside a macro expansion in a command is replaced by a space. Other escaped newlines in commands are left in place, as before.
* make: .NOTPARALLEL and .WAIT are special targetsRon Yorston2022-10-191-2/+12
| | | | | | | | | | | | | Austin Group defect report 1437 has been accepted. It describes the special targets .NOTPARALLEL and .WAIT which are used to influence the behaviour of parallel builds. Since parallel builds aren't implemented in here they actually don't 't have much effect. - For completeness they're flagged as special targets. - .WAIT should be allowed as a prerequisite.
* make: shell assignment is a POSIX 202X featureRon Yorston2022-10-181-11/+12
| | | | | | | | Austin Group defect report 337 has been accepted, thus making macro assignment from the output of a shell command (!=) a POSIX 202X feature. This was previously implemented as a non-POSIX extension.
* make: support $+ and $^ as POSIX 202X featuresRon Yorston2022-10-181-0/+12
| | | | | | | | | | | | | | | | | | Austin Group defect reports 514 and 1520 have both been accepted. Together these introduce the internal macros $+ and $^: - $+ lists all prerequisites, with duplicates retained; - $^ lists all prerequisites, with duplicates removed. $^ had already been implemented as a non-POSIX extension, it now becomes a POSIX 202X extension. $+ has been added as a POSIX 202X extension. Neither of the above defect reports mentions how $? should handle duplicate prerequisites. In POSIX mode duplicates are retained. Removal of duplicates is implemented as a non-POSIX extension to match existing practice in other versions of make.
* make: clarify output of testsRon Yorston2022-10-161-31/+31
|
* make: new appletRon Yorston2022-08-011-0/+413
This is an experimental implementation of make for busybox-w32, based on my public domain POSIX make: https://frippery.org/make/ (GitHub issue #44)