summaryrefslogtreecommitdiff
path: root/usr.bin/make/Makefile
AgeCommit message (Collapse)Author
2023-06-19make: sort files in coverage report alphabeticallyrillig
2023-06-03bsd.own.mk: rename GCC_NO_* to CC_WNO_*lukem
Rename compiler-warning-disable variables from GCC_NO_warning to CC_WNO_warning where warning is the full warning name as used by the compiler. GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH Using the convention CC_compilerflag, where compilerflag is based on the full compiler flag name.
2022-09-27make: set WARNS to 6, from the default 5rillig
No binary change on x86_64.
2022-05-03make: remove test scenarios for old GCC versionsrillig
These had been useful for NetBSD 8, which used GCC 5.
2022-01-26make: generate coverage summary on 'make test-coverage'rillig
2022-01-09make: in Cmd_Exec, return error message instead of format stringrillig
This change leaves only literal format strings in parse.c. It allows for more detailed error messages than the current "non-zero status" or "exited on a signal". No functional change.
2021-12-12make: do not report '?' for fully covered header filesrillig
2021-12-12make: only define target report-coverage if USE_COVERAGE is yesrillig
Without USE_COVERAGE, GCOV was undefined, the '2>&1' passed all error messages to GCOV_PERL, when then discarded them. If the error messages had been left on stderr, the error message 'sh: arch.o.gcda: not found' would have been a clear indicator of the actual cause of an empty coverage report.
2021-11-28make: replace bloated bit-set-to-string code with simple coderillig
It was a nice idea to implement a bit-set using an enum type and have a generic ToString function for them. In the end, the implementation involved really heavy preprocessor magic and was probably difficult to understand. Replace all the code with a few bits of straight-forward preprocessor magic that can be readily understood by just looking 5 lines around, instead of digging through 130 lines of lengthy macro definitions. Curiously, this reduces the binary size even though the 3 ToString functions now have a few lines of duplicate code and there are more explicit function calls. The ToString functions are only seldom used, so the additional memory allocation is acceptable. No functional change.
2021-07-31make: fix lint warningsrillig
The string functions from str.h are declared as 'static __unused' when compiled with GCC, but lint explicitly undefines __GCC__ during preprocessing. Therefore, make those functions inline, to prevent warnings that they are unused. The macro UNCONST is used in a few places, and (again) since lint undefines __GCC__, that macro expanded to a simple type cast, which lint warned about. To prevent this warning, implement UNCONST as a function that works everywhere and hides the type cast. In filemon_open, the code for closing F->in was obviously unreachable. No functional change.
2021-05-30make: fix reported code coverage for *.hrillig
In 'make test-coverage', the number of uncovered lines for inline functions in headers was reported too high. The cause for this is that gcov reports the coverage for these functions multiple times, once per translation unit. If some of the translation units don't use these inline functions, summing the lines containing '#####' quickly leads to numbers that are obviously too high.
2021-04-11make: clean up Makefilerillig
The dependencies on the header files are handled by 'make depend'. They do not need to be spelled out.
2021-02-22make: fix report-coveragerillig
On NetBSD 8.0 it still worked. Maybe gcov doesn't support .c files as arguments anymore. Using the .gcda files works and is more reliable anyway since it covers the inline functions in the headers as well.
2021-01-30make(1): run lint with strict bool moderillig
The make code is not supposed to use constructs such as "if (strcmp(s1, s2))" or "if (p && *p)", instead all boolean expressions have a form that would be accepted by a C#, Go or Java compiler as well. This also ensures that pre-C99 compilers generate equivalent code as C99 compilers, at least regarding boolean expressions.
2020-12-12make(1): add number of uncovered lines to coverage reportrillig
2020-12-12make(1): add target test-coveragerillig
2020-12-06make(1): move .include lines as far down as possiblerillig
2020-12-06make(1): move COPTS above <bsd.prog.mk>rillig
2020-12-03make(1): format coverage summary as a tablerillig
This is only used interactively, not in the official builds, therefore the additional dependency on Perl doesn't matter. The same result could have been achieved in any other programming language, but probably not as concisely.
2020-10-25make(1): remove unused strlist_trillig
2020-10-23make(1): add target-specific COPTS when generating cpre or casmrillig
2020-10-18make(1): fix GCC warning about small buffer for cohort_numrillig
Since unmade_cohorts is a signed number (the code contains an underflow check), the result of the '%' operator could be negative and result in "#-999999", which would overflow the buffer, truncating the last digit.
2020-10-05make(1): enable format string truncation warnings for parse.crillig
No node is ever going to have a million or more cohorts. And even if there were, this name is only used for printing informational messages.
2020-10-05make(1): revert previous commitrillig
It had accidentally reverted all the work from the past few days.
2020-10-05make(1): fix double-free bug in -DCLEANUP mode (since 2020-10-02)rillig
The bug had been introduced with dir.c 1.155 on 2020-10-02 22:20:25. In that commit, openDirectories was replaced with a combination of a list with a hash table, for more efficient lookup by name. Upon cleanup, OpenDirs_Done is called, which in turn called Dir_ClearPath. Dir_ClearPath takes full ownership of the given list and empties it. This was no problem before since afterwards the list was empty and calling Lst_Free just frees the remaining list pointer. With OpenDirs, this list was combined with a hash table, and the hash table contains the list nodes, assuming that the OpenDirs functions have full ownership of both the list and the hash table. This assumption was generally correct, except for the one moment during cleanup where full ownership of the list was passed to Dir_ClearPath, while the hash table still contained pointers to the (now freed) list nodes. This by itself was not a problem since the hash table would be freed afterwards. But as part of Dir_ClearPath, OpenDirs_Remove was called, which looked up the freed directory by name and now found the freed list node, trying to free it again. Boom. Fixed by replacing the call to Dir_ClearPath with code that only frees the directories, without giving up control over the list.
2020-10-05make(1): allow easy creation of preprocessed source and assemblerrillig
To be used during development, to see how changes in the source code affect the generated machine code.
2020-09-01make(1): remove filemon object files on cleanrillig
2020-08-31make(1): fix compilation with GCC 8rillig
2020-08-31make(1): fix copy-and-paste mistake for compiling with GCC10rillig
2020-08-28make(1): remove redundant MAKEFLAGS from subdir makerillig
The make flags are passed via the environment, not via the command line. This is not as obvious and visible, but it works.
2020-08-27make(1): pass the command-line variables to the subdir makerillig
2020-08-26make(1): remove header sprite.hrillig
Make is independent of the Sprite operating system.
2020-08-25make(1): allow custom build optionsrillig
2020-08-23make(1): allow to run only selected tests via the command linerillig
2020-08-22Use TEST_MAKE to run unit-testssjg
This lets us take advantage of new features like ${.SHELL}
2020-08-19make(1): don't optimize when measuring the code coveragerillig
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96622
2020-08-15make(1): fix archive testrillig
Even though it is commented out in this Makefile, it is still run by atf, on purpose. This test is broken on FreeBSD, but on NetBSD it should still be run. Without removing the archive first, it could be left over from a previous test failure and thus be newer than all its members, leading to ${.OODATE} being empty.
2020-08-12make(1): enable -Wcast-qual for var.c againrillig
When it became disabled 9 years ago, there were 15 instances of UNCONST in the code. These have been removed in the latest cleanup sessions. Tested with GCC 5 from NetBSD 8 and GCC 10 from pkgsrc.
2020-08-12make(1): allow optional compilation with GCC 10, use gcov from GCCrillig
2020-08-10make(1): make gcov command line configurablerillig
Some useful options are -a or -f.
2020-08-10make(1): clean up coverage files even if USE_COVERAGE is not setrillig
2020-08-09make(1): allow to build using GCC 9 during developmentrillig
2020-08-08make(1): add more detailed debug logging for variable modifiersrillig
Before a modifier is applied to a variable, it is not yet parsed, therefore it is only possible to log a rough estimate of the modifier. But after applying it, the parsing position has advanced, and the full modifier can be logged. In addition, to fully understand how the modifiers work, it's not enough to just know the variable names and values, there are also some flags that influence how the modifiers behave. The most influential is VARE_WANTRES. Thanks to sjg for the extensive review and valuable feedback on the first drafts.
2020-08-07make(1): one file per line in the Makefilerillig
Suggested by sjg.
2020-08-06make(1): revert previous commit; "make retest" was already possiblerillig
What I really meant to allow was to run "make sync-mi" directly from the main directory. But adding that to TARGETS didn't do anything.
2020-08-06make(1): allow "make retest" directly from the main directoryrillig
2020-08-03make(1): no declaration-after-statement anymorerillig
NetBSD make is intended to be maximally portable, therefore it uses only C89. This was not declared in the Makefile before. There are still a few places in parse.c and metachar.c that use end-of-line comments. These will be fixed in a follow-up commit.
2020-08-01make(1): remove line numbers from generated code coverage filesrillig
The line numbers make it difficult to spot changes in the code and coverage if a line is added or removed from the code.
2020-07-31make(1): fix undefined behavior in malformed :S modifierrillig
The unit tests failed on Ubuntu, and by looking closely at the code, it was trivial to see the out-of-bounds memory read. Other modifiers may have the same problem and will be inspected later.
2020-07-29make(1): use specialized return type for ApplyModifier functionsrillig
This makes it immediately obvious what happens after a modifier has been applied, instead of having to translate single-character mnemonics or booleans to their actual intention. This also reduces the size of the binary since there are fewer jumps.