1 # $NetBSD: cmdline.mk,v 1.2 2020/11/15 14:07:53 rillig Exp $
3 # Tests for command line parsing and related special variables.
6 SUB1= a7b41170-53f8-4cc2-bc5c-e4c3dd93ec45 # just a random UUID
7 SUB2= 6a8899d2-d227-4b55-9b6b-f3c8eeb83fd5 # just a random UUID
8 MAKE_CMD= env TMPBASE=${TMPBASE}/${SUB1} ${.MAKE} -f ${MAKEFILE} -r
9 DIR2= ${TMPBASE}/${SUB2}
10 DIR12= ${TMPBASE}/${SUB1}/${SUB2}
13 all: makeobjdir-direct makeobjdir-indirect
16 @rm -rf ${DIR2} ${DIR12}
17 @mkdir -p ${DIR2} ${DIR12}
19 # The .OBJDIR can be set via the MAKEOBJDIR command line variable.
20 # It must be a command line variable; an environment variable would not work.
23 @${MAKE_CMD} MAKEOBJDIR=${DIR2} show-objdir
25 # The .OBJDIR can be set via the MAKEOBJDIR command line variable,
26 # and that variable could even contain the usual modifiers.
27 # Since the .OBJDIR=MAKEOBJDIR assignment happens very early,
28 # the SUB2 variable in the modifier is not defined yet and is therefore empty.
29 # The SUB1 in the resulting path comes from the environment variable TMPBASE,
33 @${MAKE_CMD} MAKEOBJDIR='$${TMPBASE}/$${SUB2}' show-objdir
36 @echo $@: ${.OBJDIR:Q}