lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/41590?usp=email )
Change subject: Makefile/jenkin.sh: adapt osmo-s1gw files ......................................................................
Makefile/jenkin.sh: adapt osmo-s1gw files
Improve clean of files
Change-Id: Ib05d66e9aef2992f687a3c547cbc2dfba04b6fb8 --- M Makefile M contrib/jenkins.sh 2 files changed, 46 insertions(+), 9 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-epdg refs/changes/90/41590/1
diff --git a/Makefile b/Makefile index 0470458..5f6e89f 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,62 @@ +# where rebar3 stores build output +REBAR_BASE_DIR ?= _build +# config file used by 'run' and 'shell' +CONFIG ?= config/sys.config +# arguments passed to eunit, used by 'check' +EUNIT_ARGS ?= +# directory paths for 'install' +BINDIR ?= /usr/bin +LIBDIR ?= /usr/lib +CONFDIR ?= /etc/osmocom +SYSTEMDUNITDIR ?= /lib/systemd/system + all: build
-build: +GEN_FILES = include/diameter_*.hrl src/diameter_*.erl + +src/diameter_%.erl include/diameter_%.hrl: dia/diameter_%.asn + rebar3 diameter compile + +build: $(GEN_FILES) rebar3 compile + +escript: $(GEN_FILES) rebar3 escriptize
+run-escript: escript + ERL_FLAGS='-config $(CONFIG)' $(REBAR_BASE_DIR)/default/bin/osmo-epdg + run: build ERL_FLAGS='-config config/sys.config' _build/default/bin/osmo-epdg
shell: build - rebar3 shell --config ./config/sys.config + rebar3 shell --config $(CONFIG)
-check: - rebar3 eunit +check: $(GEN_FILES) + rebar3 eunit $(EUNIT_ARGS) + +analyze: $(GEN_FILES) + rebar3 dialyzer + +release: $(GEN_FILES) + rebar3 release + +install: release + install -d $(DESTDIR)$(LIBDIR) + cp -r $(REBAR_BASE_DIR)/default/bin/osmo-epdg $(DESTDIR)$(LIBDIR)/ + install -Dm0644 config/sys.config \ + $(DESTDIR)$(CONFDIR)/osmo-epdg.config + install -Dm0644 contrib/systemd/osmo-epdg.service \ + $(DESTDIR)$(SYSTEMDUNITDIR)/osmo-epdg.service
clean: -# Avoid running rebar3 clean if _build doesn't exist, since it would try +# Avoid running rebar3 clean if $(REBAR_BASE_DIR) doesn't exist, since it would try # to fetch deps from the Internet and that may not be avaialble when in # OBS build. -ifneq ("$(wildcard _build/.*)", "") +ifneq ("$(wildcard $(REBAR_BASE_DIR)/.*)", "") + rebar3 diameter clean rebar3 clean - rm -rf _build/ + rm -rf $(REBAR_BASE_DIR) else - rm -f src/diameter_*.erl + rm -f $(GEN_FILES) endif diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index a900a5c..0d4275c 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -2,4 +2,4 @@
make clean || true make -make check +make check EUNIT_ARGS="-v"