svn commit: r256406 - projects/bmake/share/mk
Simon J. Gerraty
sjg at FreeBSD.org
Sat Oct 12 23:42:55 UTC 2013
Author: sjg
Date: Sat Oct 12 23:42:55 2013
New Revision: 256406
URL: http://svnweb.freebsd.org/changeset/base/256406
Log:
Some re-org and cleanup.
Make it easier to subst some dirs in dirdeps with variables.
Tweak M_dep_qual_fixes esp. for pseudo machines like "host"
so that it can DTRT against _machines (in dirdeps.mk).
Modified:
projects/bmake/share/mk/local.dirdeps.mk
Modified: projects/bmake/share/mk/local.dirdeps.mk
==============================================================================
--- projects/bmake/share/mk/local.dirdeps.mk Sat Oct 12 23:40:17 2013 (r256405)
+++ projects/bmake/share/mk/local.dirdeps.mk Sat Oct 12 23:42:55 2013 (r256406)
@@ -1,3 +1,35 @@
+.if !target(_DIRDEP_USE)
+# we are the 1st makefile
+
+# DEP_MACHINE is set before we get here, this may not be.
+DEP_RELDIR ?= ${RELDIR}
+
+.if ${.TARGETS:Uall:M*/*} && empty(DIRDEPS)
+# This little trick let's us do
+#
+# mk -f dirdeps.mk some/dir.i386,bsd
+#
+DIRDEPS := ${.TARGETS:M*/*}
+${.TARGETS:Nall}: all
+.endif
+
+# pseudo machines get no qualification
+.for m in host common
+M_dep_qual_fixes += C;($m),[^/.,]*$$;\1;
+.endfor
+
+#.info M_dep_qual_fixes=${M_dep_qual_fixes}
+# we want to supress these dependencies for host tools
+DIRDEPS_FILTER.host = \
+ Ninclude* \
+ Nlib/lib* \
+ Nlib/csu* \
+ Nlib/[mn]* \
+ Ngnu/lib/csu* \
+ Ngnu/lib/lib[a-r]* \
+
+
+.endif
.if ${DEP_MACHINE} != "host"
@@ -6,6 +38,13 @@
DIRDEPS += gnu/lib/libssp/libssp_nonshared
.endif
+# some optional things
+.if !defined(WITHOUT_CTF) && ${DEP_RELDIR:U${RELDIR}:Mcddl/usr.bin/ctf*} == ""
+DIRDEPS += \
+ cddl/usr.bin/ctfconvert.host \
+ cddl/usr.bin/ctfmerge.host
+.endif
+
.endif
# we need pkgs/pseudo/stage to prep the stage tree
@@ -13,19 +52,9 @@ DIRDEPS += gnu/lib/libssp/libssp_nonshar
DIRDEPS += pkgs/pseudo/stage
.endif
-M_dep_qual_fixes += C;\.host,[^/.,]*$$;.host;
-M_dep_qual_fixes += C;\.common,[^/.,]*$$;.common;
-
CSU_DIR.i386 = csu/i386-elf
+DEP_MACHINE_ARCH = ${MACHINE_ARCH.${DEP_MACHINE}}
CSU_DIR.${DEP_MACHINE_ARCH} ?= csu/${DEP_MACHINE_ARCH}
CSU_DIR := ${CSU_DIR.${DEP_MACHINE_ARCH}}
-
-# we want to supress these dependencies for host tools
-DIRDEPS_FILTER.host = \
- Ninclude* \
- Nlib/lib* \
- Nlib/csu* \
- Nlib/[mn]* \
- Ngnu/lib/csu* \
- Ngnu/lib/lib[a-r]* \
-
+BOOT_MACHINE_DIR:= ${BOOT_MACHINE_DIR.${DEP_MACHINE}}
+KERNEL_NAME:= ${KERNEL_NAME.${DEP_MACHINE}}
More information about the svn-src-projects
mailing list