Modestas Vainius wrote:

> I don't think this scales well. Something like $(dpkg-buildflags --
> export=make) would be better to suggest. IMHO, project shall decide on clear 
> recommendations how to proceed.

Side note: I don't know how to do that with GNU make, actually.
$(shell ...) works for one variable, but it converts newlines to
spaces.  In the spirit you suggest, the simplest way might be
something like

 configure-stamp:
        set -e; \
        eval "$$(dpkg-buildflags --export=sh)"; \
        CFLAGS="-Wall $$CFLAGS"; \
        ./configure ...

In my own work I have been using

 CFLAGS := -Wall $(shell dpkg-buildflags --get CFLAGS)

which has some advantages over --export=sh:

 - it can be overridden on the "debian/rules" command line;
 - it allows me to easily pass the flags explicit on the configure
   command line instead of through the environment;
 - I can easily read and manipulate CFLAGS before passing it on;
 - it does not affect flags other than CFLAGS, so the effect
   gets well tested and the use case is obvious to me (unlike LDFLAGS
   et al).



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to