Commit Graph

45 Commits

Author SHA1 Message Date
Xilokar a1cf1cdc67 gen_makefile.py: fix non absolute path
Renamming the make_to_src_proj variable to src_proj in commit
 93bd52300e leads to the build_to_src variable
being the result of a double call to os.path.relpath(), breaking builds when using
non absolute path for make_dir

Change-Id: I2dfc26da94434558b202475af636ce336349bba9
2022-03-22 09:59:25 +01:00
Oliver Smith 5452c6e901 make: add convenience target cn-bsc-nat
Change-Id: Ia2bdc8df3cbe9de305aba4f7592a2362f3802303
2022-02-25 12:55:21 +01:00
Oliver Smith 5705a69c16 make: add support for "virtphy" from osmocom-bb
Change-Id: Id4e7a9d948332c03d56e2637badeef78c78e5aa7
2022-02-25 12:55:21 +01:00
Oliver Smith 93bd52300e make: add support for "mobile" from osmocom-bb
Allow building and installing the "mobile" application from
osmocom-bb.git's src/host/layer23 dir.

Change-Id: Ic75cca703e317eaee593b4d6c78784309c056f17
2022-02-25 12:55:21 +01:00
Oliver Smith 107f35d3da gen_makefile.py: follow symlinks with find
Prepare for the next patch, with which {src_proj} may be a subdir in
osmocom-bb.

Change-Id: Ie15e74e61b16cef5e189e4e2a272b7d2061547c6
2022-02-25 12:55:21 +01:00
Oliver Smith ca0d2900be gen_makefile.py: mark convenience targets as phony
Change-Id: Idd7e485e17b178f1bf6feef5d30db57e6467267e
2022-02-25 12:55:21 +01:00
Oliver Smith 84df01adb8 gen_makefile.py: fix find errors
Don't print find errors if not all dirs were cloned. Found this also
while running osmo-dev on a fresh install.

Change-Id: I7955fedc96484e5703073b63906a03477452db6e
2021-12-10 17:22:58 +01:00
Oliver Smith adfa0c0cf1 gen_makefile.py: add --auto-distclean
Add a new option that avoids stopping the build with:
  configure: error: source directory already configured; run "make distclean" there first

I run into this frequently, when e.g. running './configure; make release'
inside Osmocom repositories and then attempting to build them with
osmo-dev. It is annoying as it does not fail immediatelly, and I need to
manually go to the source directories where it failed, run 'make
distclean' and then attempt to build again. Then it may fail on another
directory with the same problem.

Check for config.status, as that is also what ./configure checks for
before printing the error.

Change-Id: Iac71333e8c5da8dee4e8f34e2af8db12d2c08021
2021-11-12 15:51:38 +01:00
Oliver Smith f7f8c96e7b gen_makefile.py: proj_files: ignore config.h
Do not consider config.h inside the source tree as modified source file.
This file gets generated when running ./configure to build in-tree,
whereas osmo-dev always builds out-of-tree.

Having config.h inside proj_files causes problems with the next patch,
where conflicting in-tree builds will be automatically be cleaned with
"make distclean". For example:
* "make libosmocore" runs with a previously configured in-tree build
* proj_files contains config.h.
* Before attempting to build libosmocore out-of-tree, with the next
  patch, "make distclean" gets executed.
* config.h is now removed
* .make.libosmocore.build target expects all proj_files to exist and
   fails with:
   make: *** No rule to make target '../src/libosmocore/config.h', needed by '.make.libosmocore.build'.  Stop.

Change-Id: I10d970f2cadacb5071dcde975c76b15404038a3c
2021-11-12 15:51:38 +01:00
Neels Hofmeyr 2325e2e3a9 gen_makefile: add 'CFLAGS=-g' option --build-debug 2021-10-23 20:45:12 +02:00
Oliver Smith 505f60de3d gen_makefile.py: reformat find cmds in Makefile
Change-Id: Ic2fad22fdbf0fec4abfaeae60b4ebd74563a9392
2021-10-11 08:11:58 +02:00
Oliver Smith 0a4d8ea698 gen_makefile.py: drop argument for deps file
Rename 3G+2G.deps to all.deps and remove the parameter from
gen_makefile.py. Create new Makefile targets for the various use cases,
usually we build either 'cn-bsc' or 'usrp'. The next patch will add more
projects to all.deps.

This change brings the Makefile logic closer to how it is actually used,
one build directory that is building most Osmocom projects. New projects
can be added to all.deps on demand, but then we have it in the
repository and not just a local change that we add temporarily to the
3G+2G.deps file when we need to build a specific project.

Extend all.deps with projects needed by ttcn3.sh, so it doesn't need to
write its custom .deps file anymore.

Change-Id: I6394882f67eecda3d2c03a97d3119657f7d3873f
2021-09-21 16:52:02 +02:00
Oliver Smith c47eafbe0a gen_makefile.py: add --docker-cmd argument
To be used by ttcn3.sh to run the actual build inside docker. ttcn3.sh
runs the programs built by osmo-dev inside docker with the exact
configs that we use on jenkins.osmocom.org, but so far it builds the
component outside of docker. But building inside docker is necessary to
avoid incompatibilities between the host system and the docker
containers (e.g. different glibc).

Change-Id: Ibd20f0e0e2a5105085066a9f04b5868c68691024
2021-08-13 09:17:39 +02:00
Oliver Smith b3ae4b60ff gen_makefile.py: regen: put args in own lines
Make it easier to adjust opts before running 'make regen'.

Change-Id: I3c537ca9cd876e62547efca1ea40f31e90d8761e
2021-02-01 14:45:22 +01:00
Vadim Yanitskiy d9cdec6afb gen_makefile.py: fix echo: add -e to enable backslash escapes
I guess it's enabled by default in some distributions like Debian,
but at least for Arch Linux it needs to be enabled using '-e'.

Change-Id: Ie9c0657c9decb83bf8531ce1a0e97c27ee7008bb
2020-09-16 01:19:25 +00:00
Neels Hofmeyr 0ec459258a don't trigger rebuild on config.h.in
Lately I'm seeing unecessary rebuilds because config.h.in is newer than the
./configure file. The rule to trigger on *.in files is intended for "manual"
.in files, not those from autoconf/automake. Exclude config.h.in.
2019-07-12 01:22:50 +02:00
Neels Hofmeyr 44543a98b0 gen_makefile: fix deps: add *.map (for e.g. libosmogsm.map)
Change-Id: I7bc2b5889213a1c635d039d4c6b577f6b4766d7f
2019-03-10 21:08:46 +01:00
Neels Hofmeyr a4fefee68d gen_makefile: add *.tpl to dependency file list
libosmocore has some *.tpl files to generate source files. Add *.tpl to
dependencies.

Change-Id: Id12fa34e58ef223820528c47e23f9d4bdb2dd3bc
2019-02-12 15:08:30 +01:00
Neels Hofmeyr 6257d9ec79 gen_makefile: fix dependency file list
The configure step naturally depends on Makefile.am and *.in files. However,
the automake process also generates Makefile.in files: exclude those from *.in.

This fixes spurious unnecessary rebuilds: especially when libosmocore had
modifications, it often rebuilt *twice* after this (causing all of the other
source trees to rebuild as well).

Change-Id: Ia6f48ac9a8b300440d23c9b495fb39b5e40b59d8
2019-02-12 15:08:22 +01:00
Oliver Smith 5c882f66e9 gen_makefile.py: detect changes in cpp files
Properly rebuild when cpp files (e.g. from osmo-trx) have been changed.

Change-Id: I9382d984fa1988eefbb6be3e45d88b2f1f5b598a
2018-10-31 14:13:34 +01:00
Neels Hofmeyr a007eaa405 gen_makefile: add ALL config opts keyword 2018-09-04 14:37:38 +02:00
Neels Hofmeyr 6d16ae9bad gen_makefile: mark project name as phony target 2018-09-04 14:37:38 +02:00
Neels Hofmeyr f6078c49c0 gen_makefile: add --no-make-check 2018-09-04 14:37:38 +02:00
Neels Hofmeyr 7bd5c31c4e sync before touching .make.* files 2018-07-26 16:43:01 +02:00
Neels Hofmeyr 2e65707b57 gen_makefile.py: libsmpp34 can build in parallel now 2018-05-29 12:24:34 +02:00
Neels Hofmeyr 1fa9b2989e rm .version with -f 2018-04-23 17:04:25 +02:00
Neels Hofmeyr 4d38c1e77b add reinstall 2018-04-23 17:04:15 +02:00
Neels Hofmeyr 29fde6ff8e gen_makefile: accomodate openbsc's extra subdir 2018-04-01 15:57:02 +02:00
Neels Hofmeyr 972c2945e2 gen_makefile: fix empty push-url for 'make regen' 2018-03-16 03:49:58 +01:00
Neels Hofmeyr 1b0d34f77a produced Makfile: add all_debug target to see rebuild reasons 2018-03-16 03:46:08 +01:00
Neels Hofmeyr 28d4be5520 gen_makefile: add --push-url option 2018-03-16 03:44:07 +01:00
Neels Hofmeyr 2535a26046 gen_makefile: add example to end of --help 2018-01-16 16:34:32 +01:00
Neels Hofmeyr 367cb97e2a gen_makefile: be less aggressive on rebuilding everything on edits
Change-Id: Ie740eee5374e258e721da109eca8f0444eb3ebc3
2017-12-15 04:01:13 +01:00
Neels Hofmeyr 461c3bdc1d call 'sudo ldconfig' by default, allow configuring 'sudo make install'
Add options to decide whether ldconfig should be called or not, whether with
sudo or not, and also whether to call 'make install' with sudo or not.

Change-Id: I0771c78159edfa312aa320f18d9f6346c3b8adba
2017-12-06 00:32:15 +01:00
Neels Hofmeyr bffdc30b74 set default URL to git.osmocom.org
Change-Id: If0d46feb7f76d59c4e37fa63a894081f5f9210ad
2017-12-06 00:31:49 +01:00
Neels Hofmeyr 7f586cf5d3 drop .version on autoconf step
Change-Id: I25a73ed5537d025607cb7a1bedf0e50fd1c2a654
2017-11-14 09:43:27 +01:00
Neels Hofmeyr 1c1e4d2b75 gen_makefile: improve detect-edits dependency
Put the list of files to monitor directly in the makefile dependencies instead.
Now it finally works for 'make -j'.

Change-Id: Ie9b8c52bffcced4c8e482b43f6f9b5fdd93f61aa
2017-09-11 05:24:45 +02:00
Neels Hofmeyr 3f93412537 gen_makefile: provide project target by name
Change-Id: Ic09c11e5f53004e31910adeffc4d021ea5a7163e
2017-08-29 13:49:07 +02:00
Neels Hofmeyr 277f479b17 gen_makefile: provide overall 'clean' target
Change-Id: I746234eb458da41b86fe9571915a2e942daa26ee
2017-08-29 13:49:07 +02:00
Neels Hofmeyr 2509d09ddf gen_makefile: tweak edit detector
Change-Id: I6a1753e24b29226894fdfcac8132910501a633b8
2017-08-28 15:17:58 +02:00
Neels Hofmeyr d4d8848dcf cosmetic: gen_makefile: place vim indenting rule comment 2017-08-22 19:27:28 +02:00
Neels Hofmeyr 450dac79c3 gen_makefile: allow combining several .opts files 2017-08-22 19:27:08 +02:00
Neels Hofmeyr 20e169f4b5 gen_makefile: set 'clone' as dep for 'all', to always clone first 2017-08-22 17:31:35 +02:00
Neels Hofmeyr e274d351f5 gen_makefile: add 'clone' target to first clone all repositries 2017-08-22 17:31:03 +02:00
Neels Hofmeyr 0a1bdfff8f initial gen_makefile.py with config 2017-08-22 15:25:13 +02:00