help-make
[Top][All Lists]
Advanced

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

Re: simpler way to do multi-arch builds?


From: Paul D. Smith
Subject: Re: simpler way to do multi-arch builds?
Date: Mon, 21 Mar 2005 13:49:41 -0500

There are simpler ways to do it but I don't know that anyone has written
them up in a document like that.


There are many folks (including myself) who've developed build systems
which are 100% (insofar as that's possible) data driven.  That is,
individual makefiles do nothing but define variables: they never define
any rules.  Then, more advanced features like call and eval are used to
actually do the work.  So an individual makefile might say something
like (this syntax is basically directly from a system I use here):

    PROGRAMS = foo
    LIBRARIES = bar

    foo_SRCS = foo.c jar.cc baz.f
    foo_LIBS = f77
    foo_CPPFLAGS = -I../include

    bar_LIBSRCS = bar.c biz.c boz.c
    bar_SOVERSION = 4.0
    bar_CPPFLAGS = -I../include -DLIBBAR  

    jar.o_FLAGS = -O3


Speaking personally I've gotten away from the philosophy of that
multi-arch paper, of using VPATH, etc. etc.  It relies an a few "tricky
bits" which are closer to "hacks", it doesn't fit will with
non-recursive make environments, etc.  Its main advantage is and has
always been that makefiles are easier to write and read.  Now, that's a
very significant advantage, of course, and not to be dismissed lightly
at all.

BUT! now that you can get a 98% data-driven makefile environment with
call/eval and get the same or even greater levels of simplicity for the
makefile writer/reader, I don't know that you need the tricky bits and
the issues that go with them anymore.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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