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