util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* non-recursive build system
@ 2012-06-12 10:03 Karel Zak
  2012-06-12 12:57 ` Davidlohr Bueso
  2012-06-27  9:30 ` Karel Zak
  0 siblings, 2 replies; 5+ messages in thread
From: Karel Zak @ 2012-06-12 10:03 UTC (permalink / raw)
  To: util-linux



 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-06-27  9:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-12 10:03 non-recursive build system Karel Zak
2012-06-12 12:57 ` Davidlohr Bueso
2012-06-12 15:18   ` Karel Zak
2012-06-12 19:26     ` Davidlohr Bueso
2012-06-27  9:30 ` Karel Zak

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).