Page MenuHomeFreeBSD

Don't delete hack.c - causes perpetual 'out of date' kernel
ClosedPublic

Authored by obrien on Feb 15 2022, 1:06 AM.

Details

Summary

Deleting hack.c cause the kernel to always be out of date:

   $ make kernel
   make: /usr/src/sys/amd64/compile/GENERIC/.depend.hack.pico, 1:
	     ignoring stale .depend for hack.c
   :> hack.c
   cc -shared -O2 -pipe ... -nostdlib hack.c -o hack.pico
   rm -f hack.c
   MAKE="make" sh ../../../conf/newvers.sh "-R" GENERIC
   cc -c -O2 -pipe ...  -std=iso9899:1999 -Werror  vers.c
   ctfconvert -L VERSION -g vers.o
   linking kernel.full

Keeping hack.c in the compile directory causes no harm,
so there's no reason to delete it.

Test Plan

configure GENERIC ; cd ../compile/GENERIC ; make kernel ; make kernel

Diff Detail

Repository
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

sys/conf/kern.post.mk
236

Why is there not simply a hack.c target:

hack.c:
      :> $@

might even be worth renaming it to its purpose force-dynamic-hack.c ?

Updating based on sjg's input.

This revision is now accepted and ready to land.Feb 16 2022, 7:41 PM
emaste added inline comments.
sys/conf/kern.post.mk
233

:> ${.TARGET} perhaps?

237

-o ${.TARGET} perhaps?