blob: 2b441db82c6ed5d508fd30ed3df1f5a30a9ba066 [file] [log] [blame]
Neels Hofmeyr569f8ff2018-01-06 21:20:28 +01001=== Quick Start
2
3sudo apt install \
4 build-essential gcc g++ make automake autoconf libtool pkg-config \
5 libtalloc-dev libpcsclite-dev libortp-dev libsctp-dev libssl-dev libdbi-dev \
6 libdbd-sqlite3 libsqlite3-dev libpcap-dev libc-ares-dev libgnutls28-dev \
7 libsctp-dev sqlite3
8
9./gen_makefile.py 3G+2G.deps default.opts iu.opts -I -m make
10
11cd make
12make
13
14- 'make' will ask for sudo password to run 'make install' and 'ldconfig'.
15 To run non-interactively:
16
17 - 'make install':
18 chown $USER: /usr/local
19 Then call gen_makefile.py once without the -I option
20
21 - 'ldconfig':
22 echo "$USER ALL= NOPASSWD: /sbin/ldconfig" > /etc/sudoers.d/ldconfig
23
24
Neels Hofmeyrfeeedad2017-08-23 00:13:33 +020025=== gen_makefile.py
26
Neels Hofmeyr0a1bdff2017-08-13 03:22:42 +020027This provides a set of top-level makefiles to build variants of the Osmocom
28source trees. It is inteded for the core network components and related
29projects, but works generically.
30
31The idea is to have all your Osmocom git clones in ./src, while keeping one or
32more separate build trees in ./make-*.
33
34Run ./gen_makefile.py with a choice of projects (2G only or also 3G?)
Neels Hofmeyrd3707d02017-09-03 23:57:55 +020035and a choice of configure options.
Neels Hofmeyr0a1bdff2017-08-13 03:22:42 +020036
Neels Hofmeyr00e6a572017-09-20 19:41:09 +020037
Neels Hofmeyrd3707d02017-09-03 23:57:55 +020038Examples:
39
40Full 2G and 3G support:
41
Neels Hofmeyr015f3012017-12-10 13:39:08 +010042 ./gen_makefile.py 3G+2G.deps default.opts iu.opts -m make
43 cd make
44 make
Neels Hofmeyrd3707d02017-09-03 23:57:55 +020045
Neels Hofmeyr015f3012017-12-10 13:39:08 +0100462G only, and a custom dir name of 'make-2G':
Neels Hofmeyrd3707d02017-09-03 23:57:55 +020047
Neels Hofmeyr95ea8ec2017-09-06 18:54:58 +020048 ./gen_makefile.py 2G.deps default.opts -m make-2G
Neels Hofmeyr015f3012017-12-10 13:39:08 +010049 cd make-2G
Neels Hofmeyr0a1bdff2017-08-13 03:22:42 +020050 make
51
52If you make modifications in one of the source trees, this Makefile will pick
53it up, rebuild the project and also rebuild all dependencies (according to the
54*.deps file the Makefile was generated from).
55
56If you modify the *.deps or *.opts file, you can easily run 'make regen' in a
57make-* subdir to regenerate the Makefile from the same files.
58
59In your make-* subdir there are empty status files that are touched for every
60completed make target. From these, 'make' can detect what needs to be rebuilt.
61You can manually remove them to force a rebuild of a specific target.
62
63For example, if you 'rm .make.libosmocore.autoconf', libosmocore and all
64projects depending on libosmocore will be rebuilt from scratch.
65
66For more details on the *.opts and *.deps syntax, read the docs at the top of
67./gen_makefile.py.
68
69It is also easily possible to keep sources and build trees in various
70configurations, see the command line options of ./gen_makefile.py.
Neels Hofmeyrfeeedad2017-08-23 00:13:33 +020071
72
Neels Hofmeyra0ccef32017-10-02 00:26:12 +020073=== Build Environment
74
Neels Hofmeyr015f3012017-12-10 13:39:08 +010075For dependencies, see the "External dependencies" on:
Neels Hofmeyra0ccef32017-10-02 00:26:12 +020076
77 https://osmocom.org/projects/cellular-infrastructure/wiki/Build_from_Source
78
Neels Hofmeyr015f3012017-12-10 13:39:08 +010079If /usr/local/ is not writable by your user, pass the --sudo-make-install
80option to gen_makefile.py above (a custom --prefix is not yet supported).
81
82If your system doesn't have this by default, you will need:
Neels Hofmeyra0ccef32017-10-02 00:26:12 +020083
84 export LD_LIBRARY_PATH="/usr/local/lib"
85
86and
87
88 export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
89
90to your environment. To use the installed binaries after installation, also
91
92 export PATH="$PATH:/usr/local/bin"
93
94
Neels Hofmeyrfeeedad2017-08-23 00:13:33 +020095=== osmo-uninstall.sh
96
97Remove osmocom built binaries and headers from given prefix,
98default is /usr/local.
Neels Hofmeyrf6402d82017-09-04 04:32:21 +020099
100
101=== src/*
102
103Find other useful scripts in src/, see src/README.