aboutsummaryrefslogtreecommitdiff
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2020-09-08 00:44:35 +0000
committerEd Maste <emaste@FreeBSD.org>2020-09-08 00:44:35 +0000
commit75766799863334570acf7a65510361f470ce3b3e (patch)
tree3c1ec2b616e51ac879bc23b5a178716c3e1642a4 /Makefile.inc1
parent1fde30519104cec4ac5e2a791a867f578d72ace3 (diff)
downloadsrc-75766799863334570acf7a65510361f470ce3b3e.tar.gz
src-75766799863334570acf7a65510361f470ce3b3e.zip
Add WITH_/WITHOUT_CLEAN option to replace NO_CLEAN
This allows use of the standard src.conf configuration for controlling whether the tree is cleaned before build or not. The default is still to clean. Setting either NOCLEAN or NO_CLEAN will mention the new src.conf option. NOCLEAN remains a .warning, while for now NO_CLEAN is .info. Reviewed by: bdrewery (earlier version) MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22762
Notes
Notes: svn path=/head/; revision=365439
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc128
1 files changed, 16 insertions, 12 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index b5d7035c7295..4c4fdf601ce0 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -441,8 +441,12 @@ SUBDIR+=etc
.endif # !empty(SUBDIR_OVERRIDE)
.if defined(NOCLEAN)
-.warning NOCLEAN option is deprecated. Use NO_CLEAN instead.
-NO_CLEAN= ${NOCLEAN}
+.warning The src.conf WITHOUT_CLEAN option can now be used instead of NOCLEAN.
+MK_CLEAN:= no
+.endif
+.if defined(NO_CLEAN)
+.info The src.conf WITHOUT_CLEAN option can now be used instead of NO_CLEAN.
+MK_CLEAN:= no
.endif
.if defined(NO_CLEANDIR)
CLEANDIR= clean cleandepend
@@ -451,7 +455,7 @@ CLEANDIR= cleandir
.endif
.if defined(WORLDFAST)
-NO_CLEAN= t
+MK_CLEAN:= no
NO_OBJWALK= t
.endif
@@ -460,7 +464,7 @@ NO_OBJWALK= t
# The .meta files will also track the build command and rebuild should
# it change.
.if empty(.MAKE.MODE:Mnofilemon)
-NO_CLEAN= t
+MK_CLEAN:= no
.endif
.endif
.if defined(NO_OBJWALK) || ${MK_AUTO_OBJ} == "yes"
@@ -837,7 +841,7 @@ _LIBCOMPAT= SOFT
# timestamps (see NO_META_IGNORE_HOST in sys.mk). There are known times
# when the ABI breaks though that we want to force rebuilding WORLDTMP
# to get updated host tools.
-.if ${MK_META_MODE} == "yes" && defined(NO_CLEAN) && \
+.if ${MK_META_MODE} == "yes" && ${MK_CLEAN} == "no" && \
!defined(NO_META_IGNORE_HOST) && !defined(NO_META_IGNORE_HOST_HEADERS) && \
!defined(_MKSHOWCONFIG)
# r318736 - ino64 major ABI breakage
@@ -869,7 +873,7 @@ NO_META_IGNORE_HOST_HEADERS= 1
.export NO_META_IGNORE_HOST_HEADERS
.endif # defined(_meta_mode_need_rebuild)
.endif # defined(OBJDIR_HOST_OSRELDATE)
-.endif # ${MK_META_MODE} == "yes" && defined(NO_CLEAN) ...
+.endif # ${MK_META_MODE} == "yes" && ${MK_CLEAN} == "no" ...
# This is only used for META_MODE+filemon to track what the oldest
# __FreeBSD_version is in WORLDTMP. This purposely does NOT have
# a make dependency on /usr/include/osreldate.h as the file should
@@ -1013,7 +1017,7 @@ _worldtmp: .PHONY
@echo "--------------------------------------------------------------"
@echo ">>> Rebuilding the temporary build tree"
@echo "--------------------------------------------------------------"
-.if !defined(NO_CLEAN)
+.if ${MK_CLEAN} == "yes"
rm -rf ${WORLDTMP}
.else
# Note: for delete-old we need to set $PATH to also include the host $PATH
@@ -1038,7 +1042,7 @@ _worldtmp: .PHONY
.if ${USING_SYSTEM_LINKER} == "yes"
@rm -f ${WORLDTMP}/usr/bin/ld ${WORLDTMP}/usr/bin/ld.lld
.endif # ${USING_SYSTEM_LINKER} == "yes"
-.endif # !defined(NO_CLEAN)
+.endif # ${MK_CLEAN} == "yes"
@mkdir -p ${WORLDTMP}
@touch ${WORLDTMP}/${.TARGET}
# We can't use mtree to create the worldtmp directories since it may not be
@@ -1077,7 +1081,7 @@ _bootstrap-tools:
${WORLDTMP_MTREE} -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null
.endfor
_cleanobj:
-.if !defined(NO_CLEAN)
+.if ${MK_CLEAN} == "yes"
@echo
@echo "--------------------------------------------------------------"
@echo ">>> stage 2.1: cleaning up the object tree"
@@ -1090,7 +1094,7 @@ _cleanobj:
.endif
.else
${_+_}cd ${.CURDIR}; ${WMAKE} _NO_INCLUDE_COMPILERMK=t _cleanobj_fast_depend_hack
-.endif # !defined(NO_CLEAN)
+.endif # ${MK_CLEAN} == "yes"
_obj:
@echo
@echo "--------------------------------------------------------------"
@@ -1672,7 +1676,7 @@ buildkernel: .MAKE .PHONY
-I '${KERNCONFDIR}' -I '${KRNLCONFDIR}' \
'${KERNCONFDIR}/${_kernel}'
.endif
-.if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN)
+.if ${MK_CLEAN} == "yes" && !defined(NO_KERNELCLEAN)
@echo
@echo "--------------------------------------------------------------"
@echo ">>> stage 2.1: cleaning up the object tree"
@@ -2478,7 +2482,7 @@ _jevents=lib/libpmc/pmu-events
# kernel-toolchain skips _cleanobj, so handle cleaning up previous
# build-tools directories if needed.
-.if !defined(NO_CLEAN) && make(kernel-toolchain)
+.if ${MK_CLEAN} == "yes" && make(kernel-toolchain)
_bt_clean= ${CLEANDIR}
.endif