diff options
-rw-r--r-- | Makefile.in | 44 | ||||
-rw-r--r-- | configure.ac | 2 |
2 files changed, 36 insertions, 10 deletions
diff --git a/Makefile.in b/Makefile.in index 0079a805d..c39195ac7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,5 @@ REBAR = @ESCRIPT@ @rebar@ +MIX = @rebar@ INSTALL = @INSTALL@ SED = @SED@ ERL = @ERL@ @@ -97,17 +98,38 @@ ifneq ($(INSTALLGROUP),) G_USER=-g $(INSTALLGROUP) endif -IS_REBAR3:=$(shell expr `$(REBAR) --version | awk -F '[ .]' '/rebar / {print $$2}'` '>=' 3) +ifeq "$(MIX)" "mix" +IS_REBAR:=6 +else +IS_REBAR:=$(shell expr `$(REBAR) --version | awk -F '[ .]' '/rebar / {print $$2}'`) +endif -ifeq "$(IS_REBAR3)" "1" +ifeq "$(IS_REBAR)" "6" + REBAR=$(MIX) + SKIPDEPS= + LISTDEPS=deps.tree + UPDATEDEPS=deps.update + DEPSPATTERN="s/.*─ \([a-z0-9_]*\) .*/\1/p;" + DEPSBASE=_build + DEPSDIR=$(DEPSBASE)/dev/lib + GET_DEPS= deps.get + CONFIGURE_DEPS= + EBINDIR=$(DEPSDIR)/ejabberd/ebin + REBARREL=MIX_ENV=prod $(REBAR) release --overwrite + REBARDEV=MIX_ENV=dev $(REBAR) release --overwrite +else +ifeq "$(IS_REBAR)" "3" SKIPDEPS= LISTDEPS=tree UPDATEDEPS=upgrade DEPSPATTERN="s/ (.*//; /^ / s/.* \([a-z0-9_]*\).*/\1/p;" DEPSBASE=_build DEPSDIR=$(DEPSBASE)/default/lib + GET_DEPS= get-deps + CONFIGURE_DEPS=$(REBAR) configure-deps EBINDIR=$(DEPSDIR)/ejabberd/ebin - REBARREL=as prod tar + REBARREL=$(REBAR) as prod tar + REBARDEV=REBAR_PROFILE=dev $(REBAR) release else SKIPDEPS=skip_deps=true LISTDEPS=-q list-deps @@ -115,8 +137,12 @@ else DEPSPATTERN="/ TAG / s/ .*// p; / REV / s/ .*// p; / BRANCH / s/ .*// p;" DEPSBASE=deps DEPSDIR=$(DEPSBASE) + GET_DEPS= get-deps + CONFIGURE_DEPS=$(REBAR) configure-deps EBINDIR=ebin - REBARREL=generate + REBARREL=$(REBAR) generate + REBARDEV= +endif endif all: deps src @@ -127,10 +153,10 @@ $(DEPSDIR)/.got: rm -rf $(DEPSDIR)/.got rm -rf $(DEPSDIR)/.built mkdir -p $(DEPSDIR) - $(REBAR) get-deps && :> $(DEPSDIR)/.got + $(REBAR) $(GET_DEPS) && :> $(DEPSDIR)/.got $(DEPSDIR)/.built: $(DEPSDIR)/.got - $(REBAR) configure-deps + $(CONFIGURE_DEPS) $(REBAR) compile && :> $(DEPSDIR)/.built src: $(DEPSDIR)/.built @@ -360,19 +386,19 @@ distclean: clean clean-rel [ ! -f ../ChangeLog ] || rm -f ../ChangeLog rel: - $(REBAR) $(REBARREL) + $(REBARREL) DEV_CONFIG = _build/dev/rel/ejabberd/etc/ejabberd/ejabberd.yml dev $(DEV_CONFIG): - REBAR_PROFILE=dev rebar3 release + $(REBARDEV) TAGS: etags *.erl Makefile: Makefile.in -ifeq "$(IS_REBAR3)" "1" +ifeq "$(IS_REBAR)" "3" dialyzer: $(REBAR) dialyzer else diff --git a/configure.ac b/configure.ac index c08075e52..1b0500e0d 100644 --- a/configure.ac +++ b/configure.ac @@ -30,7 +30,7 @@ fi AC_ARG_WITH(rebar, AC_HELP_STRING([--with-rebar=bin], - [use rebar specified]), + [use the rebar/rebar3/mix binary specified]), [if test "$withval" = "yes" -o "$withval" = "no" -o "X$with_rebar" = "X"; then rebar="rebar" else |