diff options
author | bdrewery <bdrewery@FreeBSD.org> | 2016-04-18 18:14:02 +0000 |
---|---|---|
committer | bdrewery <bdrewery@FreeBSD.org> | 2016-04-18 18:14:02 +0000 |
commit | 731f354016c2341c44d7c86d90474627fbb89f30 (patch) | |
tree | 55c2cf3122641139aedbbbb04881af253d113d66 | |
parent | 0cc8656eb968e6b5a098f6307911006932447c3c (diff) | |
download | FreeBSD-src-731f354016c2341c44d7c86d90474627fbb89f30.zip FreeBSD-src-731f354016c2341c44d7c86d90474627fbb89f30.tar.gz |
Cause an error during 'make install' if trying to compile with CC.
This is limited to src-tree builds, meaning not extended to ports or other
out-of-tree builds.
This will help ensure that read-only OBJDIRS will be respected at install-time
by causing a more consistent failure for those who don't use a read-only
OBJDIR. It also will cause Jenkins to yell. This is a better solution than
trying to see CC=false as has been attempted and discussed before.
Of course this is only relevant for files generated by CC.
Disable this for META_MODE since it will detect the CFLAGS/command
change and force a rebuild.
Sponsored by: EMC / Isilon Storage Division
-rw-r--r-- | share/mk/bsd.sys.mk | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 5660bd4..709556e 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -178,6 +178,13 @@ ACFLAGS+= ${ACFLAGS.${.IMPSRC:T}} CFLAGS+= ${CFLAGS.${.IMPSRC:T}} CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}} +.if defined(SRCTOP) +# Prevent rebuilding during install to support read-only objdirs. +.if make(install) && empty(.MAKE.MODE:Mmeta) +CFLAGS+= ERROR-tried-to-rebuild-during-make-install +.endif +.endif + # Tell bmake not to mistake standard targets for things to be searched for # or expect to ever be up-to-date. PHONY_NOTMAIN = analyze afterdepend afterinstall all beforedepend beforeinstall \ |