util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: util-linux <util-linux@vger.kernel.org>
Subject: non-recursive build system
Date: Tue, 12 Jun 2012 12:03:40 +0200	[thread overview]
Message-ID: <20120612100340.GB23991@x2.net.home> (raw)



 The original version was implemented by Diego Elio 'Flameeyes' Pettenò
 two years ago:
     http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/3297

 See also:
     http://www.flameeyes.eu/autotools-mythbuster/automake/nonrecursive.html

 My current version is available at github, 'non-recursive' branch:
     https://github.com/karelzak/util-linux/commits/non-recursive


 Notes:

 * generate one Makefile for whole package

 * make(1) has all information to run tasks in parallel 

 * numbers (make -j)

             recursive | non-recursive
             ----------+--------------
    2 cores: 14.5 sec  | 13.2 sec
   16 cores:  9.5 sec  |  4.3 sec

   (... more CPU cores means more fun;-)

 * automake variables and rules are defined in subdir/Makemodule.am files
   (create one huge Makefile.am is too crazy idea)

 * top-level Makefile.am includes all Makemodule.am files

 * $(top_srcdir) prefix for lib/ and include/ is unnecessary, just use
   lib/bar.c and include/bar.h in makefiles

 * lib/ has been converted to libcommon.la, it means that
       foo_LDADD = libcommon.la
   is enough to use arbitrary stuff from lib/.

 * all rules are interpreted from top-level directory, it means that
       cd subdir; make
   or
       make -C subdir
   does not work.

 * binaries are stored in top-level (build) directory, you don't
   have to care about directories, just type:

	$ make mount
	$ ./mount --help

 * all build targets (including test binaries) are visible for bash completion
   scripts (e.g. /etc/bash_completion.d/make), so <tab> is your good friend


 * disadvantages:

    - full paths in makefiles (e.g. foo_SOURCE = subdir/foo.c)

    - we can't use the same name for subdir/ and for a final binary
      Necessary changes:

       - remove partx/ directory, move partx.c to disk-utils/
       - remove getopt/ directory, move getopt.c to misc-utils/
       - remove hwclock/ directory, move hwclock.c to sys-utils/
       - rename fdisk/ to fdisks/
       - rename mount/ to mount-deprecated/ (we use new sys-utils/mount.c)

      Note that consolidate the code and remove some subdirs (e.g. getopt/) is
      probably a good idea independently on the build-system changes.


 Comments & objections?

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

             reply	other threads:[~2012-06-12 10:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-12 10:03 Karel Zak [this message]
2012-06-12 12:57 ` non-recursive build system Davidlohr Bueso
2012-06-12 15:18   ` Karel Zak
2012-06-12 19:26     ` Davidlohr Bueso
2012-06-27  9:30 ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120612100340.GB23991@x2.net.home \
    --to=kzak@redhat.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).