automake
[Top][All Lists]
Advanced

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

EXTRA_DIST respects Automake conditionals?


From: Ben Pfaff
Subject: EXTRA_DIST respects Automake conditionals?
Date: Wed, 29 Jul 2009 19:57:08 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux)

I was surprised today to discover that EXTRA_DIST respects
Automake conditionals.

In other words, if I have the following Makefile.am:

    AUTOMAKE_OPTIONS = foreign

    EXTRA_DIST =

    if COND
    bin_PROGRAMS = foo
    foo_SOURCES = foo.c
    EXTRA_DIST += EXTRA
    endif

and configure.ac:

    AC_INIT([mumble], [1.0])
    AC_CONFIG_SRCDIR([foo.c])
    AC_CONFIG_FILES([Makefile])
    AM_INIT_AUTOMAKE
    AC_PROG_CC
    AM_CONDITIONAL([COND], [false])
    AC_OUTPUT

then "make dist" will not put EXTRA into the generated tarball.
It will put foo.c into the tarball, though.

Is there an appropriate target to put files that should always be
distributed, regardless of conditionals?  noinst_HEADERS works,
but to me it feels like abuse to use it for this purpose.

For what it's worth, in the actual project where I encountered
this, the usage is more like this:

    if ENABLE_USERSPACE
    ...
    include lib/automake.mk
    include ofproto/automake.mk
    include utilities/automake.mk
    include tests/automake.mk
    include include/automake.mk
    include third-party/automake.mk
    include debian/automake.mk
    include vswitchd/automake.mk
    include xenserver/automake.mk
    if HAVE_CURSES
    if HAVE_PCRE
    include extras/ezio/automake.mk
    endif
    endif
    endif

In other words, I'm using a conditional to disable a great many
features, and it's convenient not to push that conditional down
into all the included files.

Here's the Makefile.am in question:
http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=blob;f=Makefile.am;h=dccb8cfdf92a3dd4dc9f3276e7533f68769587f8;hb=c2b070214097fa40dc78252882d96babe7fab4b4

Thanks,

Ben.
-- 
Ben Pfaff 
http://benpfaff.org




reply via email to

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