## www/chromium Makefile.local [contrib] ## ## Synopsis: Using a simple _WRAP_TOOL handling - lazily analogous onto ## pkgsrc cwrappers - for local cc, c++ cmds. These would match cmds under ## base system pathanmes. In each being provided via CC and CXX, these cmds ## may furthermore be locally configured to use ccache. As such, these ## cmds may not easily be provided with a modification onto BINARY_ALIAS ## ## Otherwise, using BINARY_ALIAS for defining generic toolchain cmds. ## ## ## Rationale: Ensure that the toolchain variables configured in the build ## environment will be used to provide any generic toolchain cmds used in ## the build ## ## A more specific rationale: Ensure that ccache will be used, throughout ## the build, when CC and/or CXX represents a ccache wrapper ## ## Possible side effects: May serve to ensure a libtool-like configuration ## for build ## ## ## Assumptions ## ## - RM => rm -f ## ## - This cannot not be used when building ports-mgmt/pkg, if without ## modification, due to an early binding of BINARY_LINKDIR in this file ## ## ## Further remarks ## ## - A similar build configuration may be of use when building the ports ## devel/chromium-gn, www/qt5-webtools (if using GN for chromium), ... ## ## - This does not provide any modification onto GN_ARGS such as ## for quoted GN cc, cxx, ld, nm, ar, and possibly readelf args. ## Those arguments may not appear to be used in most of the build, ## but may be provided to gn regardless. ## .if empty(_WRAP_TOOL:Mcc=*) _WRAP_TOOL+= cc=${CC:Q} .endif .if empty(_WRAP_TOOL:Mc++=*) _WRAP_TOOL+= c++=${CXX:Q} .endif ## ## Bind BINARY_LINKDIR early, before bsd.port.mk is evaluated ## ## This may serve to ensure that a tgt can be defined onto ## BINARY_LINKDIR in this file ## .ifndef BINARY_LINKDIR BINARY_LINKDIR!= ${MAKE} -C ${PORTSDIR:U/usr/ports}/ports-mgmt/pkg -V BINARY_LINKDIR .export BINARY_LINKDIR . ifdef MK_VERBOSE . info Using BINARY_LINKDIR ${BINARY_LINKDIR} . endif .endif ## ## trivial cc, cxx wrappers - cf. pkgsrc ## .for .cmd. .tool. in ${_WRAP_TOOL:C/=/ /} . ifdef MK_VERBOSE . info Wrapping ${.cmd.} => ${.tool.} . endif ${BINARY_LINKDIR}/${.cmd.}: ${BINARY_LINKDIR} .EXEC @${RM} ${BINARY_LINKDIR}/${.cmd.} @${ECHO} '#!${SH}' > ${BINARY_LINKDIR}/${.cmd.} @${ECHO} 'exec ${.tool.} "$$@"' >> ${BINARY_LINKDIR}/${.cmd.} @${CHMOD} +x ${BINARY_LINKDIR}/${.cmd.} _WRAP_TOOL_TGT+= ${BINARY_LINKDIR}/${.cmd.} _PATCH_REAL_SEQ+= ${BINARY_LINKDIR}/${.cmd.} .endfor ## ## utility tgt for purpose of build configuration testing ## wrap-tools: ${_WRAP_TOOL_TGT} .PHONY ## ## also modify BINARY_ALIAS locally ## .for .CMD. in CPP LD AR NM OBJCOPY OBJDUMP SIZE STRINGS RANLIB AS TBLGEN READELF . if empty(BINARY_ALIAS:M${.CMD.:tl}=*) BINARY_ALIAS+= ${.CMD.:tl}=${${.CMD.}:Q} . ifdef MK_VERBOSE . info Alias ${.CMD.:tl} => ${${.CMD.}:Q} . endif . endif .endfor