]> git.saurik.com Git - apt.git/blame - README.make
Fixed pthread test
[apt.git] / README.make
CommitLineData
93641593
AL
1The Make System
2~~~ ~~~~ ~~~~~~
3To compile this program you require GNU Make. In fact you probably need
4GNU Make 3.76.1 or newer. The makefiles contained make use of many
5GNU Make specific features and will not run on other makes.
6
7The make system has a number of interesting properties that are not found
8in other systems such as automake or the GNU makefile standards. In
9general some semblance of expectedness is kept so as not to be too
10surprising. Basically the following will work as expected:
11
12 ./configure
13 make
14 or
15 cd build
16 ../configure
17 make
18
19There are a number of other things that are possible that may make software
20development and software packaging simpler. The first of these is the
21environment.mak file. When configure is run it creates an environment.mak
22file in the build directory. This contains -all- configurable parameters
23for all of the make files in all of the subdirectories. Changing one
24of these parameters will have an immediate effect. The use of makefile.in
25and configure substitutions across build makefiles is not used at all.
26
27Furthermore, the make system runs with a current directory equal to the
28source directory irregardless of the destination directory. This means
29#include "" and #include <> work as epected and more importantly
30running 'make' in the source directory will work as expected. The
31environment variable or make parameter 'BUILD' sets the build directory.
32It may be an absolute path or a path relative to the top level directory.
33By default build/ will be used with a fall back to ./ This means
34you can get all the advantages of a build directory without having to
35cd into it to edit your source code!
36
37The make system also performs dependency generation on the fly as the
38compiler runs. This is extremely fast and accurate. There is however
39one failure condition that occures when a header file is erased. In
40this case you should run make clean to purge the .o and .d files to
41rebuild.
42
43The final significant deviation from normal make practicies is
44in how the build directory is managed. It is not mearly a mirror of
45the source directory but is logically divided in the following manner
46 bin/
47 methods/
48 doc/
49 examples/
50 include/
51 apt-pkg/
52 deity/
53 obj/
54 apt-pkg/
55 deity/
56 cmndline/
57 [...]
58Only .o and .d files are placed in the obj/ subdirectory. The final compiled
59binaries are placed in bin, published headers for inter-component linking
60are placed in include/ and documentation is generated into doc/. This means
61all runnable programs are within the bin/ directory a huge benifit for
62debugging inter-program relationships. The .so files are also placed in
63bin/ for simplicity.
64
65Using the makefiles
66~~~~~ ~~~ ~~~~~~~~~
67The makefiles for the components are really simple. The complexity is hidden
68within the buildlib/ directory. Each makefile defines a set of make variables
69for the bit it is going to make then includes a makefile fragment from
70the buildlib/. This fragment generates the necessary rules based on the
71originally defined variables. This process can be repeated as many times as
72necessary for as many programs or libraries as are in the directory.
73
74Many of the make fragments have some useful properties involving sub
75directories and other interesting features. They are more completely
76described in the fragment code in buildlib. Some tips on writing fragments
77are included in buildlib/defaults.mak
78
79Jason