head	1.23;
access;
symbols
	netbsd-11-0-RC3:1.23
	netbsd-11-0-RC2:1.23
	netbsd-11-0-RC1:1.23
	perseant-exfatfs-base-20250801:1.23
	netbsd-11:1.23.0.4
	netbsd-11-base:1.23
	netbsd-10-1-RELEASE:1.22
	perseant-exfatfs-base-20240630:1.23
	perseant-exfatfs:1.23.0.2
	perseant-exfatfs-base:1.23
	netbsd-8-3-RELEASE:1.17.4.1
	netbsd-9-4-RELEASE:1.20.2.1
	netbsd-10-0-RELEASE:1.22
	netbsd-10-0-RC6:1.22
	netbsd-10-0-RC5:1.22
	netbsd-10-0-RC4:1.22
	netbsd-10-0-RC3:1.22
	netbsd-10-0-RC2:1.22
	netbsd-10-0-RC1:1.22
	netbsd-10:1.22.0.6
	netbsd-10-base:1.22
	netbsd-9-3-RELEASE:1.20.2.1
	cjep_sun2x-base1:1.22
	cjep_sun2x:1.22.0.4
	cjep_sun2x-base:1.22
	cjep_staticlib_x-base1:1.22
	netbsd-9-2-RELEASE:1.20.2.1
	cjep_staticlib_x:1.22.0.2
	cjep_staticlib_x-base:1.22
	netbsd-9-1-RELEASE:1.20.2.1
	phil-wifi-20200421:1.21
	phil-wifi-20200411:1.21
	is-mlppp:1.21.0.2
	is-mlppp-base:1.21
	phil-wifi-20200406:1.21
	netbsd-8-2-RELEASE:1.17.4.1
	netbsd-9-0-RELEASE:1.20.2.1
	netbsd-9-0-RC2:1.20.2.1
	netbsd-9-0-RC1:1.20.2.1
	phil-wifi-20191119:1.20
	netbsd-9:1.20.0.2
	netbsd-9-base:1.20
	phil-wifi-20190609:1.20
	netbsd-8-1-RELEASE:1.17.4.1
	netbsd-8-1-RC1:1.17.4.1
	pgoyette-compat-merge-20190127:1.17.10.1
	pgoyette-compat-20190127:1.20
	pgoyette-compat-20190118:1.20
	pgoyette-compat-1226:1.20
	pgoyette-compat-1126:1.20
	pgoyette-compat-1020:1.20
	pgoyette-compat-0930:1.20
	pgoyette-compat-0906:1.20
	netbsd-7-2-RELEASE:1.12
	pgoyette-compat-0728:1.20
	netbsd-8-0-RELEASE:1.17.4.1
	phil-wifi:1.17.0.12
	phil-wifi-base:1.17
	pgoyette-compat-0625:1.17
	netbsd-8-0-RC2:1.17
	pgoyette-compat-0521:1.17
	pgoyette-compat-0502:1.17
	pgoyette-compat-0422:1.17
	netbsd-8-0-RC1:1.17
	pgoyette-compat-0415:1.17
	pgoyette-compat-0407:1.17
	pgoyette-compat-0330:1.17
	pgoyette-compat-0322:1.17
	pgoyette-compat-0315:1.17
	netbsd-7-1-2-RELEASE:1.12
	pgoyette-compat:1.17.0.10
	pgoyette-compat-base:1.17
	netbsd-7-1-1-RELEASE:1.12
	matt-nb8-mediatek:1.17.0.8
	matt-nb8-mediatek-base:1.17
	perseant-stdc-iso10646:1.17.0.6
	perseant-stdc-iso10646-base:1.17
	netbsd-8:1.17.0.4
	netbsd-8-base:1.17
	prg-localcount2-base3:1.17
	prg-localcount2-base2:1.17
	prg-localcount2-base1:1.17
	prg-localcount2:1.17.0.2
	prg-localcount2-base:1.17
	pgoyette-localcount-20170426:1.17
	bouyer-socketcan-base1:1.17
	pgoyette-localcount-20170320:1.17
	netbsd-7-1:1.12.0.8
	netbsd-7-1-RELEASE:1.12
	netbsd-7-1-RC2:1.12
	netbsd-7-nhusb-base-20170116:1.12
	bouyer-socketcan:1.16.0.2
	bouyer-socketcan-base:1.16
	pgoyette-localcount-20170107:1.15
	netbsd-7-1-RC1:1.12
	pgoyette-localcount-20161104:1.13
	netbsd-7-0-2-RELEASE:1.12
	localcount-20160914:1.13
	netbsd-7-nhusb:1.12.0.6
	netbsd-7-nhusb-base:1.12
	pgoyette-localcount-20160806:1.13
	pgoyette-localcount-20160726:1.13
	pgoyette-localcount:1.13.0.2
	pgoyette-localcount-base:1.13
	netbsd-7-0-1-RELEASE:1.12
	netbsd-7-0:1.12.0.4
	netbsd-7-0-RELEASE:1.12
	netbsd-7-0-RC3:1.12
	netbsd-7-0-RC2:1.12
	netbsd-7-0-RC1:1.12
	netbsd-7:1.12.0.2
	netbsd-7-base:1.12
	yamt-pagecache-base9:1.11
	yamt-pagecache-tag8:1.1.2.2
	tls-earlyentropy:1.11.0.2
	tls-earlyentropy-base:1.12
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.11
	riastradh-drm2-base3:1.10
	riastradh-drm2-base2:1.2
	riastradh-drm2-base1:1.2
	riastradh-drm2:1.2.0.6
	riastradh-drm2-base:1.2
	khorben-n900:1.2.0.4
	agc-symver:1.2.0.2
	agc-symver-base:1.2
	tls-maxphys-base:1.12
	tls-maxphys:1.1.0.6
	yamt-pagecache-base8:1.1
	yamt-pagecache:1.1.0.2
	yamt-pagecache-base7:1.1;
locks; strict;
comment	@# @;


1.23
date	2023.06.11.10.43.51;	author lukem;	state Exp;
branches;
next	1.22;
commitid	dLx41wijlXPs9wsE;

1.22
date	2021.02.14.18.45.44;	author pgoyette;	state Exp;
branches;
next	1.21;
commitid	5ou67rawqSFC2IHC;

1.21
date	2019.11.22.13.30.19;	author martin;	state Exp;
branches;
next	1.20;
commitid	433baeuzPxm4LQLB;

1.20
date	2018.07.10.13.22.22;	author martin;	state Exp;
branches
	1.20.2.1;
next	1.19;
commitid	HjWDOArN7zTSMAJA;

1.19
date	2018.07.09.08.24.33;	author martin;	state Exp;
branches;
next	1.18;
commitid	3jg4YHwc5VuRarJA;

1.18
date	2018.07.05.15.52.27;	author martin;	state Exp;
branches;
next	1.17;
commitid	JyRi7FFBjiSqMXIA;

1.17
date	2017.01.24.17.54.52;	author christos;	state Exp;
branches
	1.17.4.1
	1.17.10.1
	1.17.12.1;
next	1.16;
commitid	Y7fTHsjgDpXIofDz;

1.16
date	2017.01.08.17.39.08;	author christos;	state Exp;
branches
	1.16.2.1;
next	1.15;
commitid	L7xSL2UtJqo8PbBz;

1.15
date	2016.12.25.16.44.39;	author christos;	state Exp;
branches;
next	1.14;
commitid	GmVE38RF7PWmYnzz;

1.14
date	2016.12.24.20.36.28;	author christos;	state Exp;
branches;
next	1.13;
commitid	nripvGRbCVNXhhzz;

1.13
date	2015.07.23.08.03.25;	author mrg;	state Exp;
branches
	1.13.2.1;
next	1.12;
commitid	nfGa2DVpEPUUPnuy;

1.12
date	2014.08.03.09.19.34;	author apb;	state Exp;
branches;
next	1.11;
commitid	Fkd0SP9bzxdECTKx;

1.11
date	2014.03.25.09.52.55;	author ozaki-r;	state Exp;
branches
	1.11.2.1;
next	1.10;
commitid	BC7cPubsAsmw04ux;

1.10
date	2014.01.26.17.33.53;	author apb;	state Exp;
branches;
next	1.9;
commitid	DMGRp3YM1m7MrEmx;

1.9
date	2014.01.26.16.53.00;	author apb;	state Exp;
branches;
next	1.8;
commitid	VS4zX7l5gwJrdEmx;

1.8
date	2014.01.16.01.15.33;	author christos;	state Exp;
branches;
next	1.7;
commitid	eohV5AOa1lR3mhlx;

1.7
date	2013.11.01.11.09.05;	author apb;	state Exp;
branches;
next	1.6;
commitid	SyAoKzXLlnRQ4zbx;

1.6
date	2013.11.01.10.00.51;	author martin;	state Exp;
branches;
next	1.5;
commitid	h9Itf2BALpiIHybx;

1.5
date	2013.11.01.06.22.24;	author apb;	state Exp;
branches;
next	1.4;
commitid	A3Op7z6TyHBQsxbx;

1.4
date	2013.10.30.15.15.12;	author apb;	state Exp;
branches;
next	1.3;
commitid	3rHIkQir8XICvkbx;

1.3
date	2013.10.18.11.42.59;	author njoly;	state Exp;
branches;
next	1.2;
commitid	3pmyWmFb3dBmIL9x;

1.2
date	2013.03.09.14.12.08;	author jmmv;	state Exp;
branches;
next	1.1;

1.1
date	2012.12.03.13.53.28;	author apb;	state Exp;
branches
	1.1.2.1
	1.1.6.1;
next	;

1.20.2.1
date	2019.11.22.15.26.28;	author bouyer;	state Exp;
branches;
next	;
commitid	FdDJi6CPxSbdpRLB;

1.17.4.1
date	2018.07.16.13.21.09;	author sborrill;	state Exp;
branches;
next	;
commitid	1H8CMcgfnyGAAmKA;

1.17.10.1
date	2018.07.28.04.33.02;	author pgoyette;	state Exp;
branches;
next	;
commitid	1UP1xAIUxv1ZgRLA;

1.17.12.1
date	2019.06.10.21.42.39;	author christos;	state Exp;
branches;
next	1.17.12.2;
commitid	jtc8rnCzWiEEHGqB;

1.17.12.2
date	2020.04.08.14.03.56;	author martin;	state Exp;
branches;
next	;
commitid	Qli2aW9E74UFuA3C;

1.16.2.1
date	2017.04.21.16.51.17;	author bouyer;	state Exp;
branches;
next	;
commitid	dUG7nkTKALCadqOz;

1.13.2.1
date	2017.01.07.08.53.45;	author pgoyette;	state Exp;
branches;
next	1.13.2.2;
commitid	uEL0C1YuiJrlV0Bz;

1.13.2.2
date	2017.03.20.06.52.12;	author pgoyette;	state Exp;
branches;
next	;
commitid	jjw7cAwgyKq7RfKz;

1.11.2.1
date	2014.08.10.07.03.06;	author tls;	state Exp;
branches;
next	;
commitid	AUhmcW8XWqOOEMLx;

1.1.2.1
date	2012.12.03.13.53.28;	author yamt;	state dead;
branches;
next	1.1.2.2;

1.1.2.2
date	2013.01.16.05.26.13;	author yamt;	state Exp;
branches;
next	1.1.2.3;

1.1.2.3
date	2014.05.22.11.27.18;	author yamt;	state Exp;
branches;
next	;
commitid	spVi6gj5ReXSGwBx;

1.1.6.1
date	2012.12.03.13.53.28;	author tls;	state dead;
branches;
next	1.1.6.2;

1.1.6.2
date	2013.02.25.00.24.49;	author tls;	state Exp;
branches;
next	1.1.6.3;

1.1.6.3
date	2013.06.23.06.26.21;	author tls;	state Exp;
branches;
next	1.1.6.4;
commitid	OnlO1cBgtQRcIHUw;

1.1.6.4
date	2014.08.19.23.45.49;	author tls;	state Exp;
branches;
next	;
commitid	jTnpym9Qu0o4R1Nx;


desc
@@


1.23
log
@more NBUILDJOBS deprecation

The NBUILDJOBS option was deprecated in 2002;
there's no need to keep warning about it,
remove from params / show-params,
and only document as obsolete.
@
text
@#	$NetBSD: Makefile.params,v 1.22 2021/02/14 18:45:44 pgoyette Exp $
#
# Makefile fragment for printing build parameters.
#
# Public variables:
#	RELEASEVARS
#		List of variables whose value should be printed.
#
#	PRINT_PARAMS
#		A command to print the desired variables and values
#		to stdout, without any additional debugging information.
#		Values are printed as single-quoted strings, with
#		embedded quotes and newlines escaped in a way that's
#		acceptable to sh(1).  Undefined values are printed
#		as "(undefined)" (without quotation marks).
#
# Internal targets:
# 	_params:
#		Prints the names and values of all the variables
#		listed in ${RELEASEVARS}.  The desired results may be
#		redirected somewhere other than stdout, for example by
#		setting _params_redirect='>&3'.	 stdout and stderr may
#		contain unwanted debugging information, from make and
#		the shell.
#
# Internal variables:
#	_params_redirect:
#		If set, this should be a shell redirection specification, such
#		as '>&3', controlling where the output from "make _params" will
#		be sent.
#
# Example:
#	. ${NETBSDSRCDIR}/etc/Makefile.params
#	show-params: .MAKE .PHONY # print params to stdout
#		@@${PRINT_PARAMS}
#

.include <bsd.own.mk>	# for some variables

RELEASEVARS=	DISTRIBVER EXTERNAL_TOOLCHAIN HAVE_GCC HAVE_GDB \
		HAVE_LLVM HAVE_PCC INSTALLWORLDDIR \
		MACHINE MACHINE_ARCH \
		NETBSD_OFFICIAL_RELEASE NOCLEANDIR NODISTRIBDIRS NOINCLUDES \
		TOOLCHAIN_MISSING \
		USE_HESIOD USE_INET6 USE_JEMALLOC USE_KERBEROS USE_LDAP \
		USE_PAM USE_SKEY USE_YP \
		USETOOLS

.if ${MKREPRO:Uno} != "yes"
RELEASEVARS+= 	BSDOBJDIR BSDSRCDIR BUILDID BUILDINFO BUILDSEED \
		DESTDIR KERNARCHDIR KERNCONFDIR KERNOBJDIR KERNSRCDIR MAKE \
		KERNEL_DIR MAKECONF MAKEFLAGS MAKEOBJDIR MAKEOBJDIRPREFIX \
		MAKEVERBOSE NETBSDSRCDIR OBJMACHINE OBJMACHINE_ARCH \
		RELEASEDIR RELEASEMACHINEDIR TOOLDIR USR_OBJMACHINE X11SRCDIR
.endif

RELEASEVARS+= ${_MKVARS.yes} ${_MKVARS.no}

#
# Duplicate the DISTRIBVER setting from src/etc/Makefile.
#
.ifndef DISTRIBVER
DISTRIBVER!=	${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh
.endif

#
# _params does the printing.
#
_params_redirect?= # empty

_params: .PHONY
.for var in ${RELEASEVARS:O}
.if defined(${var})
	@@printf "%20s = '%-s'\n" ${var} ${${var}:C/'/'\\\\''/gW:Q} \
	    ${_params_redirect}
.else
	@@printf "%20s = (undefined)\n" ${var} \
	    ${_params_redirect}
.endif
.endfor

# PRINT_PARAMS:
#
# The output from the "make _params" can include the following types of
# unwanted lines:
#
#     make -j prints "--- _params ---";
#
#     if MAKEVERBOSE is set to 3 or more then make prints each "printf"
#     command in addition to executing it;
#
#     if MAKEVERBOSE is set to 4 then the shell prints each command
#     (prefixed with "+").
#
# So the resulting output can look like this:
#
#	--- _params ---
#	+ echo 'printf "%20s = '\''%-s'\''\n" BSDOBJDIR /usr/obj'
#	printf "%20s = '%-s'\n" BSDOBJDIR /usr/obj
#	+ printf '%20s = '\''%-s'\''\n' BSDOBJDIR /usr/obj
#	           BSDOBJDIR = '/usr/obj'
#	+ echo 'printf "%20s = '\''%-s'\''\n" BSDSRCDIR /usr/src'
#	printf "%20s = '%-s'\n" BSDSRCDIR /usr/src
#	+ printf '%20s = '\''%-s'\''\n' BSDSRCDIR /usr/src
#	           BSDSRCDIR = '/usr/src'
#	[...]
#
# where what we want is just this:
#
#	           BSDOBJDIR = '/usr/obj'
#	           BSDSRCDIR = '/usr/src'
#	           [...]
#
# The shell redirections in ${PRINT_PARAMS} ensure that the unwanted
# noise is discarded (via ">/dev/null"), while the desired information
# ends up on the subshell's stdout (via ">&3" and "3>&1").  The value
# of _params_redirect is passed in the environment instead of on the
# command line, to prevent it from appearing in MAKEFLAGS (which would
# appear in the output).
#
PRINT_PARAMS:=	(_params_redirect='>&3' ${MAKE} -f ${.PARSEDIR:Q}/${.PARSEFILE:Q} _params 3>&1 >/dev/null)
@


1.22
log
@Add KERNEL_DIR to /etc/release

"Sure, why not" from xtos!
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.21 2019/11/22 13:30:19 martin Exp $
d53 1
a53 1
		MAKEVERBOSE NBUILDJOBS NETBSDSRCDIR OBJMACHINE OBJMACHINE_ARCH \
@


1.21
log
@Document NETBSD_OFFICIAL_RELEASE and add it to /etc/release - it is
important information when trying to reproduce a build.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.20 2018/07/10 13:22:22 martin Exp $
d52 2
a53 2
		MAKECONF MAKEFLAGS MAKEOBJDIR MAKEOBJDIRPREFIX MAKEVERBOSE \
		NBUILDJOBS NETBSDSRCDIR OBJMACHINE OBJMACHINE_ARCH \
@


1.20
log
@Drop output for MAKECONF MAKEOBJDIR MAKEOBJDIRPREFIX MAKEVERBOSE
in MKREPRO=yes builds.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.19 2018/07/09 08:24:33 martin Exp $
d43 1
a43 1
		NOCLEANDIR NODISTRIBDIRS NOINCLUDES \
@


1.20.2.1
log
@Pull up following revision(s) (requested by martin in ticket #462):
	share/mk/bsd.README: revision 1.397
	etc/Makefile.params: revision 1.21
Document NETBSD_OFFICIAL_RELEASE and add it to /etc/release - it is
important information when trying to reproduce a build.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.20 2018/07/10 13:22:22 martin Exp $
d43 1
a43 1
		NETBSD_OFFICIAL_RELEASE NOCLEANDIR NODISTRIBDIRS NOINCLUDES \
@


1.19
log
@Remove debug hack (revert previous)
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.17 2017/01/24 17:54:52 christos Exp $
d42 1
a42 2
		MACHINE MACHINE_ARCH MAKECONF \
		MAKEOBJDIR MAKEOBJDIRPREFIX MAKEVERBOSE \
d52 2
a53 1
		MAKEFLAGS NBUILDJOBS NETBSDSRCDIR OBJMACHINE OBJMACHINE_ARCH \
@


1.18
log
@Temporary hack to get MKREPRO debug info out of the build cluster. XXX revert!
@
text
@a54 3
.else
		# temporary debugging for MKREPRO builds
RELEASEVARS+=	BUILDSEED _CXXSEED __BUILDSEED
@


1.17
log
@MAKE varies between builds because it contains the full pathname.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.16 2017/01/08 17:39:08 christos Exp $
d55 3
@


1.17.12.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.20 2018/07/10 13:22:22 martin Exp $
d42 2
a43 1
		MACHINE MACHINE_ARCH \
d53 1
a53 2
		MAKECONF MAKEFLAGS MAKEOBJDIR MAKEOBJDIRPREFIX MAKEVERBOSE \
		NBUILDJOBS NETBSDSRCDIR OBJMACHINE OBJMACHINE_ARCH \
@


1.17.12.2
log
@Merge changes from current as of 20200406
@
text
@d1 1
a1 1
#	$NetBSD$
d43 1
a43 1
		NETBSD_OFFICIAL_RELEASE NOCLEANDIR NODISTRIBDIRS NOINCLUDES \
@


1.17.10.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.20 2018/07/10 13:22:22 martin Exp $
d42 2
a43 1
		MACHINE MACHINE_ARCH \
d53 1
a53 2
		MAKECONF MAKEFLAGS MAKEOBJDIR MAKEOBJDIRPREFIX MAKEVERBOSE \
		NBUILDJOBS NETBSDSRCDIR OBJMACHINE OBJMACHINE_ARCH \
@


1.17.4.1
log
@Pull up the following revisions(s) (requested by martin in ticket #923):
	etc/Makefile.params:	revision 1.20

Drop output for MAKECONF MAKEOBJDIR MAKEOBJDIRPREFIX MAKEVERBOSE
in MKREPRO=yes builds.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.17 2017/01/24 17:54:52 christos Exp $
d42 2
a43 1
		MACHINE MACHINE_ARCH \
d53 1
a53 2
		MAKECONF MAKEFLAGS MAKEOBJDIR MAKEOBJDIRPREFIX MAKEVERBOSE \
		NBUILDJOBS NETBSDSRCDIR OBJMACHINE OBJMACHINE_ARCH \
@


1.16
log
@Instead of hard-coding all the MK* vars and constantly being out of date,
use _MKVARS.yes and _MKVARS.no to construct them.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.15 2016/12/25 16:44:39 christos Exp $
d42 1
a42 1
		MACHINE MACHINE_ARCH MAKE MAKECONF \
d52 1
a52 1
		DESTDIR KERNARCHDIR KERNCONFDIR KERNOBJDIR KERNSRCDIR \
@


1.16.2.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.17 2017/01/24 17:54:52 christos Exp $
d42 1
a42 1
		MACHINE MACHINE_ARCH MAKECONF \
d52 1
a52 1
		DESTDIR KERNARCHDIR KERNCONFDIR KERNOBJDIR KERNSRCDIR MAKE \
@


1.15
log
@put also MAKEFILES in the MKREPRO section since they vary since they contain
paths.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.14 2016/12/24 20:36:28 christos Exp $
a43 11
		MKARZERO MKATF MKBFD MKBINUTILS MKCATPAGES \
		MKCRYPTO MKCRYPTO_RC5 MKCTF MKCVS \
		MKDEBUG MKDEBUGLIB MKDOC MKDTRACE MKDYNAMICROOT \
		MKGCC MKGCCCMDS MKGDB \
		MKHESIOD MKHTML MKIEEEFP MKINET6 MKINFO MKIPFILTER \
		MKKERBEROS MKKYUA MKLDAP MKLINKLIB MKLINT MKLLVM \
		MKMAN MKMANZ MKMDNS MKNLS MKNPF MKOBJ MKOBJDIRS \
		MKPAM MKPCC MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX \
		MKPROFILE MKREPRO \
		MKSHARE MKSKEY MKSOFTFLOAT MKSTATICLIB \
		MKUNPRIVED MKUPDATE MKX11 MKYP \
d57 1
@


1.14
log
@For MKREPRO, don't print varying params.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.13 2015/07/23 08:03:25 mrg Exp $
d42 1
a42 1
		MACHINE MACHINE_ARCH MAKE MAKECONF MAKEFLAGS \
d64 1
a64 1
		NBUILDJOBS NETBSDSRCDIR OBJMACHINE OBJMACHINE_ARCH \
@


1.13
log
@remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.12 2014/08/03 09:19:34 apb Exp $
d40 1
a40 2
RELEASEVARS=	BSDOBJDIR BSDSRCDIR BUILDID BUILDINFO BUILDSEED \
		DESTDIR DISTRIBVER EXTERNAL_TOOLCHAIN HAVE_GCC HAVE_GDB \
a41 1
		KERNARCHDIR KERNCONFDIR KERNOBJDIR KERNSRCDIR \
a54 1
		NBUILDJOBS NETBSDSRCDIR \
d56 1
a56 2
		OBJMACHINE \
		RELEASEDIR RELEASEMACHINEDIR TOOLCHAIN_MISSING TOOLDIR \
d59 8
a66 2
		USETOOLS USR_OBJMACHINE \
		X11SRCDIR
d82 1
a82 1
.for var in ${RELEASEVARS}
@


1.13.2.1
log
@Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.15 2016/12/25 16:44:39 christos Exp $
d40 2
a41 1
RELEASEVARS=	DISTRIBVER EXTERNAL_TOOLCHAIN HAVE_GCC HAVE_GDB \
d43 2
a44 1
		MACHINE MACHINE_ARCH MAKE MAKECONF \
d57 1
d59 2
a60 1
		TOOLCHAIN_MISSING \
d63 2
a64 8
		USETOOLS

.if ${MKREPRO:Uno} != "yes"
RELEASEVARS+= 	BSDOBJDIR BSDSRCDIR BUILDID BUILDINFO BUILDSEED \
		DESTDIR KERNARCHDIR KERNCONFDIR KERNOBJDIR KERNSRCDIR \
		MAKEFLAGS NBUILDJOBS NETBSDSRCDIR OBJMACHINE OBJMACHINE_ARCH \
		RELEASEDIR RELEASEMACHINEDIR TOOLDIR USR_OBJMACHINE X11SRCDIR
.endif
d80 1
a80 1
.for var in ${RELEASEVARS:O}
@


1.13.2.2
log
@Sync with HEAD
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.17 2017/01/24 17:54:52 christos Exp $
d42 1
a42 1
		MACHINE MACHINE_ARCH MAKECONF \
d44 11
d63 1
a63 1
		DESTDIR KERNARCHDIR KERNCONFDIR KERNOBJDIR KERNSRCDIR MAKE \
a67 1
RELEASEVARS+= ${_MKVARS.yes} ${_MKVARS.no}
@


1.12
log
@BUILDINFO part 3: Add BUILDINFO to RELEASEVARS and /etc/release

The BUILDINFO string will appear nearthe top of /etc/release,
indented by 8 spaces and with a blank line above and below it,
but without a heading.  The BUILDINFO string is expected to
be self-explanatory.

Also change some other headings near the top of /etc/release.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.11 2014/03/25 09:52:55 ozaki-r Exp $
d64 1
a64 1
		X11SRCDIR X11FLAVOUR
@


1.11
log
@Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.10 2014/01/26 17:33:53 apb Exp $
d40 1
a40 1
RELEASEVARS=	BSDOBJDIR BSDSRCDIR BUILDID BUILDSEED \
@


1.11.2.1
log
@Rebase.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.12 2014/08/03 09:19:34 apb Exp $
d40 1
a40 1
RELEASEVARS=	BSDOBJDIR BSDSRCDIR BUILDID BUILDINFO BUILDSEED \
@


1.10
log
@Add BUILDSEED to RELEASEVARS.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.9 2014/01/26 16:53:00 apb Exp $
d47 1
a47 1
		MKCRYPTO MKCRYPTO_RC5 MKCVS \
@


1.9
log
@Add MKREPRO and MKARZERO to the list of variables in RELEASEVARS.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.8 2014/01/16 01:15:33 christos Exp $
d40 1
a40 1
RELEASEVARS=	BSDOBJDIR BSDSRCDIR BUILDID \
@


1.8
log
@eliminate use of bsd.sys.mk from Makefiles
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.7 2013/11/01 11:09:05 apb Exp $
d46 1
a46 1
		MKATF MKBFD MKBINUTILS MKCATPAGES \
d54 1
a54 1
		MKPROFILE \
@


1.7
log
@HOST_SH is defined in bsd.sys.mk, so we need to include that
as well as bsd.own.mk.  Revert previous use of ${HOST_SH:Ush}.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.6 2013/11/01 10:00:51 martin Exp $
a38 1
.include <bsd.sys.mk>	# for more variables
@


1.6
log
@If HOST_SH is not defined, use sh to parse osrelease.sh
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.5 2013/11/01 06:22:24 apb Exp $
d38 2
a39 1
.include <bsd.own.mk>
d72 1
a72 1
DISTRIBVER!=	${HOST_SH:Ush} ${NETBSDSRCDIR}/sys/conf/osrelease.sh
@


1.5
log
@Reinstate .include <bsd.own.mk>.  Without this, many variables are undefined.

Define DISTRIBVER in the same way that src/etc/Makefile defines it.
Without this, "make params" in src/Makefile uses an undefined value.

Remove a spurious ">&3".
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.4 2013/10/30 15:15:12 apb Exp $
d71 1
a71 1
DISTRIBVER!=	${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh
@


1.4
log
@Instead of stupid postprocessor tricks, use redirect tricks
to ensure that the output from ${PRINT_PARAMS} contains only
the desired information without any debugging noise.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.3 2013/10/18 11:42:59 njoly Exp $
d38 2
d66 11
d85 1
a85 1
	@@printf >&3 "%20s = (undefined)\n" ${var} \
@


1.3
log
@Add HAVE_LLVM/HAVE_PCC, MKLLVM/MKPCC to RELEASEVARS.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.2 2013/03/09 14:12:08 jmmv Exp $
d10 2
a11 1
#		A command to print the desired variables and values.
d19 6
a24 4
# 		Prints the names and values of all the variables
# 		listed in ${RELEASEVARS}.  The output may be intermixed
# 		with debugging information, which can be removed by the
# 		${_PARAMS_POSTPROCESS} command.
d27 4
a30 3
#	_PARAMS_POSTPROCESS
#		A command to postprocess the output from "make _params",
#		to remove debugging information and other noise.
a37 2
.include <bsd.sys.mk>		# for TOOL_AWK, ...

d64 1
a64 1
PRINT_PARAMS= (cd ${.CURDIR}; ${MAKE} _params) | ${_PARAMS_POSTPROCESS}
d69 2
a70 1
	@@printf "%20s = '%-s'\n" ${var} ${${var}:C/'/'\\\\''/gW:Q}
d72 2
a73 1
	@@printf "%20s = (undefined)\n" ${var}
d77 1
a77 1
# _PARAMS_POSTPROCESS:
d82 1
a82 1
#     make -j prints "--- params ---";
d92 1
a92 1
#	--- params ---
d109 8
a116 46
# The awk program in ${PARAMS_POSTPROCESS} removes the unwanted noise,
# taking care with variables whose values contain embedded newlines
# (assuming that embedded newlines appear only inside single quotes).
#
_PARAMS_POSTPROCESS= ${TOOL_AWK} '\
	BEGIN { single_quote = "'\''"; \
		NORMAL = 0; \
		SKIP_HEADING = 1; \
		SKIP_MULTILINE = 2; \
		PRINT_MULTILINE = 3; \
		state = SKIP_HEADING; \
	} \
	function quotes_balanced_p(line) { \
		return (line ~ /^([^\\"'\'']|\\.|'\''[^'\'']*'\''|"(\\.|[^\\"])*")*$$/); \
	} \
	state == SKIP_MULTILINE { \
		if (quotes_balanced_p(single_quote $$0)) { \
			state = NORMAL; \
		} \
		next; \
	} \
	state == PRINT_MULTILINE { \
		if (quotes_balanced_p(single_quote $$0)) { \
			state = NORMAL; \
		} \
		print; next; \
	} \
	state == SKIP_HEADING && $$0 ~ /^--- .* ---$$/ { next; } \
	state == SKIP_HEADING && $$0 ~ / ===> / { next; } \
	/^(\+ )?(echo ["'\''])?printf.* = / { \
		if (quotes_balanced_p($$0)) { \
			state = NORMAL; \
		} else { \
			state = SKIP_MULTILINE; \
		} \
		next; \
	} \
	// { \
		if (quotes_balanced_p($$0)) { \
			state = NORMAL; \
		} else { \
			state = PRINT_MULTILINE; \
		} \
		print; next; \
	} \
	'
@


1.2
log
@Record the value of MKATF and MKKYUA in /etc/release.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.1 2012/12/03 13:53:28 apb Exp $
d38 1
a38 1
		INSTALLWORLDDIR \
d47 1
a47 1
		MKKERBEROS MKKYUA MKLDAP MKLINKLIB MKLINT \
d49 2
a50 1
		MKPAM MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX MKPROFILE \
@


1.1
log
@Add src/etc/Makefile.params, containing the definition of the
RELEASEVARS variable, and commands related to printing the values of
the variables whose names are in RELEASEVARS.

Add an awk script to remove noise printed by "make -j" or high levels
of MAKEVERBOSE, so we get only the variables names and values.  The
values are escaped so that variables containing embedded newlines,
quotation marks, and backslashes, are passed through safely.

Adapt src/etc/Makefile and src/Makefile to use the new ${PRINT_PARAMS}
command defined in src/etc/Makefile.params.

Now ${DESTDIR}/etc/release and the params file in the top-level
.OBJDIR should never contain unwanted noise, even after a build with
MAKEVERBOSE=4.
@
text
@d1 1
a1 1
#	$NetBSD$
d42 1
a42 1
		MKBFD MKBINUTILS MKCATPAGES \
d47 1
a47 1
		MKKERBEROS MKLDAP MKLINKLIB MKLINT \
@


1.1.6.1
log
@file Makefile.params was added on branch tls-maxphys on 2013-02-25 00:24:49 +0000
@
text
@d1 149
@


1.1.6.2
log
@resync with head
@
text
@a0 149
#	$NetBSD$
#
# Makefile fragment for printing build parameters.
#
# Public variables:
#	RELEASEVARS
#		List of variables whose value should be printed.
#
#	PRINT_PARAMS
#		A command to print the desired variables and values.
#		Values are printed as single-quoted strings, with
#		embedded quotes and newlines escaped in a way that's
#		acceptable to sh(1).  Undefined values are printed
#		as "(undefined)" (without quotation marks).
#
# Internal targets:
# 	_params:
# 		Prints the names and values of all the variables
# 		listed in ${RELEASEVARS}.  The output may be intermixed
# 		with debugging information, which can be removed by the
# 		${_PARAMS_POSTPROCESS} command.
#
# Internal variables:
#	_PARAMS_POSTPROCESS
#		A command to postprocess the output from "make _params",
#		to remove debugging information and other noise.
#
# Example:
#	. ${NETBSDSRCDIR}/etc/Makefile.params
#	show-params: .MAKE .PHONY # print params to stdout
#		@@${PRINT_PARAMS}
#

.include <bsd.sys.mk>		# for TOOL_AWK, ...

RELEASEVARS=	BSDOBJDIR BSDSRCDIR BUILDID \
		DESTDIR DISTRIBVER EXTERNAL_TOOLCHAIN HAVE_GCC HAVE_GDB \
		INSTALLWORLDDIR \
		KERNARCHDIR KERNCONFDIR KERNOBJDIR KERNSRCDIR \
		MACHINE MACHINE_ARCH MAKE MAKECONF MAKEFLAGS \
		MAKEOBJDIR MAKEOBJDIRPREFIX MAKEVERBOSE \
		MKBFD MKBINUTILS MKCATPAGES \
		MKCRYPTO MKCRYPTO_RC5 MKCVS \
		MKDEBUG MKDEBUGLIB MKDOC MKDTRACE MKDYNAMICROOT \
		MKGCC MKGCCCMDS MKGDB \
		MKHESIOD MKHTML MKIEEEFP MKINET6 MKINFO MKIPFILTER \
		MKKERBEROS MKLDAP MKLINKLIB MKLINT \
		MKMAN MKMANZ MKMDNS MKNLS MKNPF MKOBJ MKOBJDIRS \
		MKPAM MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX MKPROFILE \
		MKSHARE MKSKEY MKSOFTFLOAT MKSTATICLIB \
		MKUNPRIVED MKUPDATE MKX11 MKYP \
		NBUILDJOBS NETBSDSRCDIR \
		NOCLEANDIR NODISTRIBDIRS NOINCLUDES \
		OBJMACHINE \
		RELEASEDIR RELEASEMACHINEDIR TOOLCHAIN_MISSING TOOLDIR \
		USE_HESIOD USE_INET6 USE_JEMALLOC USE_KERBEROS USE_LDAP \
		USE_PAM USE_SKEY USE_YP \
		USETOOLS USR_OBJMACHINE \
		X11SRCDIR X11FLAVOUR

PRINT_PARAMS= (cd ${.CURDIR}; ${MAKE} _params) | ${_PARAMS_POSTPROCESS}

_params: .PHONY
.for var in ${RELEASEVARS}
.if defined(${var})
	@@printf "%20s = '%-s'\n" ${var} ${${var}:C/'/'\\\\''/gW:Q}
.else
	@@printf "%20s = (undefined)\n" ${var}
.endif
.endfor

# _PARAMS_POSTPROCESS:
#
# The output from the "make _params" can include the following types of
# unwanted lines:
#
#     make -j prints "--- params ---";
#
#     if MAKEVERBOSE is set to 3 or more then make prints each "printf"
#     command in addition to executing it;
#
#     if MAKEVERBOSE is set to 4 then the shell prints each command
#     (prefixed with "+").
#
# So the resulting output can look like this:
#
#	--- params ---
#	+ echo 'printf "%20s = '\''%-s'\''\n" BSDOBJDIR /usr/obj'
#	printf "%20s = '%-s'\n" BSDOBJDIR /usr/obj
#	+ printf '%20s = '\''%-s'\''\n' BSDOBJDIR /usr/obj
#	           BSDOBJDIR = '/usr/obj'
#	+ echo 'printf "%20s = '\''%-s'\''\n" BSDSRCDIR /usr/src'
#	printf "%20s = '%-s'\n" BSDSRCDIR /usr/src
#	+ printf '%20s = '\''%-s'\''\n' BSDSRCDIR /usr/src
#	           BSDSRCDIR = '/usr/src'
#	[...]
#
# where what we want is just this:
#
#	           BSDOBJDIR = '/usr/obj'
#	           BSDSRCDIR = '/usr/src'
#	           [...]
#
# The awk program in ${PARAMS_POSTPROCESS} removes the unwanted noise,
# taking care with variables whose values contain embedded newlines
# (assuming that embedded newlines appear only inside single quotes).
#
_PARAMS_POSTPROCESS= ${TOOL_AWK} '\
	BEGIN { single_quote = "'\''"; \
		NORMAL = 0; \
		SKIP_HEADING = 1; \
		SKIP_MULTILINE = 2; \
		PRINT_MULTILINE = 3; \
		state = SKIP_HEADING; \
	} \
	function quotes_balanced_p(line) { \
		return (line ~ /^([^\\"'\'']|\\.|'\''[^'\'']*'\''|"(\\.|[^\\"])*")*$$/); \
	} \
	state == SKIP_MULTILINE { \
		if (quotes_balanced_p(single_quote $$0)) { \
			state = NORMAL; \
		} \
		next; \
	} \
	state == PRINT_MULTILINE { \
		if (quotes_balanced_p(single_quote $$0)) { \
			state = NORMAL; \
		} \
		print; next; \
	} \
	state == SKIP_HEADING && $$0 ~ /^--- .* ---$$/ { next; } \
	state == SKIP_HEADING && $$0 ~ / ===> / { next; } \
	/^(\+ )?(echo ["'\''])?printf.* = / { \
		if (quotes_balanced_p($$0)) { \
			state = NORMAL; \
		} else { \
			state = SKIP_MULTILINE; \
		} \
		next; \
	} \
	// { \
		if (quotes_balanced_p($$0)) { \
			state = NORMAL; \
		} else { \
			state = PRINT_MULTILINE; \
		} \
		print; next; \
	} \
	'
@


1.1.6.3
log
@resync from head
@
text
@d42 1
a42 1
		MKATF MKBFD MKBINUTILS MKCATPAGES \
d47 1
a47 1
		MKKERBEROS MKKYUA MKLDAP MKLINKLIB MKLINT \
@


1.1.6.4
log
@Rebase to HEAD as of a few days ago.
@
text
@d10 1
a10 2
#		A command to print the desired variables and values
#		to stdout, without any additional debugging information.
d18 4
a21 6
#		Prints the names and values of all the variables
#		listed in ${RELEASEVARS}.  The desired results may be
#		redirected somewhere other than stdout, for example by
#		setting _params_redirect='>&3'.	 stdout and stderr may
#		contain unwanted debugging information, from make and
#		the shell.
d24 3
a26 4
#	_params_redirect:
#		If set, this should be a shell redirection specification, such
#		as '>&3', controlling where the output from "make _params" will
#		be sent.
d34 1
a34 1
.include <bsd.own.mk>	# for some variables
d36 1
a36 1
RELEASEVARS=	BSDOBJDIR BSDSRCDIR BUILDID BUILDINFO BUILDSEED \
d38 1
a38 1
		HAVE_LLVM HAVE_PCC INSTALLWORLDDIR \
d42 2
a43 2
		MKARZERO MKATF MKBFD MKBINUTILS MKCATPAGES \
		MKCRYPTO MKCRYPTO_RC5 MKCTF MKCVS \
d47 1
a47 1
		MKKERBEROS MKKYUA MKLDAP MKLINKLIB MKLINT MKLLVM \
d49 1
a49 2
		MKPAM MKPCC MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX \
		MKPROFILE MKREPRO \
d61 1
a61 12

#
# Duplicate the DISTRIBVER setting from src/etc/Makefile.
#
.ifndef DISTRIBVER
DISTRIBVER!=	${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh
.endif

#
# _params does the printing.
#
_params_redirect?= # empty
d66 1
a66 2
	@@printf "%20s = '%-s'\n" ${var} ${${var}:C/'/'\\\\''/gW:Q} \
	    ${_params_redirect}
d68 1
a68 2
	@@printf "%20s = (undefined)\n" ${var} \
	    ${_params_redirect}
d72 1
a72 1
# PRINT_PARAMS:
d77 1
a77 1
#     make -j prints "--- _params ---";
d87 1
a87 1
#	--- _params ---
d104 46
a149 8
# The shell redirections in ${PRINT_PARAMS} ensure that the unwanted
# noise is discarded (via ">/dev/null"), while the desired information
# ends up on the subshell's stdout (via ">&3" and "3>&1").  The value
# of _params_redirect is passed in the environment instead of on the
# command line, to prevent it from appearing in MAKEFLAGS (which would
# appear in the output).
#
PRINT_PARAMS:=	(_params_redirect='>&3' ${MAKE} -f ${.PARSEDIR:Q}/${.PARSEFILE:Q} _params 3>&1 >/dev/null)
@


1.1.2.1
log
@file Makefile.params was added on branch yamt-pagecache on 2013-01-16 05:26:13 +0000
@
text
@d1 149
@


1.1.2.2
log
@sync with (a bit old) head
@
text
@a0 149
#	$NetBSD$
#
# Makefile fragment for printing build parameters.
#
# Public variables:
#	RELEASEVARS
#		List of variables whose value should be printed.
#
#	PRINT_PARAMS
#		A command to print the desired variables and values.
#		Values are printed as single-quoted strings, with
#		embedded quotes and newlines escaped in a way that's
#		acceptable to sh(1).  Undefined values are printed
#		as "(undefined)" (without quotation marks).
#
# Internal targets:
# 	_params:
# 		Prints the names and values of all the variables
# 		listed in ${RELEASEVARS}.  The output may be intermixed
# 		with debugging information, which can be removed by the
# 		${_PARAMS_POSTPROCESS} command.
#
# Internal variables:
#	_PARAMS_POSTPROCESS
#		A command to postprocess the output from "make _params",
#		to remove debugging information and other noise.
#
# Example:
#	. ${NETBSDSRCDIR}/etc/Makefile.params
#	show-params: .MAKE .PHONY # print params to stdout
#		@@${PRINT_PARAMS}
#

.include <bsd.sys.mk>		# for TOOL_AWK, ...

RELEASEVARS=	BSDOBJDIR BSDSRCDIR BUILDID \
		DESTDIR DISTRIBVER EXTERNAL_TOOLCHAIN HAVE_GCC HAVE_GDB \
		INSTALLWORLDDIR \
		KERNARCHDIR KERNCONFDIR KERNOBJDIR KERNSRCDIR \
		MACHINE MACHINE_ARCH MAKE MAKECONF MAKEFLAGS \
		MAKEOBJDIR MAKEOBJDIRPREFIX MAKEVERBOSE \
		MKBFD MKBINUTILS MKCATPAGES \
		MKCRYPTO MKCRYPTO_RC5 MKCVS \
		MKDEBUG MKDEBUGLIB MKDOC MKDTRACE MKDYNAMICROOT \
		MKGCC MKGCCCMDS MKGDB \
		MKHESIOD MKHTML MKIEEEFP MKINET6 MKINFO MKIPFILTER \
		MKKERBEROS MKLDAP MKLINKLIB MKLINT \
		MKMAN MKMANZ MKMDNS MKNLS MKNPF MKOBJ MKOBJDIRS \
		MKPAM MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX MKPROFILE \
		MKSHARE MKSKEY MKSOFTFLOAT MKSTATICLIB \
		MKUNPRIVED MKUPDATE MKX11 MKYP \
		NBUILDJOBS NETBSDSRCDIR \
		NOCLEANDIR NODISTRIBDIRS NOINCLUDES \
		OBJMACHINE \
		RELEASEDIR RELEASEMACHINEDIR TOOLCHAIN_MISSING TOOLDIR \
		USE_HESIOD USE_INET6 USE_JEMALLOC USE_KERBEROS USE_LDAP \
		USE_PAM USE_SKEY USE_YP \
		USETOOLS USR_OBJMACHINE \
		X11SRCDIR X11FLAVOUR

PRINT_PARAMS= (cd ${.CURDIR}; ${MAKE} _params) | ${_PARAMS_POSTPROCESS}

_params: .PHONY
.for var in ${RELEASEVARS}
.if defined(${var})
	@@printf "%20s = '%-s'\n" ${var} ${${var}:C/'/'\\\\''/gW:Q}
.else
	@@printf "%20s = (undefined)\n" ${var}
.endif
.endfor

# _PARAMS_POSTPROCESS:
#
# The output from the "make _params" can include the following types of
# unwanted lines:
#
#     make -j prints "--- params ---";
#
#     if MAKEVERBOSE is set to 3 or more then make prints each "printf"
#     command in addition to executing it;
#
#     if MAKEVERBOSE is set to 4 then the shell prints each command
#     (prefixed with "+").
#
# So the resulting output can look like this:
#
#	--- params ---
#	+ echo 'printf "%20s = '\''%-s'\''\n" BSDOBJDIR /usr/obj'
#	printf "%20s = '%-s'\n" BSDOBJDIR /usr/obj
#	+ printf '%20s = '\''%-s'\''\n' BSDOBJDIR /usr/obj
#	           BSDOBJDIR = '/usr/obj'
#	+ echo 'printf "%20s = '\''%-s'\''\n" BSDSRCDIR /usr/src'
#	printf "%20s = '%-s'\n" BSDSRCDIR /usr/src
#	+ printf '%20s = '\''%-s'\''\n' BSDSRCDIR /usr/src
#	           BSDSRCDIR = '/usr/src'
#	[...]
#
# where what we want is just this:
#
#	           BSDOBJDIR = '/usr/obj'
#	           BSDSRCDIR = '/usr/src'
#	           [...]
#
# The awk program in ${PARAMS_POSTPROCESS} removes the unwanted noise,
# taking care with variables whose values contain embedded newlines
# (assuming that embedded newlines appear only inside single quotes).
#
_PARAMS_POSTPROCESS= ${TOOL_AWK} '\
	BEGIN { single_quote = "'\''"; \
		NORMAL = 0; \
		SKIP_HEADING = 1; \
		SKIP_MULTILINE = 2; \
		PRINT_MULTILINE = 3; \
		state = SKIP_HEADING; \
	} \
	function quotes_balanced_p(line) { \
		return (line ~ /^([^\\"'\'']|\\.|'\''[^'\'']*'\''|"(\\.|[^\\"])*")*$$/); \
	} \
	state == SKIP_MULTILINE { \
		if (quotes_balanced_p(single_quote $$0)) { \
			state = NORMAL; \
		} \
		next; \
	} \
	state == PRINT_MULTILINE { \
		if (quotes_balanced_p(single_quote $$0)) { \
			state = NORMAL; \
		} \
		print; next; \
	} \
	state == SKIP_HEADING && $$0 ~ /^--- .* ---$$/ { next; } \
	state == SKIP_HEADING && $$0 ~ / ===> / { next; } \
	/^(\+ )?(echo ["'\''])?printf.* = / { \
		if (quotes_balanced_p($$0)) { \
			state = NORMAL; \
		} else { \
			state = SKIP_MULTILINE; \
		} \
		next; \
	} \
	// { \
		if (quotes_balanced_p($$0)) { \
			state = NORMAL; \
		} else { \
			state = PRINT_MULTILINE; \
		} \
		print; next; \
	} \
	'
@


1.1.2.3
log
@sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")
@
text
@d1 1
a1 1
#	$NetBSD: Makefile.params,v 1.1.2.2 2013/01/16 05:26:13 yamt Exp $
d10 1
a10 2
#		A command to print the desired variables and values
#		to stdout, without any additional debugging information.
d18 4
a21 6
#		Prints the names and values of all the variables
#		listed in ${RELEASEVARS}.  The desired results may be
#		redirected somewhere other than stdout, for example by
#		setting _params_redirect='>&3'.	 stdout and stderr may
#		contain unwanted debugging information, from make and
#		the shell.
d24 3
a26 4
#	_params_redirect:
#		If set, this should be a shell redirection specification, such
#		as '>&3', controlling where the output from "make _params" will
#		be sent.
d34 1
a34 1
.include <bsd.own.mk>	# for some variables
d36 1
a36 1
RELEASEVARS=	BSDOBJDIR BSDSRCDIR BUILDID BUILDSEED \
d38 1
a38 1
		HAVE_LLVM HAVE_PCC INSTALLWORLDDIR \
d42 2
a43 2
		MKARZERO MKATF MKBFD MKBINUTILS MKCATPAGES \
		MKCRYPTO MKCRYPTO_RC5 MKCTF MKCVS \
d47 1
a47 1
		MKKERBEROS MKKYUA MKLDAP MKLINKLIB MKLINT MKLLVM \
d49 1
a49 2
		MKPAM MKPCC MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX \
		MKPROFILE MKREPRO \
d61 1
a61 12

#
# Duplicate the DISTRIBVER setting from src/etc/Makefile.
#
.ifndef DISTRIBVER
DISTRIBVER!=	${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh
.endif

#
# _params does the printing.
#
_params_redirect?= # empty
d66 1
a66 2
	@@printf "%20s = '%-s'\n" ${var} ${${var}:C/'/'\\\\''/gW:Q} \
	    ${_params_redirect}
d68 1
a68 2
	@@printf "%20s = (undefined)\n" ${var} \
	    ${_params_redirect}
d72 1
a72 1
# PRINT_PARAMS:
d77 1
a77 1
#     make -j prints "--- _params ---";
d87 1
a87 1
#	--- _params ---
d104 46
a149 8
# The shell redirections in ${PRINT_PARAMS} ensure that the unwanted
# noise is discarded (via ">/dev/null"), while the desired information
# ends up on the subshell's stdout (via ">&3" and "3>&1").  The value
# of _params_redirect is passed in the environment instead of on the
# command line, to prevent it from appearing in MAKEFLAGS (which would
# appear in the output).
#
PRINT_PARAMS:=	(_params_redirect='>&3' ${MAKE} -f ${.PARSEDIR:Q}/${.PARSEFILE:Q} _params 3>&1 >/dev/null)
@


