automake
[Top][All Lists]
Advanced

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

Non-recursive automake and double-colon rules


From: Roger Leigh
Subject: Non-recursive automake and double-colon rules
Date: Sun, 24 Mar 2013 11:33:57 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

Just a suggestion for the documentation:

If you switch to non-recursive make (i.e. no use of SUBDIRS),
but you want to use "include" to retain Makefile.ams in
subdirectories, you end up running into problems when you
have multiple copies of -local and -hook rules.

For example, I have

% grep include Makefile.am
include $(top_srcdir)/scripts/global.mk
include $(top_srcdir)/scripts/git-dist.mk
include etc/Makefile.am
include etc/pam/Makefile.am
include etc/setup.d/Makefile.am
include etc/bash_completion/Makefile.am
include contrib/setup.d/Makefile.am
include doc/Makefile.am
include doc/historical/Makefile.am
include man/Makefile.am
include sbuild/Makefile.am
include bin/schroot-listmounts/Makefile.am
include bin/dchroot-dsa/Makefile.am
include bin/csbuild/Makefile.am
include bin/dchroot/Makefile.am
include bin/schroot-sbuild/Makefile.am
include bin/schroot-releaselock/Makefile.am
include bin/schroot-base/Makefile.am
include bin/schroot-mount/Makefile.am
include bin/schroot/Makefile.am
include test/Makefile.am

% git grep -E '(-hook|-local):'
Makefile.am:dist-hook::
bin/csbuild/Makefile.am:install-exec-hook::
bin/dchroot-dsa/Makefile.am:install-exec-hook::
bin/dchroot/Makefile.am:install-exec-hook::
bin/schroot-sbuild/Makefile.am:install-exec-hook::
bin/schroot/Makefile.am:install-exec-hook::
bin/schroot/Makefile.am:install-data-hook::
doc/Makefile.am:clean-local::
etc/Makefile.am:all-local:: profiles
etc/Makefile.am:install-data-hook::
etc/Makefile.am:clean-local::
etc/setup.d/Makefile.am:install-exec-hook::
man/Makefile.am:clean-local::
man/Makefile.am:all-local:: man-update-po $(TRANSMAN)
man/Makefile.am:dist-hook:: man-update-po
test/Makefile.am:clean-local::

I've used GNU make double-colon rules to allow the same target to be
used multiple times.  While this is GNU make-specific, it's a simple
and effective way to convert an existing recursive automake setup to
being nonrecursive.  Possibly worth putting in the documentation (along
with a portability caveat?)

I'd be interested to know what other people's experiences have been
here.  While I could move everything into the top-level Makefile.am,
keeping rules together with the files they operate on does have some
advantages.

What about po/Makefile.in.in?  Is there a nonrecursive variant of this
available?

The nonrecursive build is massively faster than the old recursive
build, so quite a worthwhile improvement for this project!


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux    http://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-    GPG Public Key      F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800



reply via email to

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