From 645eff3a855254a1fd4271016d679ddf41bda9b5 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Fri, 14 Oct 2016 18:43:03 +0000 Subject: Kernel builds now happen in compile/CONFIG/obj@ -> /usr/obj/... [or ./obj/, if srctree is not rooted at /usr/src]. As a result, stock GENERIC & RAMDISK kernels are commited to the tree, to ensure the src tree can be "readonly" during builds, with all writes occuring inside the obj space. config -b options are handled by ../Makefile.inc. The canonical new way to configure one of these kernels is: % cd /sys/arch/amd64/compile/GENERIC.MP % doas make obj % make config % make % doas cp obj/bsd /bsd The build infrastructure will use this new mechanism in a de-escalation way using BUILDUSER. Much help from natano and tb. --- sys/arch/socppc/Makefile | 4 ++-- sys/arch/socppc/compile/.cvsignore | 2 -- sys/arch/socppc/compile/GENERIC/Makefile | 1 + sys/arch/socppc/compile/Makefile | 8 ++++++++ sys/arch/socppc/compile/Makefile.inc | 19 +++++++++++++++++++ sys/arch/socppc/compile/RAMDISK/Makefile | 1 + sys/arch/socppc/conf/Makefile.socppc | 6 ++++-- 7 files changed, 35 insertions(+), 6 deletions(-) delete mode 100644 sys/arch/socppc/compile/.cvsignore create mode 100644 sys/arch/socppc/compile/GENERIC/Makefile create mode 100644 sys/arch/socppc/compile/Makefile create mode 100644 sys/arch/socppc/compile/Makefile.inc create mode 100644 sys/arch/socppc/compile/RAMDISK/Makefile (limited to 'sys/arch/socppc') diff --git a/sys/arch/socppc/Makefile b/sys/arch/socppc/Makefile index 2c51e8c73bd..9099e50b19e 100644 --- a/sys/arch/socppc/Makefile +++ b/sys/arch/socppc/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.9 2016/05/31 18:37:04 tedu Exp $ +# $OpenBSD: Makefile,v 1.10 2016/10/14 18:42:59 deraadt Exp $ S= ${.CURDIR}/../.. KFILE= GENERIC @@ -11,7 +11,7 @@ TAGS= ${.CURDIR}/tags NOPROG= NOMAN= NOOBJ= -SUBDIR= stand +SUBDIR= stand compile # config the fattest kernel we can find into a temporary dir # to create a Makefile. Then use make to pull some variables diff --git a/sys/arch/socppc/compile/.cvsignore b/sys/arch/socppc/compile/.cvsignore deleted file mode 100644 index b72af3039e6..00000000000 --- a/sys/arch/socppc/compile/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -GENERIC -RAMDISK diff --git a/sys/arch/socppc/compile/GENERIC/Makefile b/sys/arch/socppc/compile/GENERIC/Makefile new file mode 100644 index 00000000000..01b5f23410c --- /dev/null +++ b/sys/arch/socppc/compile/GENERIC/Makefile @@ -0,0 +1 @@ +.include "../Makefile.inc" diff --git a/sys/arch/socppc/compile/Makefile b/sys/arch/socppc/compile/Makefile new file mode 100644 index 00000000000..3b178449c83 --- /dev/null +++ b/sys/arch/socppc/compile/Makefile @@ -0,0 +1,8 @@ +# $OpenBSD: Makefile,v 1.1 2016/10/14 18:43:01 deraadt Exp $ + +.if make(obj) || make(clean) +SUBDIR!=find . -type d -maxdepth 1 \! \( -name . -o -name CVS \) +#SUBDIR=GENERIC RAMDISK +.endif + +.include diff --git a/sys/arch/socppc/compile/Makefile.inc b/sys/arch/socppc/compile/Makefile.inc new file mode 100644 index 00000000000..d79a8803ef2 --- /dev/null +++ b/sys/arch/socppc/compile/Makefile.inc @@ -0,0 +1,19 @@ +SYSDIR != cd ${.CURDIR}/../../../..; pwd +CONFDIR != cd ${.CURDIR}/../../conf; pwd + +.if ${.CURDIR} == ${.OBJDIR} +.PHONY: config +config: + @echo make obj required first >&2 + @false +.elif !exists(${OBJDIR}/Makefile) +.PHONY: config clean +config: + config -b ${.OBJDIR} -s ${SYSDIR} ${CONFDIR}/${.CURDIR:T} + +clean: + +.endif + +.include + diff --git a/sys/arch/socppc/compile/RAMDISK/Makefile b/sys/arch/socppc/compile/RAMDISK/Makefile new file mode 100644 index 00000000000..01b5f23410c --- /dev/null +++ b/sys/arch/socppc/compile/RAMDISK/Makefile @@ -0,0 +1 @@ +.include "../Makefile.inc" diff --git a/sys/arch/socppc/conf/Makefile.socppc b/sys/arch/socppc/conf/Makefile.socppc index da242edd028..8e6fca141fc 100644 --- a/sys/arch/socppc/conf/Makefile.socppc +++ b/sys/arch/socppc/conf/Makefile.socppc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.socppc,v 1.44 2016/09/24 19:13:03 kettenis Exp $ +# $OpenBSD: Makefile.socppc,v 1.45 2016/10/14 18:43:02 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -21,7 +21,7 @@ S!= cd ../../../..; pwd _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} -INCLUDES= -nostdinc -I$S -I. -I$S/arch +INCLUDES= -nostdinc -I$S -I${.OBJDIR} -I$S/arch CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wimplicit-function-declaration \ -Wno-main -Wno-uninitialized -Wno-pointer-sign \ @@ -125,6 +125,8 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +obj: + depend: @touch $@ -- cgit v1.2.3