On Thu, Jul 01, 2010 at 10:04:02AM +0200, Goswin von Brederlow wrote: > Pierre Habouzit <[email protected]> writes: > > > On Wed, Jun 30, 2010 at 03:05:10PM +0200, Goswin von Brederlow wrote: > >> m...@book:~% cat Makefile > >> $(eval $(shell echo FOO=1; echo BAR=2)) > >> $(info FOO=$(FOO)) > >> $(info BAR=$(BAR)) > >> all: > >> > >> m...@book:~% make > >> FOO=1 BAR=2 > >> BAR= > >> make: Nothing to be done for `all'. > >> > >> > >> How do you get make to honor line breaks in $(eval ...)? > > > > gah, make is annoying. Well there is always the possibility: > > > > -include dpkg-buildflags.mk > > dpkg-buildflags.mk: > > $(shell dpkg-buildflags --export=make) > $@ > > > > Which is probably a hell of a lot simpler. > > Stupid make.... > > Indeed. > > > (for those not very comfortable with make, the -include > > dpkg-buildflags.mk will check if the file exist, if not won't complain > > but will find if there is a target named 'dpkg-buildflags.mk', if yes > > will do its rules and retry to include the file. > > > > Which in the end does what is meant. > > Except it won't make the file ever again even if the dpkg-buildflags > output changes. So if you want to preserve timestamps unless the output > changes you need something like this. If the timestamp doesn't matter > you just need the .PHONY. > > -include dpkg-buildflags.mk > dpkg-buildflags.mk: > $(shell dpkg-buildflags --export=make) > [email protected] > @if ! cmp 2>/dev/null --quiet [email protected] $@; then \ > echo Updating $@; \ > mv [email protected] $@; \ > else \ > rm [email protected]; \ > fi
You don't need to protect the regeneration with your update-only-if-changed trick because no rule will ever depend upon the dpkg-buildflags.mk freshness, so the sole need you have is to mark the rule PHONY if you need such a thing. -- ·O· Pierre Habouzit ··O [email protected] OOO http://www.madism.org -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected] Archive: http://lists.debian.org/[email protected]

