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