| 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 | See doc/useful_addresses.html for a link to this article. |
|---|
| 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'. There is a separate set of Makefiles |
|---|
| 8 | in the i2c/ directories; these are Simon Vogl's original Makefiles, and |
|---|
| 9 | not referred by the main package Makefile. |
|---|
| 10 | |
|---|
| 11 | There are several interesting targets defined through this Makefile: |
|---|
| 12 | * all |
|---|
| 13 | Create everything in all directories. |
|---|
| 14 | * all-i2c, all-src, ... |
|---|
| 15 | Create everything in the designated directory. |
|---|
| 16 | * install |
|---|
| 17 | Install everything from all directories. |
|---|
| 18 | * install-i2c, install-src, ... |
|---|
| 19 | Install everything in the designated directory. |
|---|
| 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 | * clean-i2c, clean-src, ... |
|---|
| 26 | Remove anything which can be regenerated from the designated directory. |
|---|
| 27 | * dep |
|---|
| 28 | Do nothing, but generate any missing .d files. The command |
|---|
| 29 | 'make clean && make dep' canbe useful in this case ('make clean dep' |
|---|
| 30 | will not work, due to technical reasons!). |
|---|
| 31 | * version |
|---|
| 32 | Regenerate version.h, using the current date for the date-stamp, and |
|---|
| 33 | a user-supplied version number. |
|---|
| 34 | * package |
|---|
| 35 | Create a .tar.gz file containing everything except the CVS directories. |
|---|
| 36 | * src/lm78.o, i2c/i2c-core.o, ... |
|---|
| 37 | You can of course also specify one or more targets to make. |
|---|
| 38 | |
|---|
| 39 | The best way to understand the Module.mk subfiles is to examine one of them, |
|---|
| 40 | for example src/Module.mk. They are not too difficult to understand. |
|---|
| 41 | |
|---|
| 42 | There are several variables which can be set in the main Makefile. You can |
|---|
| 43 | also specify them on the command-line; this overrules any definitions |
|---|
| 44 | within the Makefile. For example: 'make all WARN=1' will enable all warnings. |
|---|
| 45 | Examine main Makefile to see which ones are available. The most important |
|---|
| 46 | ones for developers: |
|---|
| 47 | * WARN |
|---|
| 48 | Set to 1 to enable many compiler warnings. |
|---|
| 49 | * DEBUG |
|---|
| 50 | Set to 1 to enable any debugging code. Note that debugging code should |
|---|
| 51 | only output more information, and never make the code mis-behave. |
|---|
| 52 | |
|---|
| 53 | There are lots of comments within the main Makefile. Please read them if |
|---|
| 54 | you want to know more. |
|---|