#
357108 |
|
25-Jan-2020 |
kevans |
MFC r355473, r356540, r356604, r356868, r356937: sysent improvements
The main motivation here being .ORDER to render -jN > 1 harmless; svr4/ibcs2 targets were also refactored a bit, but both are irregular and cannot use sysent.mk as-is due to differences in files generated. I have no interest in refactoring, since these are gone in head anyways.
r355473: sysent: Reduce duplication and improve readability.
Use the power of variable to avoid spelling out source and generated files too many times. The previous Makefiles were hard to read, hard to edit, and badly formatted.
r356540: kern/Makefile: systrace_args.c is also generated
r356604: Set .ORDER for makesyscalls generated files
When either makesyscalls.lua or syscalls.master changes, all of the ${GENERATED} targets are now out-of-date. With make jobs > 1, this means we will run the makesyscalls script in parallel for the same ABI, generating the same set of output files.
Prior to r356603 , there is a large window for interlacing output for some of the generated files that we were generating in-place rather than staging in a temp dir. After that, we still should't need to run the script more than once per-ABI as the first invocation should update all of them. Add .ORDER to do so cleanly.
r356868: sysent targets: further cleanup and deduplication
r355473 vastly improved the readability and cleanliness of these Makefiles. Every single one of them follows the same pattern and duplicates the exact same logic.
Now that we have GENERATED/SRCS, split SRCS up into the two parameters we'll use for ${MAKESYSCALLS} rather than assuming a specific ordering of SRCS and include a common sysent.mk to handle the rest. This makes it less tedious to make sweeping changes.
Some default values are provided for GENERATED/SYSENT_*; almost all of these just use a 'syscalls.master' and 'syscalls.conf' in cwd, and they all use effectively the same filenames with an arbitrary prefix. Most ABIs will be able to get away with just setting GENERATED_PREFIX and including ^/sys/conf/sysent.mk, while others only need light additions. kern/Makefile is the notable exception, as it doesn't take a SYSENT_CONF and the generated files are spread out between ^/sys/kern and ^/sys/sys, but it otherwise fits the pattern enough to use the common version.
r356937: sysent.mk: split interpreter out of target command
The main objective here is to make it easy to identify what needs to change in order to use a different sysent generator than the current Lua-based one, which may be used to MFC some of the changes that have happened so we can avoid parallel accidents in stable branches, for instance.
As a secondary objective, it's now feasible to override the generator on a per-Makefile basis if needed, so that one could refactor their Makefile to use this while pinning generation to the legacy makesyscalls.sh. I don't anticipate any consistent need for such a thing, but it's low-effort to achieve.
|