path: root/Makefile
diff options
authorWarner Losh <imp@FreeBSD.org>2011-01-03 22:48:01 +0000
committerWarner Losh <imp@FreeBSD.org>2011-01-03 22:48:01 +0000
commit92f64fb9e4813c910391a746a78c6f2ed7e9a2a2 (patch)
tree55fbf2d44cf9f4ead65eb6a7e2b6aacf28a23732 /Makefile
parentcefb678553cb4c193bb09b0944414a1bc87052ba (diff)
When TARGET_ARCH_${kernel} gets set, it is using the host's config,
not the one we build as part of make world. This means that make universe will fail if building on a too-old current or any stable system prior to a few days ago in weird ways (parse errors from shell). This copes with these old systems in two ways: (1) Works around the WARNING: issue by filtering all warnings that sneak onto stdout. (2) if TARGET_ARCH_${kernel} winds up being empty, then we error out immediately with a semi-useful error message. This usually comes from config not groking -m. Ideally, we'd use a buildworld's config here, but that's tricky, so I'll leave that detail to others to fix (it has to be done post make world for the arch rather than at the top level makefile). This should make 'make universe' usable from recent 8-stable systems (recent == last few months or so) for building -current. They have -m, but spewed warnings out stdout. Older systems will now at least get a firm error early rather than a confusing error late.
Notes: svn path=/head/; revision=216934
Diffstat (limited to 'Makefile')
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 915604db1d23..af1ae60d9986 100644
--- a/Makefile
+++ b/Makefile
@@ -351,7 +351,10 @@ universe_kernconfs:
.for kernel in ${KERNCONFS}
TARGET_ARCH_${kernel}!= cd ${.CURDIR}/sys/${TARGET}/conf && \
config -m ${.CURDIR}/sys/${TARGET}/conf/${kernel} 2> /dev/null | \
- cut -f 2
+ grep -v WARNING: | cut -f 2
+.if empty(TARGET_ARCH_${kernel})
+.error "Target architecture for ${TARGET}/conf/${kernel} unknown. config(8) likely too old."
universe_kernconfs: universe_kernconf_${TARGET}_${kernel}
@(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \