Skip to content

Commit

Permalink
Replace legacy make with bmake
Browse files Browse the repository at this point in the history
The proper way to detect which make is building the makefile is to check
for .PARSEDIR.  If present, bmake is processing the makefile.  For the
time being, both make will be supported for bootstrapping purposes, but
in time the check can be removed, say for the DragonFly 3.6 release.

The abundance of .ORDER commands in bsd.dep.mk caused a breakage when
building world in parallel with bmake.  Likely some order constraints
were impossible to achieve, and bmake just stopped while legacy did the
best it could.  In any case, the majority of the .ORDER commands were
replaced by a single .ORDER command which solved the problem.

The legacy make is disconnected in this commit set, but the source files
will be removed soon.
  • Loading branch information
jrmarino committed Oct 28, 2012
1 parent b3badcb commit 3da8e88
Show file tree
Hide file tree
Showing 13 changed files with 140 additions and 49 deletions.
6 changes: 6 additions & 0 deletions Makefile
Expand Up @@ -154,9 +154,15 @@ kernel: buildkernel installkernel
test: test:
.if defined(notdef) .if defined(notdef)
.undef notdef .undef notdef
.if defined(.PARSEDIR)
.if defined(notdef) && ${notdef:tu}
.endif
.else
# LEGACY MAKE - REMOVE FOR DFLY 3.6
.if defined(notdef) && ${notdef:U} .if defined(notdef) && ${notdef:U}
.endif .endif
.endif .endif
.endif


# #
# Upgrade the installed make to the current version using the installed # Upgrade the installed make to the current version using the installed
Expand Down
81 changes: 54 additions & 27 deletions Makefile.inc1
Expand Up @@ -126,8 +126,13 @@ WORLD_BINUTILSVER?= binutils222
# temporary until everybody has converted to x86_64 # temporary until everybody has converted to x86_64
.if ${MACHINE_ARCH} == "amd64" .if ${MACHINE_ARCH} == "amd64"
MACHINE_ARCH= x86_64 MACHINE_ARCH= x86_64
.if defined(.PARSEDIR)
.export MACHINE_ARCH
.else
# LEGACY MAKE - REMOVE FOR DFLY 3.6
.makeenv MACHINE_ARCH .makeenv MACHINE_ARCH
.endif .endif
.endif


TARGET_ARCH?= ${MACHINE_ARCH} TARGET_ARCH?= ${MACHINE_ARCH}
.if ${TARGET_ARCH} == ${MACHINE_ARCH} .if ${TARGET_ARCH} == ${MACHINE_ARCH}
Expand Down Expand Up @@ -211,6 +216,11 @@ STRICTTMPPATH= ${CTOOLSDEST}/usr/sbin:${CTOOLSDEST}/usr/bin:${CTOOLSDEST}/bin:${
TMPDIR?= /tmp TMPDIR?= /tmp
TMPPID!= echo $$$$ TMPPID!= echo $$$$


# Only use the host system make to bootstrap tools, including make itself
# Use the bootstrap make for the rest of the world
BTOOLMAKE= ${BTOOLSDEST}/usr/bin/make
BTOOLCONFIG= ${BTOOLSDEST}/usr/sbin/config

# #
# Building a world goes through the following stages # Building a world goes through the following stages
# #
Expand Down Expand Up @@ -296,13 +306,13 @@ WMAKEENV= ${CROSSENV} \
INSTALL="sh ${.CURDIR}/tools/install.sh" \ INSTALL="sh ${.CURDIR}/tools/install.sh" \
PATH=${STRICTTMPPATH} PATH=${STRICTTMPPATH}


WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 WMAKE= ${WMAKEENV} ${BTOOLMAKE} -f Makefile.inc1


# install stage # install stage
# #
IMAKEENV= ${CROSSENV} \ IMAKEENV= ${CROSSENV} \
PATH=${STRICTTMPPATH} PATH=${STRICTTMPPATH}
IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 IMAKE= ${IMAKEENV} ${BTOOLMAKE} -f Makefile.inc1


# kernel stage # kernel stage
# #
Expand Down Expand Up @@ -435,14 +445,14 @@ crossworld: _worldtmp _bootstrap-tools _obj _build-tools _cross-tools
# #
installcheck: installcheck:
.if !defined(NO_SENDMAIL) .if !defined(NO_SENDMAIL)
@pw usershow smmsp || (echo "You may need to run 'make preupgrade' first"; exit 1) @pw usershow smmsp || (echo "You may need to run 'make preupgrade' first"; /usr/bin/false)
@pw groupshow smmsp || (echo "You may need to run 'make preupgrade' first"; exit 1) @pw groupshow smmsp || (echo "You may need to run 'make preupgrade' first"; /usr/bin/false)
.endif .endif
@pw usershow _pflogd || (echo "You may need to run 'make preupgrade' first"; exit 1) @pw usershow _pflogd || (echo "You may need to run 'make preupgrade' first"; /usr/bin/false)
@pw groupshow authpf || (echo "You may need to run 'make preupgrade' first"; exit 1) @pw groupshow authpf || (echo "You may need to run 'make preupgrade' first"; /usr/bin/false)
@pw groupshow _pflogd || (echo "You may need to run 'make preupgrade' first"; exit 1) @pw groupshow _pflogd || (echo "You may need to run 'make preupgrade' first"; /usr/bin/false)
.if !defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/" .if !defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/"
@case `uname -r` in 1.2*|1.3-*|1.3.*|1.4.*|1.5.0-*|1.5.1-*|1.5.2-*|1.5.3-*) echo "You must upgrade your kernel to at least 1.5.4 and reboot before you can safely installworld, due to libc/system call ABI changes" ; exit 1;; esac @case `uname -r` in 1.2*|1.3-*|1.3.*|1.4.*|1.5.0-*|1.5.1-*|1.5.2-*|1.5.3-*) echo "You must upgrade your kernel to at least 1.5.4 and reboot before you can safely installworld, due to libc/system call ABI changes" ; /usr/bin/false ; esac
.endif .endif
# #
# installworld # installworld
Expand Down Expand Up @@ -539,7 +549,7 @@ bk_tools:
echo "You must buildworld before buildkernel. If you wish"; \ echo "You must buildworld before buildkernel. If you wish"; \
echo "to build a kernel using native tools, config it manually"; \ echo "to build a kernel using native tools, config it manually"; \
echo "or use the nativekernel target if you are in a rush"; \ echo "or use the nativekernel target if you are in a rush"; \
exit 1; \ /usr/bin/false; \
fi fi


maybe_bk_tools: maybe_bk_tools:
Expand All @@ -548,7 +558,7 @@ maybe_bk_tools:
if [ ! -f ${WORLDDEST}/.libraries_done ]; then \ if [ ! -f ${WORLDDEST}/.libraries_done ]; then \
echo "The kernel was build using buildworld tools which no" ; \ echo "The kernel was build using buildworld tools which no" ; \
echo "longer appear to exist, quickkernel failed!" ; \ echo "longer appear to exist, quickkernel failed!" ; \
exit 1; \ /usr/bin/false; \
fi; \ fi; \
fi fi
.endfor .endfor
Expand Down Expand Up @@ -590,7 +600,7 @@ buildkernel: bk_tools bk_build_list bk_kernwarn
.if !defined(NO_KERNELCONFIG) .if !defined(NO_KERNELCONFIG)
cd ${KRNLCONFDIR}; \ cd ${KRNLCONFDIR}; \
PATH=${STRICTTMPPATH} \ PATH=${STRICTTMPPATH} \
config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \ ${BTOOLCONFIG} ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
${KERNCONFDIR}/${_kernel} ${KERNCONFDIR}/${_kernel}
.endif .endif
.if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN) && defined(KERNEL_VERSION_${_kernel}) .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN) && defined(KERNEL_VERSION_${_kernel})
Expand All @@ -599,10 +609,10 @@ buildkernel: bk_tools bk_build_list bk_kernwarn
touch ${KRNLOBJDIR}/${_kernel}/.buildkernel_run touch ${KRNLOBJDIR}/${_kernel}/.buildkernel_run
.if !defined(NO_KERNELDEPEND) .if !defined(NO_KERNELDEPEND)
cd ${KRNLOBJDIR}/${_kernel}; \ cd ${KRNLOBJDIR}/${_kernel}; \
${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend ${KMAKEENV} ${BTOOLMAKE} KERNEL=${INSTKERNNAME} depend
.endif .endif
cd ${KRNLOBJDIR}/${_kernel}; \ cd ${KRNLOBJDIR}/${_kernel}; \
${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all ${KMAKEENV} ${BTOOLMAKE} KERNEL=${INSTKERNNAME} all
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`" @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
Expand Down Expand Up @@ -666,11 +676,11 @@ quickkernel: maybe_bk_tools bk_build_list bk_kernwarn
.if !defined(NO_KERNELCONFIG) .if !defined(NO_KERNELCONFIG)
cd ${KRNLCONFDIR}; \ cd ${KRNLCONFDIR}; \
PATH=${STRICTTMPPATH} \ PATH=${STRICTTMPPATH} \
config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \ ${BTOOLCONFIG} ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
${KERNCONFDIR}/${_kernel} ${KERNCONFDIR}/${_kernel}
.endif .endif
cd ${KRNLOBJDIR}/${_kernel}; \ cd ${KRNLOBJDIR}/${_kernel}; \
${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all ${KMAKEENV} ${BTOOLMAKE} KERNEL=${INSTKERNNAME} all
.else .else
.if !defined(NO_KERNELCONFIG) .if !defined(NO_KERNELCONFIG)
cd ${KRNLCONFDIR}; \ cd ${KRNLCONFDIR}; \
Expand All @@ -696,7 +706,7 @@ installkernel reinstallkernel:
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
.if exists(${KRNLOBJDIR}/${INSTALLKERNEL}/.buildkernel_run) .if exists(${KRNLOBJDIR}/${INSTALLKERNEL}/.buildkernel_run)
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
${IMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//} ${IMAKEENV} ${BTOOLMAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
.else .else
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//} ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
Expand Down Expand Up @@ -762,7 +772,7 @@ BSTRAPDIRS= ${_strfile} \
bin/test bin/cat bin/ln bin/mv bin/csh bin/expr bin/sh \ bin/test bin/cat bin/ln bin/mv bin/csh bin/expr bin/sh \
bin/hostname bin/kill \ bin/hostname bin/kill \
usr.bin/yacc usr.bin/colldef usr.bin/uudecode usr.bin/xinstall \ usr.bin/yacc usr.bin/colldef usr.bin/uudecode usr.bin/xinstall \
usr.bin/m4 usr.bin/rpcgen usr.bin/make usr.bin/awk usr.bin/stat \ usr.bin/m4 usr.bin/rpcgen usr.bin/bmake usr.bin/awk usr.bin/stat \
usr.bin/find usr.bin/lex usr.bin/sed usr.bin/uname usr.bin/touch \ usr.bin/find usr.bin/lex usr.bin/sed usr.bin/uname usr.bin/touch \
usr.bin/mkdep usr.bin/mktemp usr.bin/lorder usr.bin/file2c \ usr.bin/mkdep usr.bin/mktemp usr.bin/lorder usr.bin/file2c \
usr.bin/tsort usr.bin/tr usr.bin/join usr.bin/wc usr.bin/basename \ usr.bin/tsort usr.bin/tr usr.bin/join usr.bin/wc usr.bin/basename \
Expand Down Expand Up @@ -880,15 +890,15 @@ libraries:
.if !defined(NO_GCC47) .if !defined(NO_GCC47)
cd ${.CURDIR}; \ cd ${.CURDIR}; \
HOST_CCVER=${HOST_CCVER} CCVER=gcc47 \ HOST_CCVER=${HOST_CCVER} CCVER=gcc47 \
${MAKE} -f Makefile.inc1 _startup_libs47; ${BTOOLMAKE} -f Makefile.inc1 _startup_libs47;
.endif .endif
cd ${.CURDIR}; \ cd ${.CURDIR}; \
HOST_CCVER=${HOST_CCVER} CCVER=gcc44 \ HOST_CCVER=${HOST_CCVER} CCVER=gcc44 \
${MAKE} -f Makefile.inc1 _startup_libs44; ${BTOOLMAKE} -f Makefile.inc1 _startup_libs44;
cd ${.CURDIR}; \ cd ${.CURDIR}; \
${MAKE} -f Makefile.inc1 _startup_libs; \ ${BTOOLMAKE} -f Makefile.inc1 _startup_libs; \
${MAKE} -f Makefile.inc1 _prebuild_libs; \ ${BTOOLMAKE} -f Makefile.inc1 _prebuild_libs; \
${MAKE} -f Makefile.inc1 _generic_libs; ${BTOOLMAKE} -f Makefile.inc1 _generic_libs;
touch ${WORLDDEST}/.libraries_done touch ${WORLDDEST}/.libraries_done


# These dependencies are not automatically generated: # These dependencies are not automatically generated:
Expand Down Expand Up @@ -976,7 +986,7 @@ ${entry}.${__target}__D: .PHONY
edir=${entry}; \ edir=${entry}; \
cd ${.CURDIR}/$${edir}; \ cd ${.CURDIR}/$${edir}; \
fi; \ fi; \
${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/ ${BTOOLMAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
.endfor .endfor
par-${__target}: ${SUBDIR:S/$/.${__target}__D/} par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
.ORDER: ${SUBDIR:S/$/.${__target}__D/} .ORDER: ${SUBDIR:S/$/.${__target}__D/}
Expand All @@ -987,27 +997,44 @@ par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
# world build environment. # world build environment.
# #
wmake: wmake:
@echo '${WMAKEENV} ${MAKE} -m ${.CURDIR}/share/mk ${WMAKE_ARGS}' @echo '${WMAKEENV} ${BTOOLMAKE} ${WMAKE_ARGS}'


wmakeenv: wmakeenv:
@echo '${WMAKEENV} /bin/sh' @echo '${WMAKEENV} /bin/sh'


bmake: bmake:
@echo '${BMAKEENV} ${MAKE} -m ${.CURDIR}/share/mk ${BMAKE_ARGS}' @echo '${BMAKEENV} ${BTOOLMAKE} ${BMAKE_ARGS}'


bmakeenv: bmakeenv:
@echo '${BMAKEENV} /bin/sh' @echo '${BMAKEENV} /bin/sh'


tmake: tmake:
@echo '${TMAKEENV} ${MAKE} -m ${.CURDIR}/share/mk ${TMAKE_ARGS}' @echo '${TMAKEENV} ${BTOOLMAKE} ${TMAKE_ARGS}'


tmakeenv: tmakeenv:
@echo '${TMAKEENV} /bin/sh' @echo '${TMAKEENV} /bin/sh'


xmake: xmake:
@echo '${XMAKEENV} ${MAKE} -m ${.CURDIR}/share/mk ${XMAKE_ARGS}' @echo '${XMAKEENV} ${BTOOLMAKE} ${XMAKE_ARGS}'


xmakeenv: xmakeenv:
@echo '${XMAKEENV} /bin/sh' @echo '${XMAKEENV} /bin/sh'


# Take advantage of bmake error response
#
MAKE_PRINT_VAR_ON_ERROR= \
.CURDIR \
.OBJDIR \
.MAKE \
MAKE_VERSION \
LD_LIBRARY_PATH \
MACHINE_ARCH \
MACHINE \
MAKEFILE \
.TARGETS \
.ERROR_TARGET \
.ERROR_META_FILE \
.MAKE.LEVEL \
.MAKE.MODE

.include <bsd.subdir.mk> .include <bsd.subdir.mk>
7 changes: 5 additions & 2 deletions lib/i18n_module/Makefile.inc
@@ -1,13 +1,16 @@
# $DragonFly: src/lib/i18n_module/Makefile.inc,v 1.3 2008/04/10 10:21:00 hasso Exp $

NOPROFILE= 1 NOPROFILE= 1
.include "../Makefile.shlib" .include "../Makefile.shlib"


SHLIB_MAJOR= ${MODULE_SHLIB_MAJOR} SHLIB_MAJOR= ${MODULE_SHLIB_MAJOR}


BASENAME= ${.CURDIR:T} BASENAME= ${.CURDIR:T}
LIB= ${BASENAME} LIB= ${BASENAME}
.if defined(.PARSEDIR)
SRCS?= ${SRCPRE:tl}${BASENAME:tl}.c
.else
# LEGACY MAKE - REMOVE FOR DFLY 3.6
SRCS?= ${SRCPRE:L}${BASENAME:L}.c SRCS?= ${SRCPRE:L}${BASENAME:L}.c
.endif


TARGET_LIBDIR= /usr/lib/i18n TARGET_LIBDIR= /usr/lib/i18n
TARGET_SHLIBDIR= /usr/lib/i18n TARGET_SHLIBDIR= /usr/lib/i18n
Expand Down
8 changes: 8 additions & 0 deletions lib/libc/citrus/Makefile.inc
Expand Up @@ -23,10 +23,18 @@ SRCS+= citrus_prop.c
.PATH: ${.CURDIR}/../libc/citrus/modules .PATH: ${.CURDIR}/../libc/citrus/modules
CFLAGS+=-I${.CURDIR}/../libc/citrus CFLAGS+=-I${.CURDIR}/../libc/citrus
CFLAGS+=-D_I18N_STATIC CFLAGS+=-D_I18N_STATIC
.if defined(.PARSEDIR)
.for var in ${STATIC_LOCALES}
SRCS+= citrus_${var:tl}.c
CFLAGS+=-D_I18N_STATIC_${var}
.endfor
.else
# LEGACY MAKE - REMOVE FOR DFLY 3.6
.for var in ${STATIC_LOCALES} .for var in ${STATIC_LOCALES}
SRCS+= citrus_${var:L}.c SRCS+= citrus_${var:L}.c
CFLAGS+=-D_I18N_STATIC_${var} CFLAGS+=-D_I18N_STATIC_${var}
.endfor .endfor
.endif
# iconv support # iconv support
SRCS+=citrus_iconv_std.c citrus_mapper_std.c citrus_mapper_none.c citrus_mapper_serial.c citrus_utf1632.c SRCS+=citrus_iconv_std.c citrus_mapper_std.c citrus_mapper_none.c citrus_mapper_serial.c citrus_utf1632.c
.endif # STATIC_LOCALES .endif # STATIC_LOCALES
9 changes: 7 additions & 2 deletions nrelease/Makefile
Expand Up @@ -24,8 +24,13 @@ MAKE_JOBS?= $$(sysctl -n hw.ncpu)
# temporary until everybody has converted to x86_64 # temporary until everybody has converted to x86_64
.if ${MACHINE_ARCH} == "amd64" .if ${MACHINE_ARCH} == "amd64"
MACHINE_ARCH= x86_64 MACHINE_ARCH= x86_64
.if defined(.PARSEDIR)
.export MACHINE_ARCH
.else
# LEGACY MAKE - REMOVE FOR DFLY 3.6
.makeenv MACHINE_ARCH .makeenv MACHINE_ARCH
.endif .endif
.endif


# XXX makeshift fix to build the right kernel for the (target) architecture # XXX makeshift fix to build the right kernel for the (target) architecture
# We should configure this in the platform files somehow # We should configure this in the platform files somehow
Expand Down Expand Up @@ -209,10 +214,10 @@ check:
@echo "in /usr if you are unfamiliar with pkgsrc." @echo "in /usr if you are unfamiliar with pkgsrc."
.endif .endif
.if !exists (${PKGBIN_MKISOFS}) .if !exists (${PKGBIN_MKISOFS})
@exit 1 @/usr/bin/false
.endif .endif
.if !defined(PKGSRC_PATH) .if !defined(PKGSRC_PATH)
@exit 1 @/usr/bin/false
.endif .endif


buildworld1 buildworld2: buildworld1 buildworld2:
Expand Down
6 changes: 6 additions & 0 deletions share/mk/bsd.cpu.mk
Expand Up @@ -52,8 +52,14 @@ CPUTYPE= ${FORCE_CPUTYPE}
# cross compiling from 4.x or older versions of DFly and should not be set # cross compiling from 4.x or older versions of DFly and should not be set
# by the user. # by the user.
# #
.if defined(.PARSEDIR)
.export CCVER
.export HOST_CCVER
.else
# LEGACY MAKE - REMOVE FOR DFLY 3.6
.makeenv CCVER .makeenv CCVER
.makeenv HOST_CCVER .makeenv HOST_CCVER
.endif


# We can reassign _CPUCFLAGS and CFLAGS will evaluate properly to the # We can reassign _CPUCFLAGS and CFLAGS will evaluate properly to the
# new value, we do not have to add the variable to CFLAGS twice. # new value, we do not have to add the variable to CFLAGS twice.
Expand Down
22 changes: 8 additions & 14 deletions share/mk/bsd.dep.mk
Expand Up @@ -87,8 +87,8 @@ ${_YC} y.tab.h: ${_YSRC}
CLEANFILES+= y.tab.c y.tab.h CLEANFILES+= y.tab.c y.tab.h
.elif !empty(YFLAGS:M-d) .elif !empty(YFLAGS:M-d)
.for _YH in ${_YC:S/.c/.h/} .for _YH in ${_YC:S/.c/.h/}
.ORDER: ${_YC} ${_YH} ${_YH}: ${_YC}
${_YC} ${_YH}: ${_YSRC} ${_YC}: ${_YSRC}
${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC}
SRCS+= ${_YH} SRCS+= ${_YH}
CLEANFILES+= ${_YH} CLEANFILES+= ${_YH}
Expand All @@ -105,6 +105,9 @@ ${_YC}: ${_YSRC}
.if defined(SRCS) .if defined(SRCS)
depend: beforedepend _dependincs ${DEPENDFILE} afterdepend depend: beforedepend _dependincs ${DEPENDFILE} afterdepend


# Tell bmake not to look for generated files via .PATH
.NOPATH: ${DEPENDFILE}

# Different types of sources are compiled with slightly different flags. # Different types of sources are compiled with slightly different flags.
# Split up the sources, and filter out headers and non-applicable flags. # Split up the sources, and filter out headers and non-applicable flags.
# Separate flag groups out of the sources and treat them differently. # Separate flag groups out of the sources and treat them differently.
Expand All @@ -118,7 +121,6 @@ __FLAGS_FILES:= ${__FLAGS_FILES:N${_FFILE}}
.endfor .endfor


_DEPENDFILES= ${FLAGS_GROUPS:S/^/.depend_/g} _DEPENDFILES= ${FLAGS_GROUPS:S/^/.depend_/g}
.ORDER: ${_DEPENDFILES}


${DEPENDFILE}: ${_DEPENDFILES} ${DEPENDFILE}: ${_DEPENDFILES}


Expand Down Expand Up @@ -174,15 +176,11 @@ _EXTRADEPEND: .USE
${DEPENDFILE}: _EXTRADEPEND ${DEPENDFILE}: _EXTRADEPEND
.endif .endif


.ORDER: ${_DEPENDFILES} ${DEPENDFILE} afterdepend
.else .else
depend: beforedepend _dependincs afterdepend depend: beforedepend _dependincs afterdepend
.endif .endif
.if !target(beforedepend) .if !target(beforedepend)
beforedepend: beforedepend:
.else
.ORDER: beforedepend ${_DEPENDFILES} ${DEPENDFILE}
.ORDER: beforedepend afterdepend
.endif .endif
.if !target(afterdepend) .if !target(afterdepend)
afterdepend: afterdepend:
Expand Down Expand Up @@ -226,13 +224,9 @@ checkdpadd:
.endif .endif


.if defined(INCS) && make(depend) .if defined(INCS) && make(depend)

_dependincs: buildincludes .WAIT installincludes
_dependincs: ${INCS} ${SRCS}

.ORDER: _dependincs depend

.else .else

_dependincs: _dependincs:

.endif .endif

.ORDER: beforedepend _dependincs ${DEPENDFILE} afterdepend
8 changes: 7 additions & 1 deletion share/mk/bsd.obj.mk
@@ -1,5 +1,4 @@
# $FreeBSD: src/share/mk/bsd.obj.mk,v 1.30.2.10 2003/02/15 05:36:25 kris Exp $ # $FreeBSD: src/share/mk/bsd.obj.mk,v 1.30.2.10 2003/02/15 05:36:25 kris Exp $
# $DragonFly: src/share/mk/bsd.obj.mk,v 1.5 2005/10/08 11:31:29 corecode Exp $
# #
# The include file <bsd.obj.mk> handles creating the 'obj' directory # The include file <bsd.obj.mk> handles creating the 'obj' directory
# and cleaning up object files, etc. # and cleaning up object files, etc.
Expand Down Expand Up @@ -45,6 +44,8 @@ __<bsd.obj.mk>__:


.if defined(MAKEOBJDIRPREFIX) .if defined(MAKEOBJDIRPREFIX)
CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR}
.elif defined(MAKEOBJDIR) && ${MAKEOBJDIR:M/*} != ""
CANONICALOBJDIR:=${MAKEOBJDIR}
.else .else
CANONICALOBJDIR:=/usr/obj${.CURDIR} CANONICALOBJDIR:=/usr/obj${.CURDIR}
.endif .endif
Expand Down Expand Up @@ -120,6 +121,11 @@ cleanobj:
rm -f ${.CURDIR}/obj; \ rm -f ${.CURDIR}/obj; \
fi fi


# Tell bmake not to look for generated files via .PATH
.if !empty(CLEANFILES)
.NOPATH: ${CLEANFILES}
.endif

.if !target(clean) .if !target(clean)
clean: clean:
.if defined(CLEANFILES) && !empty(CLEANFILES) .if defined(CLEANFILES) && !empty(CLEANFILES)
Expand Down

0 comments on commit 3da8e88

Please sign in to comment.