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