automake
[Top][All Lists]
Advanced

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

Speeding up config and make


From: Bruce Korb
Subject: Speeding up config and make
Date: Mon, 21 Apr 2003 11:07:46 -0700

I recently dawned on me that there is a simple way to speed
up downloading, configuring and building packages by tweaking
Makefile.am.  Change this:

  foo_SOURCES = ..........

To this:

  foo_src = .............
  nodist_foo_SOURCES = foosrc.c
  EXTRA_DIST = $(foo_src)
  foosrc.c : $(foo_src)
     for f in foo.h $(foo_src) ; do echo "#include \"$$f\"" ; done > $@

It has the following effects:

1.  The resulting makefiles have fewer dependencies.
    They are smaller.  Faster to configure.

2.  There are fewer compilations.  They are much bigger, but
    still take less time overall.

3.  Make runs *much* faster.  There are far fewer dependency
    computations to make.  This savings is *FAR* greater than the
    compile time wasted recompiling unmodified code.  Besides,
    most building is on a clean tree anyway.

4.  The executables are potentially faster because inter-procedural
    optimizations are easier to perform.

5.  Downloads go faster.  The distribution is smaller (marginally).

6.  Changing one file triggers a full recompile.  It's still faster.

7.  It is aesthetically displeasing.

8.  It leads to the following question:

What if "make" were dropped altogether and replaced with a simple
script that simply performed all the build steps all the time?
If it takes less time to recompile the world than compute the
dependency tree, why bother with make at all?  To heck with dependencies.




reply via email to

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