Page MenuHomeFreeBSD

sysent targets: further cleanup and deduplication
ClosedPublic

Authored by kevans on Jan 16 2020, 4:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 23 2024, 1:17 PM
Unknown Object (File)
Feb 23 2024, 1:17 PM
Unknown Object (File)
Feb 23 2024, 1:15 PM
Unknown Object (File)
Feb 23 2024, 1:15 PM
Unknown Object (File)
Feb 23 2024, 1:15 PM
Unknown Object (File)
Feb 23 2024, 1:00 PM
Unknown Object (File)
Feb 15 2024, 1:36 AM
Unknown Object (File)
Feb 11 2024, 12:37 PM
Subscribers

Details

Summary

rS355473 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.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Whoops; missed an instance of setting SYSENT_CONF redundantly in compat/cloudabi*

Very nice cleanup.

One think I notice upon review is that in every case except sys/kern/Makefile we have the same set of 5 files with a different prefix. I'm not sure it's worth addressing that, but I guess you could do something like GENERATED?=${COMMON_GENERATED:S/^/${GENERATED_PREFIX}}

This revision is now accepted and ready to land.Jan 16 2020, 9:14 AM

Very nice cleanup.

One think I notice upon review is that in every case except sys/kern/Makefile we have the same set of 5 files with a different prefix. I'm not sure it's worth addressing that, but I guess you could do something like GENERATED?=${COMMON_GENERATED:S/^/${GENERATED_PREFIX}}

Ah, yes- that lets us easily reduce almost all of these to two lines (one assignment + include).

I see that cheri also has a clean target in ^/sys/compat/cheriabi/Makefile; would it make sense to go ahead and add one to this common Makefile while I'm at it? It doesn't feel generally useful, but it also isn't harmful and the target would effectively just be rm -f ${GENERATED} at this point, and that Makefile could also probably use a similar (edit: cleanup, like these) with GENERATED_PREFIX=cheriabi_. (Even if it doesn't, I note that the sysent target is missing dependency on cheriabi_syscalls.c, not that it matters all that much)

I see that cheri also has a clean target in ^/sys/compat/cheriabi/Makefile; would it make sense to go ahead and add one to this common Makefile while I'm at it? It doesn't feel generally useful, but it also isn't harmful and the target would effectively just be rm -f ${GENERATED} at this point, and that Makefile could also probably use a similar (edit: cleanup, like these) with GENERATED_PREFIX=cheriabi_. (Even if it doesn't, I note that the sysent target is missing dependency on cheriabi_syscalls.c, not that it matters all that much)

I don't think a clean target is very useful (you can always just do touch syscalls.master) I think freebsd32 had one and I copied it to cheriabi and then removed them in my last cleanup.

Further cleanup- split list of commonly generated files out into sysent.mk and add GENERATED_PREFIX + default value for GENERATED so that most of the makefiles just need to set a prefix and maybe point to the proper sysent+config.

This revision now requires review to proceed.Jan 17 2020, 7:29 PM
This revision is now accepted and ready to land.Jan 18 2020, 5:28 PM
This revision was automatically updated to reflect the committed changes.