The build system uses autoconf 2.57 and automake
1.7. You should modify only the Makefile.am
files, which
generate the Makefile.in
files (and
the configure
script produced by autoconf will generate the
Makefile
s from those). If you don't have automake (or not a
new enough version), the build system will warn you and continue without
regenerating Makefile.in
. (When checking out from CVS or
extracting from a source distribution, sometimes make
will
think that the makefile.in
files need to be regenerated
because they have the same timestamp as Makefile.am
. If
this happens just ignore the warnings.)
Much of these instructions are generic to automake but are provided here for convenience.
The top-level Makefile.am
contains the
SUBDIRS=
line which sets up directory recursion, and
the rules for creating source distributions.
Each subdirectory's Makefile.am
contains the rules for
making the binaries and libraries in that directory and any extra
files to distribute.
Usually you will want to run make
from the toplevel
(the directory containing the file configure
), but
sometimes it is useful to run make
and make
check
in certain subdirectories.
Automake takes care of all dependency issues.
Calling make
will automagically regenerate the
dependencies themselves as necessary. This includes source
dependencies (on header files) as well as Makefile dependencies
(Makefile
depends on Makefile.in
which
depends on Makefile.am
).
If you create a new directory with another Makefile.am
,
you should A) make sure the directory is referenced by
a SUBDIRS=
line from its
parent Makefile.am
and B) add it to the
AC_CONFIG_FILES directive in configure.ac
.
To compile, use the usual
./configure make
Example using multiple build directories under a single source
directory (assuming the same directory is mounted
on milkyway
and shaggy
):
milkyway$ mkdir build milkyway$ mkdir build/solaris2.7 milkyway$ cd build/solaris2.7 milkyway$ ../../configure milkyway$ make milkyway$ mkdir build/solaris2.7-gcc3 milkyway$ cd build/solaris2.7-gcc3 milkyway$ ../../configure CC=/opt/misc/gcc-3.0.4/bin/gcc CXX=/opt/misc/gcc-3.0.4/bin/g++ milkyway$ make shaggy$ mkdir build/linux shaggy$ cd build/linux shaggy$ ../../configure shaggy$ make
To test the code:
make check(This runs the php-based tests in the
test
directory)
The version number is set in the line
AC_INIT(BOINC, 1.03)in
configure.ac
. If you change this,
run make
and it will rebuild necessary files to
propagate the version number into source files and scripts. This is
the only location the version number is set; all other uses of it
come from here (no environment variables used).
To make source distributions:
make dist
This will make .tar.gz
, .tar.bz2
,
and .zip
files. You can also make only the individual
ones using the make
targets dist-bzip2
, dist-gzip
, dist-zip
.
The source distributions contain everything necessary to build and
run the server, and also remake distributions.
(There used to be a separate client distribution requiring complicated rules for picking subdirectories to compile and distribute, but it has been obsoleted because few people will download the distribution to build only the client.)
There is also a very handy target:
make distcheckIn a temporary directory,
make
will extract the
distribution tarball, make all
, make
check
, make install
(to another temporary
directory). This simulates what the developer end-user can do with
the tarball.
To clean out built object files:
make cleanTo clean out built object files and generated files such as
Makefile.in
:
make distclean