| 1 |
The Makefiles in this package are rather advanced. They are partially based |
|---|
| 2 |
on the article "Recursive Make considered Harmful", written by Peter Miller: |
|---|
| 3 |
http://miller.emu.id.au/pmiller/books/rmch/ |
|---|
| 4 |
|
|---|
| 5 |
There is one big Makefile in the root of this package. It includes many |
|---|
| 6 |
other files; one for each directory in which source code is found. These |
|---|
| 7 |
included files are called 'Module.mk'. |
|---|
| 8 |
|
|---|
| 9 |
There are several interesting targets defined through this Makefile: |
|---|
| 10 |
* all |
|---|
| 11 |
Create everything in all directories. |
|---|
| 12 |
* user |
|---|
| 13 |
Build only user-space tools. |
|---|
| 14 |
* install |
|---|
| 15 |
Install everything from all directories. |
|---|
| 16 |
* user_install |
|---|
| 17 |
Install only user-space tools. |
|---|
| 18 |
* user_uninstall |
|---|
| 19 |
Uninstall user-space tools. |
|---|
| 20 |
* clean |
|---|
| 21 |
Remove anything which can be regenerated from all directories. A call |
|---|
| 22 |
of 'make clean' (without any other targets) will ignore any .d files; |
|---|
| 23 |
this is useful when they are out of date (and prevent the calling of |
|---|
| 24 |
any other target). |
|---|
| 25 |
* version |
|---|
| 26 |
Regenerate version.h, using the current date for the date-stamp, and |
|---|
| 27 |
a user-supplied version number. |
|---|
| 28 |
* package |
|---|
| 29 |
Create a .tar.gz file containing everything except the SVN directories. |
|---|
| 30 |
|
|---|
| 31 |
The best way to understand the Module.mk subfiles is to examine one of them, |
|---|
| 32 |
for example lib/Module.mk. They are not too difficult to understand. |
|---|
| 33 |
|
|---|
| 34 |
There are several variables which can be set in the main Makefile. You can |
|---|
| 35 |
also specify them on the command-line; this overrules any definitions |
|---|
| 36 |
within the Makefile. For example: 'make all WARN=1' will enable all warnings. |
|---|
| 37 |
Examine main Makefile to see which ones are available. The most important |
|---|
| 38 |
ones for developers: |
|---|
| 39 |
* WARN |
|---|
| 40 |
Set to 1 to enable many compiler warnings. |
|---|
| 41 |
* DEBUG |
|---|
| 42 |
Set to 1 to enable any debugging code. Note that debugging code should |
|---|
| 43 |
only output more information, and never make the code mis-behave. |
|---|
| 44 |
|
|---|
| 45 |
Several files are generated by Makefiles: |
|---|
| 46 |
* .d |
|---|
| 47 |
Dependency files for modules. Automatically generated. |
|---|
| 48 |
* .rd |
|---|
| 49 |
Dependency files for executables. Automatically generated. |
|---|
| 50 |
* .ad |
|---|
| 51 |
Dependency files for static libraries. Automatically generated. |
|---|
| 52 |
* .ld |
|---|
| 53 |
Dependency files for shared libraries. Automatically generated. |
|---|
| 54 |
* .o |
|---|
| 55 |
Generated modules |
|---|
| 56 |
* .ro |
|---|
| 57 |
Object files for executables. They will be linked together to create |
|---|
| 58 |
the executable. This extension is used to distinguish them from |
|---|
| 59 |
modules (which end on .o). Also, using a different extensions makes |
|---|
| 60 |
the Makefile fragments much simpler. |
|---|
| 61 |
* .ao |
|---|
| 62 |
Object files for static libraries |
|---|
| 63 |
* .lo |
|---|
| 64 |
Object files for shared libraries |
|---|
| 65 |
|
|---|
| 66 |
There are lots of comments within the main Makefile. Please read them if |
|---|
| 67 |
you want to know more. |
|---|