Matthias Andreas Benkard | f59e097 | 2018-04-10 22:01:34 +0200 | [diff] [blame] | 1 | For detailed information on using, building, and modifying Weld, please visit: |
| 2 | http://www.agottem.com/weld |
| 3 | |
| 4 | Weld is a build system for GNU make. It is an implementation of a non-recursive make system. Weld |
| 5 | is intended for C and C++ projects, however, could be easily extended to other languages. Weld is |
| 6 | designed to work on Linux or FreeBSD using GCC and Windows using MinGW. |
| 7 | |
| 8 | To start using Weld, first create a directory to host all the source for your project. A typical |
| 9 | project is expected to be composed of many libraries and binaries with a single top level makefile. |
| 10 | An example layout may be something like: |
| 11 | |
| 12 | my_project/ |
| 13 | makefile |
| 14 | |
| 15 | libs/ |
| 16 | gui/ |
| 17 | graph/ |
| 18 | def.mk |
| 19 | source/... |
| 20 | include/... |
| 21 | button/ |
| 22 | def.mk |
| 23 | source/... |
| 24 | include/... |
| 25 | data/ |
| 26 | compute/ |
| 27 | compute.mk |
| 28 | source/... |
| 29 | include/... |
| 30 | bins/ |
| 31 | my_app/ |
| 32 | def.mk |
| 33 | source/... |
| 34 | |
| 35 | The above example lays out a project with a handful of libs and a binary. To build, simply type |
| 36 | make at the top-level. Weld will do a simple find for any files name "def.mk". Each "def.mk" is |
| 37 | then included and a complete dependency tree is constructed. This means make knows how every build |
| 38 | artifact is related and what order things need to be built in. If make's "-j" option is used you'll |
| 39 | perform a build with optimal parallelization. |
| 40 | |
| 41 | Additionally, because the full dependency tree is known, incremental builds will only ever build |
| 42 | precisely what is needed. If dependencies haven't changed, no time will be wasted needlessly |
| 43 | rebuilding components. |
| 44 | |
| 45 | In addition to Weld generating a complete dependency tree for you, it'll also define useful targets. |
| 46 | For instance, "make libcompute.a" will build just the compute library and any dependencies. "make |
| 47 | my_app" will build just my_app and any dependencies. "make clean" will clean the project. |
| 48 | |
| 49 | For details on specifying def.mk files, see the "c.def.mk.template" or "resource.def.mk.template" |
| 50 | files. For insight into the weld command line, see the "command_line.txt" file. |