2015-07-23 11:03:24 +03:00
|
|
|
# $NetBSD: Makefile.params,v 1.13 2015/07/23 08:03:25 mrg Exp $
|
2012-12-03 17:53:28 +04:00
|
|
|
#
|
|
|
|
# Makefile fragment for printing build parameters.
|
|
|
|
#
|
|
|
|
# Public variables:
|
|
|
|
# RELEASEVARS
|
|
|
|
# List of variables whose value should be printed.
|
|
|
|
#
|
|
|
|
# PRINT_PARAMS
|
2013-10-30 19:15:12 +04:00
|
|
|
# A command to print the desired variables and values
|
|
|
|
# to stdout, without any additional debugging information.
|
2012-12-03 17:53:28 +04:00
|
|
|
# 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:
|
2013-10-30 19:15:12 +04:00
|
|
|
# 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.
|
2012-12-03 17:53:28 +04:00
|
|
|
#
|
|
|
|
# Internal variables:
|
2013-10-30 19:15:12 +04:00
|
|
|
# _params_redirect:
|
|
|
|
# If set, this should be a shell redirection specification, such
|
|
|
|
# as '>&3', controlling where the output from "make _params" will
|
|
|
|
# be sent.
|
2012-12-03 17:53:28 +04:00
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
# . ${NETBSDSRCDIR}/etc/Makefile.params
|
|
|
|
# show-params: .MAKE .PHONY # print params to stdout
|
|
|
|
# @${PRINT_PARAMS}
|
|
|
|
#
|
|
|
|
|
2013-11-01 15:09:05 +04:00
|
|
|
.include <bsd.own.mk> # for some variables
|
2013-11-01 10:22:24 +04:00
|
|
|
|
2014-08-03 13:19:34 +04:00
|
|
|
RELEASEVARS= BSDOBJDIR BSDSRCDIR BUILDID BUILDINFO BUILDSEED \
|
2012-12-03 17:53:28 +04:00
|
|
|
DESTDIR DISTRIBVER EXTERNAL_TOOLCHAIN HAVE_GCC HAVE_GDB \
|
2013-10-18 15:42:59 +04:00
|
|
|
HAVE_LLVM HAVE_PCC INSTALLWORLDDIR \
|
2012-12-03 17:53:28 +04:00
|
|
|
KERNARCHDIR KERNCONFDIR KERNOBJDIR KERNSRCDIR \
|
|
|
|
MACHINE MACHINE_ARCH MAKE MAKECONF MAKEFLAGS \
|
|
|
|
MAKEOBJDIR MAKEOBJDIRPREFIX MAKEVERBOSE \
|
2014-01-26 20:53:00 +04:00
|
|
|
MKARZERO MKATF MKBFD MKBINUTILS MKCATPAGES \
|
2014-03-25 13:52:55 +04:00
|
|
|
MKCRYPTO MKCRYPTO_RC5 MKCTF MKCVS \
|
2012-12-03 17:53:28 +04:00
|
|
|
MKDEBUG MKDEBUGLIB MKDOC MKDTRACE MKDYNAMICROOT \
|
|
|
|
MKGCC MKGCCCMDS MKGDB \
|
|
|
|
MKHESIOD MKHTML MKIEEEFP MKINET6 MKINFO MKIPFILTER \
|
2013-10-18 15:42:59 +04:00
|
|
|
MKKERBEROS MKKYUA MKLDAP MKLINKLIB MKLINT MKLLVM \
|
2012-12-03 17:53:28 +04:00
|
|
|
MKMAN MKMANZ MKMDNS MKNLS MKNPF MKOBJ MKOBJDIRS \
|
2013-10-18 15:42:59 +04:00
|
|
|
MKPAM MKPCC MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX \
|
2014-01-26 20:53:00 +04:00
|
|
|
MKPROFILE MKREPRO \
|
2012-12-03 17:53:28 +04:00
|
|
|
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 \
|
2015-07-23 11:03:24 +03:00
|
|
|
X11SRCDIR
|
2012-12-03 17:53:28 +04:00
|
|
|
|
2013-11-01 10:22:24 +04:00
|
|
|
|
|
|
|
#
|
|
|
|
# Duplicate the DISTRIBVER setting from src/etc/Makefile.
|
|
|
|
#
|
|
|
|
.ifndef DISTRIBVER
|
2013-11-01 15:09:05 +04:00
|
|
|
DISTRIBVER!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh
|
2013-11-01 10:22:24 +04:00
|
|
|
.endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# _params does the printing.
|
|
|
|
#
|
2013-10-30 19:15:12 +04:00
|
|
|
_params_redirect?= # empty
|
2012-12-03 17:53:28 +04:00
|
|
|
|
|
|
|
_params: .PHONY
|
|
|
|
.for var in ${RELEASEVARS}
|
|
|
|
.if defined(${var})
|
2013-10-30 19:15:12 +04:00
|
|
|
@printf "%20s = '%-s'\n" ${var} ${${var}:C/'/'\\\\''/gW:Q} \
|
|
|
|
${_params_redirect}
|
2012-12-03 17:53:28 +04:00
|
|
|
.else
|
2013-11-01 10:22:24 +04:00
|
|
|
@printf "%20s = (undefined)\n" ${var} \
|
2013-10-30 19:15:12 +04:00
|
|
|
${_params_redirect}
|
2012-12-03 17:53:28 +04:00
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
2013-10-30 19:15:12 +04:00
|
|
|
# PRINT_PARAMS:
|
2012-12-03 17:53:28 +04:00
|
|
|
#
|
|
|
|
# The output from the "make _params" can include the following types of
|
|
|
|
# unwanted lines:
|
|
|
|
#
|
2013-10-30 19:15:12 +04:00
|
|
|
# make -j prints "--- _params ---";
|
2012-12-03 17:53:28 +04:00
|
|
|
#
|
|
|
|
# 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:
|
|
|
|
#
|
2013-10-30 19:15:12 +04:00
|
|
|
# --- _params ---
|
2012-12-03 17:53:28 +04:00
|
|
|
# + 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'
|
|
|
|
# [...]
|
|
|
|
#
|
2013-10-30 19:15:12 +04:00
|
|
|
# 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)
|