Neels Hofmeyr | feeedad | 2017-08-23 00:13:33 +0200 | [diff] [blame] | 1 | === gen_makefile.py |
| 2 | |
Neels Hofmeyr | 0a1bdff | 2017-08-13 03:22:42 +0200 | [diff] [blame] | 3 | This provides a set of top-level makefiles to build variants of the Osmocom |
| 4 | source trees. It is inteded for the core network components and related |
| 5 | projects, but works generically. |
| 6 | |
| 7 | The idea is to have all your Osmocom git clones in ./src, while keeping one or |
| 8 | more separate build trees in ./make-*. |
| 9 | |
| 10 | Run ./gen_makefile.py with a choice of projects (2G only or also 3G?) |
Neels Hofmeyr | d3707d0 | 2017-09-03 23:57:55 +0200 | [diff] [blame] | 11 | and a choice of configure options. |
Neels Hofmeyr | 0a1bdff | 2017-08-13 03:22:42 +0200 | [diff] [blame] | 12 | |
Neels Hofmeyr | 00e6a57 | 2017-09-20 19:41:09 +0200 | [diff] [blame] | 13 | |
Neels Hofmeyr | d3707d0 | 2017-09-03 23:57:55 +0200 | [diff] [blame] | 14 | Examples: |
| 15 | |
| 16 | Full 2G and 3G support: |
| 17 | |
Neels Hofmeyr | 015f301 | 2017-12-10 13:39:08 +0100 | [diff] [blame^] | 18 | ./gen_makefile.py 3G+2G.deps default.opts iu.opts -m make |
| 19 | cd make |
| 20 | make |
Neels Hofmeyr | d3707d0 | 2017-09-03 23:57:55 +0200 | [diff] [blame] | 21 | |
Neels Hofmeyr | 015f301 | 2017-12-10 13:39:08 +0100 | [diff] [blame^] | 22 | 2G only, and a custom dir name of 'make-2G': |
Neels Hofmeyr | d3707d0 | 2017-09-03 23:57:55 +0200 | [diff] [blame] | 23 | |
Neels Hofmeyr | 95ea8ec | 2017-09-06 18:54:58 +0200 | [diff] [blame] | 24 | ./gen_makefile.py 2G.deps default.opts -m make-2G |
Neels Hofmeyr | 015f301 | 2017-12-10 13:39:08 +0100 | [diff] [blame^] | 25 | cd make-2G |
Neels Hofmeyr | 0a1bdff | 2017-08-13 03:22:42 +0200 | [diff] [blame] | 26 | make |
| 27 | |
| 28 | If you make modifications in one of the source trees, this Makefile will pick |
| 29 | it up, rebuild the project and also rebuild all dependencies (according to the |
| 30 | *.deps file the Makefile was generated from). |
| 31 | |
| 32 | If you modify the *.deps or *.opts file, you can easily run 'make regen' in a |
| 33 | make-* subdir to regenerate the Makefile from the same files. |
| 34 | |
| 35 | In your make-* subdir there are empty status files that are touched for every |
| 36 | completed make target. From these, 'make' can detect what needs to be rebuilt. |
| 37 | You can manually remove them to force a rebuild of a specific target. |
| 38 | |
| 39 | For example, if you 'rm .make.libosmocore.autoconf', libosmocore and all |
| 40 | projects depending on libosmocore will be rebuilt from scratch. |
| 41 | |
| 42 | For more details on the *.opts and *.deps syntax, read the docs at the top of |
| 43 | ./gen_makefile.py. |
| 44 | |
| 45 | It is also easily possible to keep sources and build trees in various |
| 46 | configurations, see the command line options of ./gen_makefile.py. |
Neels Hofmeyr | feeedad | 2017-08-23 00:13:33 +0200 | [diff] [blame] | 47 | |
| 48 | |
Neels Hofmeyr | a0ccef3 | 2017-10-02 00:26:12 +0200 | [diff] [blame] | 49 | === Build Environment |
| 50 | |
Neels Hofmeyr | 015f301 | 2017-12-10 13:39:08 +0100 | [diff] [blame^] | 51 | For dependencies, see the "External dependencies" on: |
Neels Hofmeyr | a0ccef3 | 2017-10-02 00:26:12 +0200 | [diff] [blame] | 52 | |
| 53 | https://osmocom.org/projects/cellular-infrastructure/wiki/Build_from_Source |
| 54 | |
Neels Hofmeyr | 015f301 | 2017-12-10 13:39:08 +0100 | [diff] [blame^] | 55 | If /usr/local/ is not writable by your user, pass the --sudo-make-install |
| 56 | option to gen_makefile.py above (a custom --prefix is not yet supported). |
| 57 | |
| 58 | If your system doesn't have this by default, you will need: |
Neels Hofmeyr | a0ccef3 | 2017-10-02 00:26:12 +0200 | [diff] [blame] | 59 | |
| 60 | export LD_LIBRARY_PATH="/usr/local/lib" |
| 61 | |
| 62 | and |
| 63 | |
| 64 | export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" |
| 65 | |
| 66 | to your environment. To use the installed binaries after installation, also |
| 67 | |
| 68 | export PATH="$PATH:/usr/local/bin" |
| 69 | |
| 70 | |
Neels Hofmeyr | feeedad | 2017-08-23 00:13:33 +0200 | [diff] [blame] | 71 | === osmo-uninstall.sh |
| 72 | |
| 73 | Remove osmocom built binaries and headers from given prefix, |
| 74 | default is /usr/local. |
Neels Hofmeyr | f6402d8 | 2017-09-04 04:32:21 +0200 | [diff] [blame] | 75 | |
| 76 | |
| 77 | === src/* |
| 78 | |
| 79 | Find other useful scripts in src/, see src/README. |