osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-dev/+/37346?usp=email ) Change subject: gen_makefile: support erlang projects ...................................................................... gen_makefile: support erlang projects Change-Id: Ib471a518c48dac8c0cd22bfb038b99b58014708f --- M all.buildsystems M all.deps M gen_makefile.py 3 files changed, 43 insertions(+), 3 deletions(-) Approvals: osmith: Looks good to me, approved; Verified diff --git a/all.buildsystems b/all.buildsystems index fc1784b..7b5a573 100644 --- a/all.buildsystems +++ b/all.buildsystems @@ -1,3 +1,6 @@ # Projects with buildsystems other than autotools # project buildsystem open5gs meson +osmo-s1gw erlang +osmo-epdg erlang +osmo_dia2gsup erlang diff --git a/all.deps b/all.deps index 398ebec..4ccb91e 100644 --- a/all.deps +++ b/all.deps @@ -37,6 +37,10 @@ osmo-remsim simtrace2_host libosmo-netif osmo-uecups libosmocore +osmo-s1gw +osmo-epdg +osmo_dia2gsup + open5gs # can only clone these diff --git a/gen_makefile.py b/gen_makefile.py index 2fd04a7..0476a3f 100755 --- a/gen_makefile.py +++ b/gen_makefile.py @@ -239,7 +239,7 @@ sync touch $@ ''' - elif buildsystem == "meson": + elif buildsystem in ["meson", "erlang"]: return "" else: assert False, f"unknown buildsystem: {buildsystem}" @@ -274,11 +274,13 @@ sync touch $@ ''' + elif buildsystem == "erlang": + return "" else: assert False, f"unknown buildsystem: {buildsystem}" def gen_makefile_build(proj, distclean_cond, build_proj, docker_cmd, jobs, - check): + check, src_proj): buildsystem = projects_buildsystems.get(proj, "autotools") if buildsystem == "autotools": @@ -304,6 +306,17 @@ sync touch $@ ''' + elif buildsystem == "erlang": + return f''' +.make.{proj}.build: $({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} + sync + touch $@ + ''' else: assert False, f"unknown buildsystem: {buildsystem}" @@ -328,6 +341,16 @@ sync touch $@ ''' + elif buildsystem == "erlang": + 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 + sync + touch $@ + ''' else: assert False, f"unknown buildsystem: {buildsystem}" @@ -400,6 +423,7 @@ -or -name "*.cpp" \ -or -name "*.tpl" \ -or -name "*.map" \ + -or -name "*.erl" \ \) \ -and -not -name "config.h" 2>/dev/null) @@ -431,7 +455,7 @@ build_proj, cflags, docker_cmd, build_to_src, configure_opts_str), build_rule=gen_makefile_build(proj, distclean_cond, build_proj, docker_cmd, - jobs, check), + jobs, check, src_proj), install_rule=gen_makefile_install(proj, docker_cmd, sudo_make_install, build_proj, no_ldconfig, sudo_ldconfig), reinstall_rule=gen_makefile_reinstall(proj, deps_reinstall, -- To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/37346?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Change-Id: Ib471a518c48dac8c0cd22bfb038b99b58014708f Gerrit-Change-Number: 37346 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith@sysmocom.de> Gerrit-Reviewer: osmith <osmith@sysmocom.de> Gerrit-MessageType: merged