| 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 | * install |
|---|
| 13 | Install everything from all directories. |
|---|
| 14 | * uninstall |
|---|
| 15 | Uninstall everything. |
|---|
| 16 | * clean |
|---|
| 17 | Remove anything which can be regenerated from all directories. A call |
|---|
| 18 | of 'make clean' (without any other targets) will ignore any .d files; |
|---|
| 19 | this is useful when they are out of date (and prevent the calling of |
|---|
| 20 | any other target). |
|---|
| 21 | |
|---|
| 22 | The best way to understand the Module.mk subfiles is to examine one of them, |
|---|
| 23 | for example lib/Module.mk. They are not too difficult to understand. |
|---|
| 24 | |
|---|
| 25 | There are several variables which can be set in the main Makefile. You can |
|---|
| 26 | also specify them on the command-line; this overrules any definitions |
|---|
| 27 | within the Makefile. For example: 'make all WARN=1' will enable all warnings. |
|---|
| 28 | Examine main Makefile to see which ones are available. The most important |
|---|
| 29 | ones for developers: |
|---|
| 30 | * WARN |
|---|
| 31 | Set to 1 to enable many compiler warnings. |
|---|
| 32 | * DEBUG |
|---|
| 33 | Set to 1 to enable any debugging code. Note that debugging code should |
|---|
| 34 | only output more information, and never make the code mis-behave. |
|---|
| 35 | |
|---|
| 36 | Several files are generated by Makefiles: |
|---|
| 37 | * .rd |
|---|
| 38 | Dependency files for executables. Automatically generated. |
|---|
| 39 | * .ad |
|---|
| 40 | Dependency files for static libraries. Automatically generated. |
|---|
| 41 | * .ld |
|---|
| 42 | Dependency files for shared libraries. Automatically generated. |
|---|
| 43 | * .ro |
|---|
| 44 | Object files for executables. They will be linked together to create |
|---|
| 45 | the executable. |
|---|
| 46 | * .ao |
|---|
| 47 | Object files for static libraries |
|---|
| 48 | * .lo |
|---|
| 49 | Object files for shared libraries |
|---|
| 50 | The reason for using different extensions is to make the Makefile much |
|---|
| 51 | simpler. |
|---|
| 52 | |
|---|
| 53 | There are lots of comments within the main Makefile. Please read them if |
|---|
| 54 | you want to know more. |
|---|