summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authormrg <mrg@NetBSD.org>2009-12-13 09:25:57 +0000
committermrg <mrg@NetBSD.org>2009-12-13 09:25:57 +0000
commit9f8de6e95c8c47e8662cd4beed98238ac4e57272 (patch)
tree9631a7cb8f79fe547c7b59583f9ef08548003c06 /compat
parentbcd8d648d5acd0d229d1799bc3deec2be83dc1d4 (diff)
a hack to force the top-level compat objdir to be created before the
library ones are. the Makefile has a long description of what's really going on here.
Diffstat (limited to 'compat')
-rw-r--r--compat/dirshack/Makefile30
1 files changed, 30 insertions, 0 deletions
diff --git a/compat/dirshack/Makefile b/compat/dirshack/Makefile
new file mode 100644
index 00000000000..daf8d896135
--- /dev/null
+++ b/compat/dirshack/Makefile
@@ -0,0 +1,30 @@
+# $NetBSD: Makefile,v 1.1 2009/12/13 09:25:57 mrg Exp $
+
+# hacky method to get compat multilib base objdirs created before
+# make tries to go create the subdirs used for builds.
+
+# the problem is that make handles objdir creation for subdirs before it
+# handles this current directory, so when make cd's into $arch/$libtype
+# and from there into the ../../lib dirs, it ends up setting the forced
+# MAKEOBJDIRPREFIX to something based upon ${.CURDIR}, since the objdir
+# doesn't exist yet.
+#
+# our solution is simple - from this Makefile we traverse the same list
+# of $arch/$libtype's with "BOOTSTRAP_SUBDIR=". then the compat/Makefile
+# handles these subdirs as normal, with the base objdir created.
+
+.include <bsd.own.mk>
+
+.if ${MKCOMPAT} != "no"
+.if make(obj)
+
+.include "../archdirs.mk"
+
+MAKEDIRTARGETENV= BOOTSTRAP_SUBDIRS=
+
+SUBDIR= ${ARCHDIR_SUBDIR:C/^/..\//}
+
+.endif # make(obj)
+.endif # MKCOMPAT != no
+
+.include <bsd.subdir.mk>