osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-dev/+/42971?usp=email )
Change subject: Support building onomondo-eim ......................................................................
Support building onomondo-eim
The onomondo-eim project is an erlang project, but it does not have a Makefile like the others. Run rebar3 directly in that case.
I've also considered always doing this instead of running the Makefile, but that would break osmo-s1gw, which needs to run "rebar3 asn compile" before "rebar3 compile" as its Makefile does it.
Change-Id: I551e0b88110ed20fdbc301035fc3dac6e0d83635 --- M all.buildsystems M all.deps M gen_makefile.py 3 files changed, 15 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/71/42971/1
diff --git a/all.buildsystems b/all.buildsystems index 63eab23..d851f3b 100644 --- a/all.buildsystems +++ b/all.buildsystems @@ -10,3 +10,5 @@ pyosmocom python pysctp python pyhss python + +onomondo-eim erlang diff --git a/all.deps b/all.deps index f5148ca..dab8565 100644 --- a/all.deps +++ b/all.deps @@ -68,3 +68,5 @@ pyosmocom gsm0338 pysctp pyhss comp128-python pyosmocom pysctp + +onomondo-eim diff --git a/gen_makefile.py b/gen_makefile.py index 4ee5290..e573f1c 100755 --- a/gen_makefile.py +++ b/gen_makefile.py @@ -420,13 +420,21 @@ touch $@ ''' elif buildsystem == "erlang": + check_cmd = "rebar3 eunit" if args.make_check else "true" return f''' .make.{proj}.build: .make.{proj}.configure $({proj}_files) @echo "\n\n\n===== $@\n" set -x && \ export REBAR_BASE_DIR="$$PWD/{build_proj}" && \ mkdir -p "$$REBAR_BASE_DIR" && \ - $(MAKE) -C {src_proj} build {check} + cd {shlex.quote(src_proj)} && \ + if [ -e Makefile ]; then \ + $(MAKE) build {check}; \ + else \ + rebar3 compile && \ + rebar3 escriptize && \ + {check_cmd}; \ + fi; sync touch $@ ''' @@ -471,13 +479,12 @@ ''' elif buildsystem == "erlang": # Use the "install" target if it exists, otherwise fall back to installing - # files generated by escriptize in default/bin. The fallback method can be - # removed once osmo-epdg has an install target. + # files generated by escriptize in default/bin. return f''' .make.{proj}.install: .make.{proj}.build @echo "\n\n\n===== $@\n" set -ex; \ - if grep -q "^install:" {shlex.quote(src_proj)}/Makefile; then \ + if grep -q "^install:" {shlex.quote(src_proj)}/Makefile 2>/dev/null; then \ {sudo_make_install}$(MAKE) \ -C {shlex.quote(src_proj)} \ install \