automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rfc] Antimake


From: Sam Varshavchik
Subject: Re: [rfc] Antimake
Date: Sat, 10 Mar 2012 13:08:01 -0500

Marko Kreen writes:

Antimake already has per-target object files so it should be easy
to add another level of indirection.  But I wonder whether it's
actually necessary, as you can always do:

        bin_PROGRAMS = foo
        noinst_PROGRAMS = foo_debug

        foo_SOURCES = ...
        foo_CFLAGS = -O2

        foo_debug_SOURCES = $(foo_SOURCES)
        foo_debug_CFLAGS = -O0 -g

so why do you need additional magic for that?

Well, you can certainly do that, above, or have just a:

BUILDDEBUG=1

and have everything done for you. And no need to add an extra set of declarations for each binary target. Much more compact.

Actually, my hack was even more generic, and allowed turnkey custom definition of arbitrary build modes.

BUILDMODES=prod

was the default.

BUILDMODES=prod debug

was the release+debug build. A rule foreach-ed over BUILDMODES, eval-ing a rule with each word as a parameter, and generating target rules using $(1)_CFLAGS, $(1)_CXXFLAGS, i.e. prod_CFLAGS, debug_CFLAGS, and so on. So, someone could define a custom build mode called "funky", define funky_CFLAGS, et al, and produce a set of binary targets built with the funky flags, in addition to the stock release and debug compilation options.


Attachment: pgpeJQya3Towk.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]