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 | For the clone step to work, you must either provide the --url argument to |
| 14 | gen_makefile like |
| 15 | ./gen_makefile --url git://git.osmocom.org |
| 16 | OR add an SSH config to reach gerrit.osmocom.org as ssh://go; add this to your |
| 17 | ~/.ssh/config: |
| 18 | host go |
| 19 | hostname gerrit.osmocom.org |
| 20 | port 29418 |
| 21 | |
| 22 | |
Neels Hofmeyr | d3707d0 | 2017-09-03 23:57:55 +0200 | [diff] [blame] | 23 | Examples: |
| 24 | |
| 25 | Full 2G and 3G support: |
| 26 | |
Neels Hofmeyr | 00e6a57 | 2017-09-20 19:41:09 +0200 | [diff] [blame] | 27 | ./gen_makefile.py --url=git://git.osmocom.org 3G+2G.deps default.opts iu.opts |
Neels Hofmeyr | d3707d0 | 2017-09-03 23:57:55 +0200 | [diff] [blame] | 28 | |
| 29 | 2G only (requires to pass no-iu.opts), and a custom dir name of 'make-2G': |
| 30 | |
Neels Hofmeyr | 95ea8ec | 2017-09-06 18:54:58 +0200 | [diff] [blame] | 31 | ./gen_makefile.py 2G.deps default.opts -m make-2G |
Neels Hofmeyr | 0a1bdff | 2017-08-13 03:22:42 +0200 | [diff] [blame] | 32 | |
| 33 | This generates a new dir containing a Makefile. When you run make in it, this |
| 34 | will clone the source trees (if not present yet) and build all of them in the |
| 35 | right order: |
| 36 | |
Neels Hofmeyr | 95ea8ec | 2017-09-06 18:54:58 +0200 | [diff] [blame] | 37 | cd make-3G+2G-default+iu |
Neels Hofmeyr | 0a1bdff | 2017-08-13 03:22:42 +0200 | [diff] [blame] | 38 | make |
| 39 | |
| 40 | If you make modifications in one of the source trees, this Makefile will pick |
| 41 | it up, rebuild the project and also rebuild all dependencies (according to the |
| 42 | *.deps file the Makefile was generated from). |
| 43 | |
| 44 | If you modify the *.deps or *.opts file, you can easily run 'make regen' in a |
| 45 | make-* subdir to regenerate the Makefile from the same files. |
| 46 | |
| 47 | In your make-* subdir there are empty status files that are touched for every |
| 48 | completed make target. From these, 'make' can detect what needs to be rebuilt. |
| 49 | You can manually remove them to force a rebuild of a specific target. |
| 50 | |
| 51 | For example, if you 'rm .make.libosmocore.autoconf', libosmocore and all |
| 52 | projects depending on libosmocore will be rebuilt from scratch. |
| 53 | |
| 54 | For more details on the *.opts and *.deps syntax, read the docs at the top of |
| 55 | ./gen_makefile.py. |
| 56 | |
| 57 | It is also easily possible to keep sources and build trees in various |
| 58 | configurations, see the command line options of ./gen_makefile.py. |
Neels Hofmeyr | feeedad | 2017-08-23 00:13:33 +0200 | [diff] [blame] | 59 | |
| 60 | |
Neels Hofmeyr | a0ccef3 | 2017-10-02 00:26:12 +0200 | [diff] [blame] | 61 | === Build Environment |
| 62 | |
| 63 | For dependencies, see |
| 64 | |
| 65 | https://osmocom.org/projects/cellular-infrastructure/wiki/Build_from_Source |
| 66 | |
| 67 | Furthermore, note that the makefiles by default install to /usr/local/*, |
| 68 | so if your system doesn't have this by default, you should probably add |
| 69 | |
| 70 | export LD_LIBRARY_PATH="/usr/local/lib" |
| 71 | |
| 72 | and |
| 73 | |
| 74 | export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" |
| 75 | |
| 76 | to your environment. To use the installed binaries after installation, also |
| 77 | |
| 78 | export PATH="$PATH:/usr/local/bin" |
| 79 | |
| 80 | |
Neels Hofmeyr | feeedad | 2017-08-23 00:13:33 +0200 | [diff] [blame] | 81 | === osmo-uninstall.sh |
| 82 | |
| 83 | Remove osmocom built binaries and headers from given prefix, |
| 84 | default is /usr/local. |
Neels Hofmeyr | f6402d8 | 2017-09-04 04:32:21 +0200 | [diff] [blame] | 85 | |
| 86 | |
| 87 | === src/* |
| 88 | |
| 89 | Find other useful scripts in src/, see src/README. |