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

Re: elegant ways to build a package two times



Le lundi 21 avril 2008 à 19:22 +0200, Marco d'Itri a écrit :
> On Apr 15, Josselin Mouette <joss@debian.org> wrote:
> > You don???t need automake for this to work, it???s just that automake does
> > things right by default. Fixing the package to get out-of-tree builds to
> > work using VPATH should be feasible.
> Can you point me to a good example of a package using VPATH?

You can have a look at mpb; the upstream version uses autoconf without
automake and doesn't support out-of-tree builds. The Debian package has
a patch to make it work using VPATH.

> Actually both ways share the same problem: a lot of code will have to be
> duplicated in debian/rules (maybe I should try using "define" to create
> macros).

Not necessarily:

FLAVORS := foo bar

common_configure_flags = --prefix=/usr
foo_configure_flags = $(common_configure_flags) --with-foo
bar_configure_flags = $(common_configure_flags) --with-bar

STAMP_DIR=debian/stamp
BUILD_DIR=debian/build
builddir = $(BUILD_DIR)/$*

configure: $(addprefix $(STAMP_DIR)/configure-stamp-, $(FLAVORS))
$(STAMP_DIR)/configure-stamp-%:
        dh_testdir
        mkdir -p $(builddir)
        cd $(builddir) && \
                CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
                        $(CURDIR)/configure $($*_configure_flags)
        touch $@

build: $(addprefix $(STAMP_DIR)/build-stamp-, $(FLAVORS))
$(STAMP_DIR)/build-stamp-%: $(STAMP_DIR)/configure-stamp-%
        dh_testdir
        $(MAKE) -C $(builddir)
        touch $@

-- 
 .''`.
: :' :      We are debian.org. Lower your prices, surrender your code.
`. `'       We will add your hardware and software distinctiveness to
  `-        our own. Resistance is futile.

Attachment: signature.asc
Description: Ceci est une partie de message =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=


Reply to: