osmith has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-dev/+/40770?usp=email )
Change subject: gen_makefile: support new Osmocom erlang makefiles
......................................................................
gen_makefile: support new Osmocom erlang makefiles
Related: osmo-s1gw I5681ca103daf1c497218b4513b0ca97b1aae03d3
Change-Id: I92d6fc6eb5a11068d4b3baca55dfb3abdedbbbf1
---
M gen_makefile.py
1 file changed, 19 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/70/40770/1
diff --git a/gen_makefile.py b/gen_makefile.py
index a118392..6c9de71 100755
--- a/gen_makefile.py
+++ b/gen_makefile.py
@@ -340,7 +340,7 @@
else:
assert False, f"unknown buildsystem: {buildsystem}"
-def gen_makefile_install(proj, build_proj):
+def gen_makefile_install(proj, build_proj, src_proj):
no_ldconfig = '#' if args.no_ldconfig else ''
sudo_ldconfig = '' if args.ldconfig_without_sudo else 'sudo '
sudo_make_install = "sudo " if args.sudo_make_install else ""
@@ -364,12 +364,25 @@
touch $@
'''
elif buildsystem == "erlang":
+ # Support the old and new style of Osmocom erlang makefiles. The old style
+ # ("if" code path) uses escriptize, the new style ("else" code
path) makes
+ # a complete release package and installs a wrapper shell script.
+ #
https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40756/2
return f'''
.make.{proj}.install: .make.{proj}.build
@echo "\\n\\n\\n===== $@\\n"
- for i in {build_proj}/default/bin/*; do \\
- install -v -Dm755 "$$i" -t {shlex.quote(args.install_prefix)}/bin/; \\
- done
+ set -ex; \\
+ for i in {build_proj}/default/bin/*; do \\
+ if [ -e "$$i" ]; then \\
+ install -v -Dm755 "$$i" -t {shlex.quote(args.install_prefix)}/bin/; \\
+ else \\
+ {sudo_make_install}$(MAKE) \\
+ -C {shlex.quote(src_proj)} \\
+ install \\
+ DESTDIR={shlex.quote(args.install_prefix)} \\
+ REBAR_BASE_DIR="$$PWD"/{shlex.quote(build_proj)}; \\
+ fi; \\
+ done
sync
touch $@
'''
@@ -486,7 +499,8 @@
update_src_copy_cmd)}
{gen_makefile_install(proj,
- build_proj)}
+ build_proj,
+ src_proj)}
{gen_makefile_reinstall(proj,
deps_reinstall,
--
To view, visit
https://gerrit.osmocom.org/c/osmo-dev/+/40770?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: I92d6fc6eb5a11068d4b3baca55dfb3abdedbbbf1
Gerrit-Change-Number: 40770
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>