Date: Fri, 20 Sep 2002 11:33:08 +0200 From: Roman Neuhauser <neuhauser@bellavista.cz> To: freebsd-questions <freebsd-questions@freebsd.org> Subject: another make (pmake) question Message-ID: <20020920093308.GA30361@freepuppy.bellavista.cz> In-Reply-To: <20020920070707.GF379@freepuppy.bellavista.cz> References: <20020920070707.GF379@freepuppy.bellavista.cz>
next in thread | previous in thread | raw e-mail | index | archive | help
(if you know a better place i should be asking these questions, do point me at those.) Another make question... It would appear that variables have at least two scopes, but parallel, not nested. Example: DESTDIR= SOURCES= foo bar baz TARGETS:= ${SOURCES:C;^.+$;${DESTDIR}/&;} SRCFILE= ${.TARGET:C,^${DESTDIR}/,,} .BEGIN: @echo "\$${DESTDIR}: ${DESTDIR}" @echo "\$${TARGETS}: ${TARGETS}" all: ${TARGETS} ${TARGETS}: ${SRCFILE} @echo "SRC: ${SRCFILE} -> TGT: ${.TARGET}" @#install ${SRCFILE} ${.TARGET} .PHONY: all roman@freepuppy ~/tmp 1126:0 > make all DESTDIR=/tmp/maketest ${DESTDIR}: /tmp/maketest ${TARGETS}: /foo /bar /baz Graph cycles through /foo Graph cycles through /bar Graph cycles through /baz `all' not remade because of errors. here, DESTDIR has a value in the .BEGIN target "body", but not outside it. how come the commandline assignment overrides the value at one place, but not the other? -- begin 666 nonexistent.vbs FreeBSD 4.7-RC 11:24AM up 2 days, 18:39, 19 users, load averages: 0.04, 0.04, 0.00 end To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020920093308.GA30361>