2024-01-16 13:51:42 +01:00
|
|
|
#.
|
|
|
|
#' definitions
|
|
|
|
#
|
|
|
|
|
2024-02-09 22:37:23 +01:00
|
|
|
ESCRIPT = @ESCRIPT@
|
2024-11-22 19:23:55 +01:00
|
|
|
REBAR = @rebar@ # rebar|rebar3|mix binary (or path to binary)
|
|
|
|
REBAR3 = @REBAR3@ # path to rebar3 binary
|
2021-07-15 21:31:31 +02:00
|
|
|
MIX = @rebar@
|
2024-01-16 16:06:04 +01:00
|
|
|
AWK = @AWK@
|
2013-04-08 11:12:54 +02:00
|
|
|
INSTALL = @INSTALL@
|
2024-01-16 16:06:04 +01:00
|
|
|
MKDIR_P = @MKDIR_P@
|
2013-04-08 11:12:54 +02:00
|
|
|
SED = @SED@
|
|
|
|
ERL = @ERL@
|
2024-02-09 22:37:23 +01:00
|
|
|
EPMD = @EPMD@
|
|
|
|
IEX = @IEX@
|
|
|
|
|
|
|
|
INSTALLUSER=@INSTALLUSER@
|
|
|
|
INSTALLGROUP=@INSTALLGROUP@
|
|
|
|
|
|
|
|
REBAR_ENABLE_ELIXIR = @elixir@
|
2013-04-08 11:12:54 +02:00
|
|
|
|
|
|
|
prefix = @prefix@
|
|
|
|
exec_prefix = @exec_prefix@
|
|
|
|
|
|
|
|
DESTDIR =
|
|
|
|
|
|
|
|
# /etc/ejabberd/
|
2022-05-19 12:20:42 +02:00
|
|
|
ETCDIR = @sysconfdir@/ejabberd
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2015-01-29 18:43:47 +01:00
|
|
|
# /bin/
|
2022-05-19 12:20:42 +02:00
|
|
|
BINDIR = @bindir@
|
2015-01-29 18:43:47 +01:00
|
|
|
|
2013-04-08 11:12:54 +02:00
|
|
|
# /sbin/
|
2022-05-19 12:20:42 +02:00
|
|
|
SBINDIR = @sbindir@
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2015-10-19 13:46:51 +02:00
|
|
|
# /lib/
|
2022-05-19 12:20:42 +02:00
|
|
|
LIBDIR = @libdir@
|
2015-10-19 13:46:51 +02:00
|
|
|
|
2013-04-08 11:12:54 +02:00
|
|
|
# /lib/ejabberd/
|
2022-05-19 12:20:42 +02:00
|
|
|
EJABBERDDIR = @libdir@/ejabberd
|
2013-04-08 11:12:54 +02:00
|
|
|
|
|
|
|
# /share/doc/ejabberd
|
|
|
|
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|
|
|
datarootdir = @datarootdir@
|
2022-05-19 12:20:42 +02:00
|
|
|
DOCDIR = @docdir@
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2020-01-08 10:45:58 +01:00
|
|
|
# /share/doc/man/man5
|
2022-05-19 12:20:42 +02:00
|
|
|
MANDIR = @mandir@/man5
|
2020-01-08 10:45:58 +01:00
|
|
|
|
2013-04-08 11:12:54 +02:00
|
|
|
# /usr/lib/ejabberd/ebin/
|
|
|
|
BEAMDIR = $(EJABBERDDIR)/ebin
|
|
|
|
|
|
|
|
# /usr/lib/ejabberd/include/
|
|
|
|
INCLUDEDIR = $(EJABBERDDIR)/include
|
|
|
|
|
|
|
|
# /usr/lib/ejabberd/priv/
|
|
|
|
PRIVDIR = $(EJABBERDDIR)/priv
|
|
|
|
|
|
|
|
# /usr/lib/ejabberd/priv/bin
|
|
|
|
PBINDIR = $(PRIVDIR)/bin
|
|
|
|
|
|
|
|
# /usr/lib/ejabberd/priv/lib
|
|
|
|
SODIR = $(PRIVDIR)/lib
|
|
|
|
|
|
|
|
# /usr/lib/ejabberd/priv/msgs
|
|
|
|
MSGSDIR = $(PRIVDIR)/msgs
|
|
|
|
|
2017-10-09 20:46:38 +02:00
|
|
|
# /usr/lib/ejabberd/priv/css
|
|
|
|
CSSDIR = $(PRIVDIR)/css
|
|
|
|
|
2017-10-09 22:35:42 +02:00
|
|
|
# /usr/lib/ejabberd/priv/img
|
|
|
|
IMGDIR = $(PRIVDIR)/img
|
|
|
|
|
|
|
|
# /usr/lib/ejabberd/priv/js
|
|
|
|
JSDIR = $(PRIVDIR)/js
|
|
|
|
|
2015-03-16 19:53:19 +01:00
|
|
|
# /usr/lib/ejabberd/priv/sql
|
|
|
|
SQLDIR = $(PRIVDIR)/sql
|
|
|
|
|
2018-07-14 17:02:50 +02:00
|
|
|
# /usr/lib/ejabberd/priv/lua
|
|
|
|
LUADIR = $(PRIVDIR)/lua
|
|
|
|
|
2013-04-08 11:12:54 +02:00
|
|
|
# /var/lib/ejabberd/
|
2022-05-19 12:20:42 +02:00
|
|
|
SPOOLDIR = @localstatedir@/lib/ejabberd
|
2013-04-08 11:12:54 +02:00
|
|
|
|
|
|
|
# /var/log/ejabberd/
|
2022-05-19 12:20:42 +02:00
|
|
|
LOGDIR = @localstatedir@/log/ejabberd
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2024-01-16 13:51:42 +01:00
|
|
|
#.
|
|
|
|
#' install user
|
|
|
|
#
|
|
|
|
|
2013-04-08 11:12:54 +02:00
|
|
|
# if no user was enabled, don't set privileges or ownership
|
|
|
|
ifeq ($(INSTALLUSER),)
|
|
|
|
O_USER=
|
|
|
|
G_USER=
|
|
|
|
CHOWN_COMMAND=echo
|
|
|
|
CHOWN_OUTPUT=/dev/null
|
|
|
|
INIT_USER=root
|
|
|
|
else
|
|
|
|
O_USER=-o $(INSTALLUSER)
|
|
|
|
G_USER=-g $(INSTALLUSER)
|
|
|
|
CHOWN_COMMAND=chown
|
|
|
|
CHOWN_OUTPUT=&1
|
|
|
|
INIT_USER=$(INSTALLUSER)
|
|
|
|
endif
|
2024-02-09 22:37:23 +01:00
|
|
|
|
2018-03-20 23:37:42 +01:00
|
|
|
# if no group was enabled, don't set privileges or ownership
|
|
|
|
ifneq ($(INSTALLGROUP),)
|
|
|
|
G_USER=-g $(INSTALLGROUP)
|
|
|
|
endif
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2024-01-16 13:51:42 +01:00
|
|
|
#.
|
|
|
|
#' rebar / rebar3 / mix
|
|
|
|
#
|
|
|
|
|
2024-01-03 18:58:30 +01:00
|
|
|
ifeq "$(notdir $(MIX))" "mix"
|
2021-08-26 14:33:37 +02:00
|
|
|
REBAR_VER:=6
|
2022-01-03 13:51:49 +01:00
|
|
|
REBAR_VER_318:=0
|
2021-07-15 21:31:31 +02:00
|
|
|
else
|
2024-01-16 16:06:04 +01:00
|
|
|
REBAR_VER:=$(shell $(REBAR) --version | $(AWK) -F '[ .]' '/rebar / {print $$2}')
|
|
|
|
REBAR_VER_318:=$(shell $(REBAR) --version | $(AWK) -F '[ .]' '/rebar / {print ($$2 == 3 && $$3 >= 18 ? 1 : 0)}')
|
2021-07-15 21:31:31 +02:00
|
|
|
endif
|
2020-09-21 16:14:12 +02:00
|
|
|
|
2021-08-26 14:33:37 +02:00
|
|
|
ifeq "$(REBAR_VER)" "6"
|
2021-07-15 21:31:31 +02:00
|
|
|
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
|
2022-05-23 12:06:10 +02:00
|
|
|
CONFIGURE_DEPS=(cd deps/eimp; ./configure)
|
2021-07-15 21:31:31 +02:00
|
|
|
EBINDIR=$(DEPSDIR)/ejabberd/ebin
|
2022-04-30 20:41:46 +02:00
|
|
|
XREFOPTIONS=graph
|
2024-02-23 12:44:39 +01:00
|
|
|
EDOCPRE=MIX_ENV=edoc
|
|
|
|
EDOCTASK=docs --proglang erlang
|
2022-05-20 11:49:07 +02:00
|
|
|
CLEANARG=--deps
|
2023-12-20 15:27:08 +01:00
|
|
|
ELIXIR_LIBDIR_RAW=$(shell elixir -e "IO.puts(:filename.dirname(:code.lib_dir(:elixir)))" -e ":erlang.halt")
|
|
|
|
ELIXIR_LIBDIR=":$(ELIXIR_LIBDIR_RAW)"
|
2021-07-15 21:31:31 +02:00
|
|
|
REBARREL=MIX_ENV=prod $(REBAR) release --overwrite
|
|
|
|
REBARDEV=MIX_ENV=dev $(REBAR) release --overwrite
|
2024-02-09 22:37:23 +01:00
|
|
|
RELIVECMD=$(ESCRIPT) rel/relive.escript && MIX_ENV=dev RELIVE=true $(IEX) --name ejabberd@localhost -S mix run
|
2024-01-16 13:53:43 +01:00
|
|
|
REL_LIB_DIR = _build/dev/rel/ejabberd/lib
|
|
|
|
COPY_REL_TARGET = dev
|
2024-02-13 13:05:09 +01:00
|
|
|
GET_DEPS_TRANSLATIONS=MIX_ENV=translations $(REBAR) $(GET_DEPS)
|
|
|
|
DEPSDIR_TRANSLATIONS=deps
|
2021-07-15 21:31:31 +02:00
|
|
|
else
|
2023-12-20 15:27:08 +01:00
|
|
|
ifeq ($(REBAR_ENABLE_ELIXIR),true)
|
|
|
|
ELIXIR_LIBDIR_RAW=$(shell elixir -e "IO.puts(:filename.dirname(:code.lib_dir(:elixir)))" -e ":erlang.halt")
|
|
|
|
ELIXIR_LIBDIR=":$(ELIXIR_LIBDIR_RAW)"
|
2023-12-20 15:29:33 +01:00
|
|
|
EXPLICIT_ELIXIR_COMPILE=MIX_ENV=default mix compile.elixir
|
2024-02-13 13:09:32 +01:00
|
|
|
EXPLICIT_ELIXIR_COMPILE_DEV=MIX_ENV=dev mix compile.elixir
|
2024-01-16 16:06:04 +01:00
|
|
|
PREPARE_ELIXIR_SCRIPTS=$(MKDIR_P) rel/overlays; cp $(ELIXIR_LIBDIR_RAW)/../bin/iex rel/overlays/; cp $(ELIXIR_LIBDIR_RAW)/../bin/elixir rel/overlays/; sed -i 's|ERTS_BIN=$$|ERTS_BIN=$$SCRIPT_PATH/../../erts-{{erts_vsn}}/bin/|' rel/overlays/elixir
|
2023-12-20 15:27:08 +01:00
|
|
|
endif
|
2021-08-26 14:33:37 +02:00
|
|
|
ifeq "$(REBAR_VER)" "3"
|
2020-09-21 16:14:12 +02:00
|
|
|
SKIPDEPS=
|
|
|
|
LISTDEPS=tree
|
2022-01-03 13:51:49 +01:00
|
|
|
ifeq "$(REBAR_VER_318)" "1"
|
|
|
|
UPDATEDEPS=upgrade --all
|
|
|
|
else
|
2020-09-21 16:14:12 +02:00
|
|
|
UPDATEDEPS=upgrade
|
2022-01-03 13:51:49 +01:00
|
|
|
endif
|
2020-09-21 16:14:12 +02:00
|
|
|
DEPSPATTERN="s/ (.*//; /^ / s/.* \([a-z0-9_]*\).*/\1/p;"
|
|
|
|
DEPSBASE=_build
|
|
|
|
DEPSDIR=$(DEPSBASE)/default/lib
|
2021-07-15 21:31:31 +02:00
|
|
|
GET_DEPS= get-deps
|
|
|
|
CONFIGURE_DEPS=$(REBAR) configure-deps
|
2020-09-21 16:14:12 +02:00
|
|
|
EBINDIR=$(DEPSDIR)/ejabberd/ebin
|
2022-04-30 20:41:46 +02:00
|
|
|
XREFOPTIONS=
|
2022-05-20 11:49:07 +02:00
|
|
|
CLEANARG=--all
|
2021-07-15 21:31:31 +02:00
|
|
|
REBARREL=$(REBAR) as prod tar
|
2024-02-13 13:04:32 +01:00
|
|
|
REBARDEV=$(REBAR) as dev release
|
2024-02-13 13:09:32 +01:00
|
|
|
RELIVECMD=$(REBAR) as dev relive
|
2024-01-16 13:53:43 +01:00
|
|
|
REL_LIB_DIR = _build/dev/rel/ejabberd/lib
|
|
|
|
COPY_REL_TARGET = dev
|
2024-02-13 13:05:09 +01:00
|
|
|
GET_DEPS_TRANSLATIONS=$(REBAR) as translations $(GET_DEPS)
|
|
|
|
DEPSDIR_TRANSLATIONS=_build/translations/lib
|
2020-09-21 16:14:12 +02:00
|
|
|
else
|
|
|
|
SKIPDEPS=skip_deps=true
|
|
|
|
LISTDEPS=-q list-deps
|
|
|
|
UPDATEDEPS=update-deps
|
|
|
|
DEPSPATTERN="/ TAG / s/ .*// p; / REV / s/ .*// p; / BRANCH / s/ .*// p;"
|
|
|
|
DEPSBASE=deps
|
|
|
|
DEPSDIR=$(DEPSBASE)
|
2021-07-15 21:31:31 +02:00
|
|
|
GET_DEPS= get-deps
|
|
|
|
CONFIGURE_DEPS=$(REBAR) configure-deps
|
2020-09-21 16:14:12 +02:00
|
|
|
EBINDIR=ebin
|
2022-04-30 20:41:46 +02:00
|
|
|
XREFOPTIONS=
|
2022-05-20 11:49:07 +02:00
|
|
|
CLEANARG=
|
2021-07-15 21:31:31 +02:00
|
|
|
REBARREL=$(REBAR) generate
|
|
|
|
REBARDEV=
|
2022-01-17 11:49:16 +01:00
|
|
|
RELIVECMD=@echo "Rebar2 detected... relive not supported.\
|
2024-02-16 13:24:05 +01:00
|
|
|
\nTry: ./configure --with-rebar=rebar3 ; make relive"
|
2024-01-16 13:53:43 +01:00
|
|
|
REL_LIB_DIR = rel/ejabberd/lib
|
|
|
|
COPY_REL_TARGET = rel
|
2021-07-15 21:31:31 +02:00
|
|
|
endif
|
2020-09-21 16:14:12 +02:00
|
|
|
endif
|
|
|
|
|
2024-01-16 13:51:42 +01:00
|
|
|
#.
|
|
|
|
#' main targets
|
|
|
|
#
|
|
|
|
|
2022-05-20 11:24:39 +02:00
|
|
|
all: scripts deps src
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2021-07-22 15:47:35 +02:00
|
|
|
deps: $(DEPSDIR)/.got
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2020-09-21 16:14:12 +02:00
|
|
|
$(DEPSDIR)/.got:
|
|
|
|
rm -rf $(DEPSDIR)/.got
|
|
|
|
rm -rf $(DEPSDIR)/.built
|
2024-01-16 16:06:04 +01:00
|
|
|
$(MKDIR_P) $(DEPSDIR)
|
2021-07-15 21:31:31 +02:00
|
|
|
$(REBAR) $(GET_DEPS) && :> $(DEPSDIR)/.got
|
2022-05-23 12:39:29 +02:00
|
|
|
$(CONFIGURE_DEPS)
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2020-09-21 16:14:12 +02:00
|
|
|
$(DEPSDIR)/.built: $(DEPSDIR)/.got
|
|
|
|
$(REBAR) compile && :> $(DEPSDIR)/.built
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2020-09-21 16:14:12 +02:00
|
|
|
src: $(DEPSDIR)/.built
|
|
|
|
$(REBAR) $(SKIPDEPS) compile
|
2023-12-20 15:29:33 +01:00
|
|
|
$(EXPLICIT_ELIXIR_COMPILE)
|
2013-04-08 11:12:54 +02:00
|
|
|
|
|
|
|
update:
|
2020-09-21 16:14:12 +02:00
|
|
|
rm -rf $(DEPSDIR)/.got
|
|
|
|
rm -rf $(DEPSDIR)/.built
|
|
|
|
$(REBAR) $(UPDATEDEPS) && :> $(DEPSDIR)/.got
|
2022-05-23 15:01:54 +02:00
|
|
|
$(CONFIGURE_DEPS)
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2014-08-26 16:12:57 +02:00
|
|
|
xref: all
|
2022-04-30 20:41:46 +02:00
|
|
|
$(REBAR) $(SKIPDEPS) xref $(XREFOPTIONS)
|
2014-08-26 16:12:57 +02:00
|
|
|
|
2019-06-14 11:33:26 +02:00
|
|
|
hooks: all
|
2021-02-11 15:14:00 +01:00
|
|
|
tools/hook_deps.sh $(EBINDIR)
|
2019-06-14 11:33:26 +02:00
|
|
|
|
|
|
|
options: all
|
2021-02-11 15:14:00 +01:00
|
|
|
tools/opt_types.sh ejabberd_option $(EBINDIR)
|
2014-08-26 16:12:57 +02:00
|
|
|
|
2013-04-08 11:12:54 +02:00
|
|
|
translations:
|
2024-02-13 13:05:09 +01:00
|
|
|
$(GET_DEPS_TRANSLATIONS)
|
|
|
|
tools/prepare-tr.sh $(DEPSDIR_TRANSLATIONS)
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2022-11-04 11:41:14 +01:00
|
|
|
doap:
|
|
|
|
tools/generate-doap.sh
|
|
|
|
|
2024-02-23 12:44:39 +01:00
|
|
|
#.
|
|
|
|
#' edoc
|
|
|
|
#
|
|
|
|
|
|
|
|
edoc: edoc_files edoc_compile
|
|
|
|
$(EDOCPRE) $(REBAR) $(EDOCTASK)
|
|
|
|
|
|
|
|
edoc_compile: deps
|
|
|
|
$(EDOCPRE) $(REBAR) compile
|
|
|
|
|
|
|
|
edoc_files: _build/edoc/docs.md _build/edoc/logo.png
|
|
|
|
|
|
|
|
_build/edoc/docs.md: edoc_compile
|
|
|
|
echo "For much more detailed and complete ejabberd documentation, " \
|
|
|
|
"go to the [ejabberd Docs](https://docs.ejabberd.im/) site." \
|
|
|
|
> _build/edoc/docs.md
|
|
|
|
|
|
|
|
_build/edoc/logo.png: edoc_compile
|
2024-04-24 17:23:53 +02:00
|
|
|
wget https://docs.ejabberd.im/assets/img/footer_logo_e.png -O _build/edoc/logo.png
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2024-06-02 13:36:37 +02:00
|
|
|
#.
|
|
|
|
#' format / indent
|
|
|
|
#
|
|
|
|
|
|
|
|
format:
|
2024-11-22 10:48:05 +01:00
|
|
|
tools/rebar3-format.sh $(REBAR3)
|
2024-06-02 13:36:37 +02:00
|
|
|
|
|
|
|
indent:
|
|
|
|
tools/emacs-indent.sh
|
|
|
|
|
2024-01-16 13:51:42 +01:00
|
|
|
#.
|
|
|
|
#' copy-files
|
|
|
|
#
|
|
|
|
|
2015-10-28 18:12:39 +01:00
|
|
|
JOIN_PATHS=$(if $(wordlist 2,1000,$(1)),$(firstword $(1))/$(call JOIN_PATHS,$(wordlist 2,1000,$(1))),$(1))
|
|
|
|
|
2016-01-07 18:49:55 +01:00
|
|
|
VERSIONED_DEP=$(if $(DEP_$(1)_VERSION),$(DEP_$(1)_VERSION),$(1))
|
|
|
|
|
2020-09-21 16:14:12 +02:00
|
|
|
DEPIX:=$(words $(subst /, ,$(DEPSDIR)))
|
|
|
|
LIBIX:=$(shell expr "$(DEPIX)" + 2)
|
|
|
|
|
2016-01-08 11:22:59 +01:00
|
|
|
ELIXIR_TO_DEST=$(LIBDIR) $(call VERSIONED_DEP,$(word 2,$(1))) $(wordlist 5,1000,$(1))
|
2016-01-07 18:49:55 +01:00
|
|
|
DEPS_TO_DEST=$(LIBDIR) $(call VERSIONED_DEP,$(word 2,$(1))) $(wordlist 3,1000,$(1))
|
|
|
|
MAIN_TO_DEST=$(LIBDIR) $(call VERSIONED_DEP,ejabberd) $(1)
|
2020-09-21 16:14:12 +02:00
|
|
|
TO_DEST_SINGLE=$(if $(subst X$(DEPSBASE)X,,X$(word 1,$(1))X),$(call MAIN_TO_DEST,$(1)),$(if $(subst XlibX,,X$(word $(LIBIX),$(1))X),$(call DEPS_TO_DEST,$(wordlist $(DEPIX),1000,$(1))),$(call ELIXIR_TO_DEST,$(wordlist $(DEPIX),1000,$(1)))))
|
2022-05-19 12:20:42 +02:00
|
|
|
TO_DEST=$(foreach path,$(1),$(call JOIN_PATHS,$(DESTDIR)$(call TO_DEST_SINGLE,$(subst /, ,$(path)))))
|
2015-10-28 18:12:39 +01:00
|
|
|
|
2015-10-15 15:08:45 +02:00
|
|
|
FILTER_DIRS=$(foreach path,$(1),$(if $(wildcard $(path)/*),,$(path)))
|
|
|
|
FILES_WILDCARD=$(call FILTER_DIRS,$(foreach w,$(1),$(wildcard $(w))))
|
2013-06-19 02:40:33 +02:00
|
|
|
|
2016-01-07 18:49:55 +01:00
|
|
|
ifeq ($(MAKECMDGOALS),copy-files-sub)
|
|
|
|
|
2020-09-21 16:14:12 +02:00
|
|
|
DEPS:=$(sort $(shell QUIET=1 $(REBAR) $(LISTDEPS) | $(SED) -ne $(DEPSPATTERN) ))
|
2016-01-07 18:49:55 +01:00
|
|
|
|
2020-09-21 16:14:12 +02:00
|
|
|
DEPS_FILES=$(call FILES_WILDCARD,$(foreach DEP,$(DEPS),$(DEPSDIR)/$(DEP)/ebin/*.beam $(DEPSDIR)/$(DEP)/ebin/*.app $(DEPSDIR)/$(DEP)/priv/* $(DEPSDIR)/$(DEP)/priv/lib/* $(DEPSDIR)/$(DEP)/priv/bin/* $(DEPSDIR)/$(DEP)/include/*.hrl $(DEPSDIR)/$(DEP)/COPY* $(DEPSDIR)/$(DEP)/LICENSE* $(DEPSDIR)/$(DEP)/lib/*/ebin/*.beam $(DEPSDIR)/$(DEP)/lib/*/ebin/*.app))
|
2018-01-08 10:56:32 +01:00
|
|
|
|
2020-09-21 16:14:12 +02:00
|
|
|
BINARIES=$(DEPSDIR)/epam/priv/bin/epam $(DEPSDIR)/eimp/priv/bin/eimp $(DEPSDIR)/fs/priv/mac_listener
|
2018-01-08 10:56:32 +01:00
|
|
|
|
2020-09-21 16:14:12 +02:00
|
|
|
DEPS_FILES_FILTERED=$(filter-out $(BINARIES) $(DEPSDIR)/elixir/ebin/elixir.app,$(DEPS_FILES))
|
|
|
|
DEPS_DIRS=$(sort $(DEPSDIR)/ $(foreach DEP,$(DEPS),$(DEPSDIR)/$(DEP)/) $(dir $(DEPS_FILES)))
|
2015-10-15 15:08:45 +02:00
|
|
|
|
2020-09-21 16:14:12 +02:00
|
|
|
MAIN_FILES=$(filter-out %/configure.beam,$(call FILES_WILDCARD,$(EBINDIR)/*.beam $(EBINDIR)/*.app priv/msgs/*.msg priv/css/*.css priv/img/*.png priv/js/*.js priv/lib/* include/*.hrl COPYING))
|
2018-10-29 10:25:04 +01:00
|
|
|
MAIN_DIRS=$(sort $(dir $(MAIN_FILES)) priv/bin priv/sql priv/lua)
|
2016-01-07 18:49:55 +01:00
|
|
|
|
|
|
|
define DEP_VERSION_template
|
2016-02-03 17:45:27 +01:00
|
|
|
DEP_$(1)_VERSION:=$(shell $(SED) -e '/vsn/!d;s/.*, *"/$(1)-/;s/".*//' $(2) 2>/dev/null)
|
2016-01-07 18:49:55 +01:00
|
|
|
endef
|
|
|
|
|
2018-01-15 10:38:36 +01:00
|
|
|
DELETE_TARGET_SO=$(if $(subst X.soX,,X$(suffix $(1))X),,rm -f $(call TO_DEST,$(1));)
|
2018-01-08 11:11:42 +01:00
|
|
|
|
2020-09-21 16:14:12 +02:00
|
|
|
$(foreach DEP,$(DEPS),$(eval $(call DEP_VERSION_template,$(DEP),$(DEPSDIR)/$(DEP)/ebin/$(DEP).app)))
|
|
|
|
$(eval $(call DEP_VERSION_template,ejabberd,$(EBINDIR)/ejabberd.app))
|
2015-10-15 15:08:45 +02:00
|
|
|
|
2015-10-19 16:38:31 +02:00
|
|
|
define COPY_template
|
2018-01-08 11:11:42 +01:00
|
|
|
$(call TO_DEST,$(1)): $(1) $(call TO_DEST,$(dir $(1))) ; $(call DELETE_TARGET_SO, $(1)) $$(INSTALL) -m 644 $(1) $(call TO_DEST,$(1))
|
2015-10-15 15:08:45 +02:00
|
|
|
endef
|
|
|
|
|
2018-01-08 10:56:32 +01:00
|
|
|
define COPY_BINARY_template
|
2018-01-15 10:38:36 +01:00
|
|
|
$(call TO_DEST,$(1)): $(1) $(call TO_DEST,$(dir $(1))) ; rm -f $(call TO_DEST,$(1)); $$(INSTALL) -m 755 $$(O_USER) $(1) $(call TO_DEST,$(1))
|
2018-01-08 10:56:32 +01:00
|
|
|
endef
|
|
|
|
|
2015-10-15 15:08:45 +02:00
|
|
|
$(foreach file,$(DEPS_FILES_FILTERED) $(MAIN_FILES),$(eval $(call COPY_template,$(file))))
|
|
|
|
|
2018-01-08 10:56:32 +01:00
|
|
|
$(foreach file,$(BINARIES),$(eval $(call COPY_BINARY_template,$(file))))
|
|
|
|
|
2015-10-28 18:12:39 +01:00
|
|
|
$(sort $(call TO_DEST,$(MAIN_DIRS) $(DEPS_DIRS))):
|
2022-05-19 12:20:42 +02:00
|
|
|
$(INSTALL) -d $@
|
2015-10-15 15:08:45 +02:00
|
|
|
|
2016-01-07 18:49:55 +01:00
|
|
|
$(call TO_DEST,priv/sql/lite.sql): sql/lite.sql $(call TO_DEST,priv/sql)
|
|
|
|
$(INSTALL) -m 644 $< $@
|
|
|
|
|
2021-05-11 18:18:15 +02:00
|
|
|
$(call TO_DEST,priv/sql/lite.new.sql): sql/lite.new.sql $(call TO_DEST,priv/sql)
|
|
|
|
$(INSTALL) -m 644 $< $@
|
|
|
|
|
2016-01-07 18:49:55 +01:00
|
|
|
$(call TO_DEST,priv/bin/captcha.sh): tools/captcha.sh $(call TO_DEST,priv/bin)
|
2017-10-02 11:51:15 +02:00
|
|
|
$(INSTALL) -m 755 $(O_USER) $< $@
|
2015-10-15 15:08:45 +02:00
|
|
|
|
2018-10-29 10:25:04 +01:00
|
|
|
$(call TO_DEST,priv/lua/redis_sm.lua): priv/lua/redis_sm.lua $(call TO_DEST,priv/lua)
|
|
|
|
$(INSTALL) -m 644 $< $@
|
|
|
|
|
2021-10-13 19:38:31 +02:00
|
|
|
ifeq (@sqlite@,true)
|
|
|
|
SQLITE_FILES = priv/sql/lite.sql priv/sql/lite.new.sql
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (@redis@,true)
|
|
|
|
REDIS_FILES = priv/lua/redis_sm.lua
|
|
|
|
endif
|
|
|
|
|
|
|
|
copy-files-sub2: $(call TO_DEST,$(DEPS_FILES) $(MAIN_FILES) priv/bin/captcha.sh $(SQLITE_FILES) $(REDIS_FILES))
|
2016-01-07 18:49:55 +01:00
|
|
|
|
2018-01-08 10:56:53 +01:00
|
|
|
.PHONY: $(call TO_DEST,$(DEPS_FILES) $(MAIN_DIRS) $(DEPS_DIRS))
|
|
|
|
|
2016-01-07 18:49:55 +01:00
|
|
|
endif
|
|
|
|
|
2015-12-02 12:39:34 +01:00
|
|
|
copy-files:
|
|
|
|
$(MAKE) copy-files-sub
|
|
|
|
|
2016-01-07 18:49:55 +01:00
|
|
|
copy-files-sub: copy-files-sub2
|
2015-10-15 15:08:45 +02:00
|
|
|
|
2024-01-16 13:53:43 +01:00
|
|
|
#.
|
|
|
|
#' copy-files-rel
|
|
|
|
#
|
|
|
|
|
|
|
|
copy-files-rel: $(COPY_REL_TARGET)
|
|
|
|
#
|
|
|
|
# Libraries
|
|
|
|
(cd $(REL_LIB_DIR) && find . -follow -type f ! -executable -exec $(INSTALL) -vDm 640 $(G_USER) {} $(DESTDIR)$(LIBDIR)/{} \;)
|
|
|
|
#
|
|
|
|
# *.so:
|
|
|
|
(cd $(REL_LIB_DIR) && find . -follow -type f -executable -name *.so -exec $(INSTALL) -vDm 640 $(G_USER) {} $(DESTDIR)$(LIBDIR)/{} \;)
|
|
|
|
#
|
|
|
|
# Executable files
|
|
|
|
(cd $(REL_LIB_DIR) && find . -follow -type f -executable ! -name *.so -exec $(INSTALL) -vDm 550 $(G_USER) {} $(DESTDIR)$(LIBDIR)/{} \;)
|
|
|
|
|
|
|
|
#.
|
|
|
|
#' uninstall-librel
|
|
|
|
#
|
|
|
|
|
|
|
|
uninstall-librel:
|
|
|
|
(cd $(REL_LIB_DIR) && find . -follow -type f -exec rm -fv -v $(DESTDIR)$(LIBDIR)/{} \;)
|
|
|
|
(cd $(REL_LIB_DIR) && find . -follow -depth -type d -exec rm -dv -v $(DESTDIR)$(LIBDIR)/{} \;)
|
|
|
|
|
2024-01-16 13:51:42 +01:00
|
|
|
#.
|
|
|
|
#' relive
|
|
|
|
#
|
|
|
|
|
2022-01-17 11:49:16 +01:00
|
|
|
relive:
|
2024-02-13 13:09:32 +01:00
|
|
|
$(EXPLICIT_ELIXIR_COMPILE_DEV)
|
2022-01-17 11:49:16 +01:00
|
|
|
$(RELIVECMD)
|
|
|
|
|
2022-02-10 21:40:38 +01:00
|
|
|
relivelibdir=$(shell pwd)/$(DEPSDIR)
|
2022-01-17 11:49:16 +01:00
|
|
|
relivedir=$(shell pwd)/_build/relive
|
2022-04-25 12:46:48 +02:00
|
|
|
CONFIG_DIR = ${relivedir}/conf
|
|
|
|
SPOOL_DIR = ${relivedir}/database
|
|
|
|
LOGS_DIR = ${relivedir}/logs
|
2022-01-17 11:49:16 +01:00
|
|
|
|
2024-01-16 13:51:42 +01:00
|
|
|
#.
|
|
|
|
#' scripts
|
|
|
|
#
|
|
|
|
|
2022-01-17 11:49:16 +01:00
|
|
|
ejabberdctl.relive:
|
2024-02-09 22:37:23 +01:00
|
|
|
$(SED) -e "s*{{installuser}}*${INSTALLUSER}*g" \
|
2022-04-25 12:46:48 +02:00
|
|
|
-e "s*{{config_dir}}*${CONFIG_DIR}*g" \
|
|
|
|
-e "s*{{logs_dir}}*${LOGS_DIR}*g" \
|
|
|
|
-e "s*{{spool_dir}}*${SPOOL_DIR}*g" \
|
2024-02-09 22:37:23 +01:00
|
|
|
-e "s*{{bindir}}*${BINDIR}*g" \
|
2023-12-20 15:27:08 +01:00
|
|
|
-e "s*{{libdir}}*${relivelibdir}${ELIXIR_LIBDIR}*g" \
|
2024-04-12 12:15:41 +02:00
|
|
|
-e "s*ERTS_VSN*# ERTS_VSN*g" \
|
2024-02-09 22:37:23 +01:00
|
|
|
-e "s*{{iexpath}}*${IEX}*g" \
|
|
|
|
-e "s*{{erl}}*${ERL}*g" \
|
|
|
|
-e "s*{{epmd}}*${EPMD}*g" ejabberdctl.template \
|
2022-01-17 11:49:16 +01:00
|
|
|
> ejabberdctl.relive
|
|
|
|
|
2022-05-20 11:24:39 +02:00
|
|
|
ejabberd.init:
|
|
|
|
$(SED) -e "s*@ctlscriptpath@*$(SBINDIR)*g" \
|
|
|
|
-e "s*@installuser@*$(INIT_USER)*g" ejabberd.init.template \
|
|
|
|
> ejabberd.init
|
|
|
|
chmod 755 ejabberd.init
|
|
|
|
|
|
|
|
ejabberd.service:
|
|
|
|
$(SED) -e "s*@ctlscriptpath@*$(SBINDIR)*g" \
|
|
|
|
-e "s*@installuser@*$(INIT_USER)*g" ejabberd.service.template \
|
|
|
|
> ejabberd.service
|
|
|
|
chmod 644 ejabberd.service
|
|
|
|
|
2022-04-25 12:46:48 +02:00
|
|
|
ejabberdctl.example: vars.config
|
2024-02-09 22:37:23 +01:00
|
|
|
$(SED) -e "s*{{installuser}}*${INSTALLUSER}*g" \
|
2022-04-25 12:46:48 +02:00
|
|
|
-e "s*{{config_dir}}*${ETCDIR}*g" \
|
|
|
|
-e "s*{{logs_dir}}*${LOGDIR}*g" \
|
|
|
|
-e "s*{{spool_dir}}*${SPOOLDIR}*g" \
|
2024-02-09 22:37:23 +01:00
|
|
|
-e "s*{{bindir}}*${BINDIR}*g" \
|
|
|
|
-e "s*{{libdir}}*${LIBDIR}${ELIXIR_LIBDIR}*g" \
|
2024-04-12 12:15:41 +02:00
|
|
|
-e "s*ERTS_VSN*# ERTS_VSN*g" \
|
2024-02-09 22:37:23 +01:00
|
|
|
-e "s*{{iexpath}}*${IEX}*g" \
|
|
|
|
-e "s*{{erl}}*${ERL}*g" \
|
|
|
|
-e "s*{{epmd}}*${EPMD}*g" ejabberdctl.template \
|
2013-04-08 11:12:54 +02:00
|
|
|
> ejabberdctl.example
|
2022-01-17 11:49:16 +01:00
|
|
|
|
2022-05-20 11:24:39 +02:00
|
|
|
scripts: ejabberd.init ejabberd.service ejabberdctl.example
|
|
|
|
|
2024-01-16 13:51:42 +01:00
|
|
|
#.
|
|
|
|
#' install
|
|
|
|
#
|
|
|
|
|
2024-01-16 13:53:43 +01:00
|
|
|
install: copy-files install-main
|
|
|
|
|
|
|
|
install-rel: copy-files-rel install-main
|
|
|
|
|
|
|
|
install-main:
|
2022-01-17 11:49:16 +01:00
|
|
|
#
|
|
|
|
# Configuration files
|
2022-05-19 12:20:42 +02:00
|
|
|
$(INSTALL) -d -m 750 $(G_USER) $(DESTDIR)$(ETCDIR)
|
|
|
|
[ -f $(DESTDIR)$(ETCDIR)/ejabberd.yml ] \
|
|
|
|
&& $(INSTALL) -b -m 640 $(G_USER) ejabberd.yml.example $(DESTDIR)$(ETCDIR)/ejabberd.yml-new \
|
|
|
|
|| $(INSTALL) -b -m 640 $(G_USER) ejabberd.yml.example $(DESTDIR)$(ETCDIR)/ejabberd.yml
|
|
|
|
[ -f $(DESTDIR)$(ETCDIR)/ejabberdctl.cfg ] \
|
|
|
|
&& $(INSTALL) -b -m 640 $(G_USER) ejabberdctl.cfg.example $(DESTDIR)$(ETCDIR)/ejabberdctl.cfg-new \
|
|
|
|
|| $(INSTALL) -b -m 640 $(G_USER) ejabberdctl.cfg.example $(DESTDIR)$(ETCDIR)/ejabberdctl.cfg
|
|
|
|
$(INSTALL) -b -m 644 $(G_USER) inetrc $(DESTDIR)$(ETCDIR)/inetrc
|
2013-04-08 11:12:54 +02:00
|
|
|
#
|
|
|
|
# Administration script
|
2022-05-19 12:20:42 +02:00
|
|
|
[ -d $(DESTDIR)$(SBINDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(SBINDIR)
|
|
|
|
$(INSTALL) -m 550 $(G_USER) ejabberdctl.example $(DESTDIR)$(SBINDIR)/ejabberdctl
|
2015-01-29 18:43:47 +01:00
|
|
|
# Elixir binaries
|
2022-05-19 12:20:42 +02:00
|
|
|
[ -d $(DESTDIR)$(BINDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)
|
|
|
|
[ -f $(DEPSDIR)/elixir/bin/iex ] && $(INSTALL) -m 550 $(G_USER) $(DEPSDIR)/elixir/bin/iex $(DESTDIR)$(BINDIR)/iex || true
|
|
|
|
[ -f $(DEPSDIR)/elixir/bin/elixir ] && $(INSTALL) -m 550 $(G_USER) $(DEPSDIR)/elixir/bin/elixir $(DESTDIR)$(BINDIR)/elixir || true
|
|
|
|
[ -f $(DEPSDIR)/elixir/bin/mix ] && $(INSTALL) -m 550 $(G_USER) $(DEPSDIR)/elixir/bin/mix $(DESTDIR)$(BINDIR)/mix || true
|
2013-04-08 11:12:54 +02:00
|
|
|
#
|
|
|
|
# Spool directory
|
2022-05-19 12:20:42 +02:00
|
|
|
$(INSTALL) -d -m 750 $(O_USER) $(DESTDIR)$(SPOOLDIR)
|
2024-02-09 22:37:23 +01:00
|
|
|
$(CHOWN_COMMAND) -R $(INSTALLUSER) $(DESTDIR)$(SPOOLDIR) >$(CHOWN_OUTPUT)
|
2022-05-19 12:20:42 +02:00
|
|
|
chmod -R 750 $(DESTDIR)$(SPOOLDIR)
|
2013-04-08 11:12:54 +02:00
|
|
|
#
|
|
|
|
# Log directory
|
2022-05-19 12:20:42 +02:00
|
|
|
$(INSTALL) -d -m 750 $(O_USER) $(DESTDIR)$(LOGDIR)
|
2024-02-09 22:37:23 +01:00
|
|
|
$(CHOWN_COMMAND) -R $(INSTALLUSER) $(DESTDIR)$(LOGDIR) >$(CHOWN_OUTPUT)
|
2022-05-19 12:20:42 +02:00
|
|
|
chmod -R 750 $(DESTDIR)$(LOGDIR)
|
2013-04-08 11:12:54 +02:00
|
|
|
#
|
|
|
|
# Documentation
|
2022-05-19 12:20:42 +02:00
|
|
|
$(INSTALL) -d $(DESTDIR)$(MANDIR)
|
|
|
|
$(INSTALL) -d $(DESTDIR)$(DOCDIR)
|
2020-01-08 10:47:54 +01:00
|
|
|
[ -f man/ejabberd.yml.5 ] \
|
2022-05-19 12:20:42 +02:00
|
|
|
&& $(INSTALL) -m 644 man/ejabberd.yml.5 $(DESTDIR)$(MANDIR) \
|
2020-01-08 10:45:58 +01:00
|
|
|
|| echo "Man page not included in sources"
|
2022-05-19 12:20:42 +02:00
|
|
|
$(INSTALL) -m 644 COPYING $(DESTDIR)$(DOCDIR)
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2024-01-16 13:51:42 +01:00
|
|
|
#.
|
|
|
|
#' uninstall
|
|
|
|
#
|
|
|
|
|
2013-04-08 11:12:54 +02:00
|
|
|
uninstall: uninstall-binary
|
|
|
|
|
2024-01-16 13:53:43 +01:00
|
|
|
uninstall-rel: uninstall-binary uninstall-librel
|
|
|
|
|
2013-04-08 11:12:54 +02:00
|
|
|
uninstall-binary:
|
2022-05-19 12:20:42 +02:00
|
|
|
rm -f $(DESTDIR)$(SBINDIR)/ejabberdctl
|
|
|
|
rm -f $(DESTDIR)$(BINDIR)/iex
|
|
|
|
rm -f $(DESTDIR)$(BINDIR)/elixir
|
|
|
|
rm -f $(DESTDIR)$(BINDIR)/mix
|
|
|
|
rm -fr $(DESTDIR)$(DOCDIR)
|
|
|
|
rm -f $(DESTDIR)$(BEAMDIR)/*.beam
|
|
|
|
rm -f $(DESTDIR)$(BEAMDIR)/*.app
|
|
|
|
rm -fr $(DESTDIR)$(BEAMDIR)
|
|
|
|
rm -f $(DESTDIR)$(INCLUDEDIR)/*.hrl
|
|
|
|
rm -fr $(DESTDIR)$(INCLUDEDIR)
|
|
|
|
rm -fr $(DESTDIR)$(PBINDIR)
|
|
|
|
rm -f $(DESTDIR)$(SODIR)/*.so
|
|
|
|
rm -fr $(DESTDIR)$(SODIR)
|
|
|
|
rm -f $(DESTDIR)$(MSGSDIR)/*.msg
|
|
|
|
rm -fr $(DESTDIR)$(MSGSDIR)
|
|
|
|
rm -f $(DESTDIR)$(CSSDIR)/*.css
|
|
|
|
rm -fr $(DESTDIR)$(CSSDIR)
|
|
|
|
rm -f $(DESTDIR)$(IMGDIR)/*.png
|
|
|
|
rm -fr $(DESTDIR)$(IMGDIR)
|
|
|
|
rm -f $(DESTDIR)$(JSDIR)/*.js
|
|
|
|
rm -fr $(DESTDIR)$(JSDIR)
|
|
|
|
rm -f $(DESTDIR)$(SQLDIR)/*.sql
|
|
|
|
rm -fr $(DESTDIR)$(SQLDIR)
|
|
|
|
rm -fr $(DESTDIR)$(LUADIR)/*.lua
|
|
|
|
rm -fr $(DESTDIR)$(LUADIR)
|
|
|
|
rm -fr $(DESTDIR)$(PRIVDIR)
|
|
|
|
rm -fr $(DESTDIR)$(EJABBERDDIR)
|
2024-01-16 16:52:58 +01:00
|
|
|
rm -f $(DESTDIR)$(MANDIR)/ejabberd.yml.5
|
2013-04-08 11:12:54 +02:00
|
|
|
|
|
|
|
uninstall-all: uninstall-binary
|
2022-05-19 12:20:42 +02:00
|
|
|
rm -rf $(DESTDIR)$(ETCDIR)
|
|
|
|
rm -rf $(DESTDIR)$(EJABBERDDIR)
|
|
|
|
rm -rf $(DESTDIR)$(SPOOLDIR)
|
|
|
|
rm -rf $(DESTDIR)$(LOGDIR)
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2024-01-16 13:51:42 +01:00
|
|
|
#.
|
|
|
|
#' clean
|
|
|
|
#
|
|
|
|
|
2013-04-08 11:12:54 +02:00
|
|
|
clean:
|
2020-09-23 16:52:21 +02:00
|
|
|
rm -rf $(DEPSDIR)/.got
|
|
|
|
rm -rf $(DEPSDIR)/.built
|
2013-06-27 07:35:10 +02:00
|
|
|
rm -rf test/*.beam
|
2022-05-20 11:49:07 +02:00
|
|
|
rm -f rebar.lock
|
|
|
|
rm -f ejabberdctl.example ejabberd.init ejabberd.service
|
|
|
|
$(REBAR) clean $(CLEANARG)
|
2013-04-08 11:12:54 +02:00
|
|
|
|
|
|
|
clean-rel:
|
|
|
|
rm -rf rel/ejabberd
|
|
|
|
|
|
|
|
distclean: clean clean-rel
|
2022-05-20 11:49:07 +02:00
|
|
|
rm -f aclocal.m4
|
2013-04-08 11:12:54 +02:00
|
|
|
rm -f config.status
|
|
|
|
rm -f config.log
|
|
|
|
rm -rf autom4te.cache
|
2020-09-23 16:52:21 +02:00
|
|
|
rm -rf $(EBINDIR)
|
|
|
|
rm -rf $(DEPSBASE)
|
2022-05-20 11:49:07 +02:00
|
|
|
rm -rf deps
|
2013-04-08 11:12:54 +02:00
|
|
|
rm -f Makefile
|
|
|
|
rm -f vars.config
|
|
|
|
|
2024-01-16 13:51:42 +01:00
|
|
|
#.
|
|
|
|
#' releases
|
|
|
|
#
|
|
|
|
|
2024-01-08 19:02:35 +01:00
|
|
|
rel: prod
|
|
|
|
|
|
|
|
prod:
|
2023-12-20 01:46:51 +01:00
|
|
|
$(PREPARE_ELIXIR_SCRIPTS)
|
2021-07-15 21:31:31 +02:00
|
|
|
$(REBARREL)
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2022-04-25 12:46:48 +02:00
|
|
|
DEV_CONFIG = _build/dev/rel/ejabberd/conf/ejabberd.yml
|
2021-06-25 12:40:26 +02:00
|
|
|
|
|
|
|
dev $(DEV_CONFIG):
|
2023-12-20 01:46:51 +01:00
|
|
|
$(PREPARE_ELIXIR_SCRIPTS)
|
2021-07-15 21:31:31 +02:00
|
|
|
$(REBARDEV)
|
2021-06-25 12:40:26 +02:00
|
|
|
|
2024-01-16 13:51:42 +01:00
|
|
|
#.
|
|
|
|
#' tags
|
|
|
|
#
|
|
|
|
|
2013-04-08 11:12:54 +02:00
|
|
|
TAGS:
|
2024-01-16 13:52:38 +01:00
|
|
|
etags src/*.erl
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2024-01-16 13:51:42 +01:00
|
|
|
#.
|
|
|
|
#' makefile
|
|
|
|
#
|
|
|
|
|
2013-04-08 11:12:54 +02:00
|
|
|
Makefile: Makefile.in
|
|
|
|
|
2024-01-16 13:51:42 +01:00
|
|
|
#.
|
|
|
|
#' dialyzer
|
|
|
|
#
|
|
|
|
|
2024-02-29 16:46:05 +01:00
|
|
|
ifeq "$(REBAR_VER)" "6" # Mix
|
2021-02-17 17:24:36 +01:00
|
|
|
dialyzer:
|
2024-02-29 16:46:05 +01:00
|
|
|
MIX_ENV=test $(REBAR) dialyzer
|
|
|
|
|
2021-02-17 17:24:36 +01:00
|
|
|
else
|
2024-02-29 16:46:05 +01:00
|
|
|
ifeq "$(REBAR_VER)" "3" # Rebar3
|
|
|
|
dialyzer:
|
|
|
|
$(REBAR) dialyzer
|
|
|
|
|
|
|
|
else # Rebar2
|
2020-09-21 16:14:12 +02:00
|
|
|
deps := $(wildcard $(DEPSDIR)/*/ebin)
|
2013-06-23 19:37:18 +02:00
|
|
|
|
|
|
|
dialyzer/erlang.plt:
|
2024-01-16 16:06:04 +01:00
|
|
|
@$(MKDIR_P) dialyzer
|
2013-06-23 19:37:18 +02:00
|
|
|
@dialyzer --build_plt --output_plt dialyzer/erlang.plt \
|
|
|
|
-o dialyzer/erlang.log --apps kernel stdlib sasl crypto \
|
2019-06-14 11:33:26 +02:00
|
|
|
public_key ssl mnesia inets odbc compiler erts \
|
|
|
|
os_mon asn1 syntax_tools; \
|
2013-06-23 19:37:18 +02:00
|
|
|
status=$$? ; if [ $$status -ne 2 ]; then exit $$status; else exit 0; fi
|
|
|
|
|
|
|
|
dialyzer/deps.plt:
|
2024-01-16 16:06:04 +01:00
|
|
|
@$(MKDIR_P) dialyzer
|
2013-06-23 19:37:18 +02:00
|
|
|
@dialyzer --build_plt --output_plt dialyzer/deps.plt \
|
|
|
|
-o dialyzer/deps.log $(deps); \
|
|
|
|
status=$$? ; if [ $$status -ne 2 ]; then exit $$status; else exit 0; fi
|
|
|
|
|
|
|
|
dialyzer/ejabberd.plt:
|
2024-01-16 16:06:04 +01:00
|
|
|
@$(MKDIR_P) dialyzer
|
2013-06-23 19:37:18 +02:00
|
|
|
@dialyzer --build_plt --output_plt dialyzer/ejabberd.plt \
|
|
|
|
-o dialyzer/ejabberd.log ebin; \
|
|
|
|
status=$$? ; if [ $$status -ne 2 ]; then exit $$status; else exit 0; fi
|
|
|
|
|
2013-06-24 05:11:45 +02:00
|
|
|
erlang_plt: dialyzer/erlang.plt
|
2013-06-24 12:58:52 +02:00
|
|
|
@dialyzer --plt dialyzer/erlang.plt --check_plt -o dialyzer/erlang.log; \
|
|
|
|
status=$$? ; if [ $$status -ne 2 ]; then exit $$status; else exit 0; fi
|
2013-06-24 05:11:45 +02:00
|
|
|
|
|
|
|
deps_plt: dialyzer/deps.plt
|
2013-06-24 12:58:52 +02:00
|
|
|
@dialyzer --plt dialyzer/deps.plt --check_plt -o dialyzer/deps.log; \
|
|
|
|
status=$$? ; if [ $$status -ne 2 ]; then exit $$status; else exit 0; fi
|
2013-06-24 05:11:45 +02:00
|
|
|
|
|
|
|
ejabberd_plt: dialyzer/ejabberd.plt
|
2013-06-24 12:58:52 +02:00
|
|
|
@dialyzer --plt dialyzer/ejabberd.plt --check_plt -o dialyzer/ejabberd.log; \
|
|
|
|
status=$$? ; if [ $$status -ne 2 ]; then exit $$status; else exit 0; fi
|
2013-06-24 05:11:45 +02:00
|
|
|
|
|
|
|
dialyzer: erlang_plt deps_plt ejabberd_plt
|
|
|
|
@dialyzer --plts dialyzer/*.plt --no_check_plt \
|
2013-06-23 19:37:18 +02:00
|
|
|
--get_warnings -o dialyzer/error.log ebin; \
|
|
|
|
status=$$? ; if [ $$status -ne 2 ]; then exit $$status; else exit 0; fi
|
2021-02-17 17:24:36 +01:00
|
|
|
endif
|
2024-02-29 16:46:05 +01:00
|
|
|
endif
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2024-08-26 11:54:36 +02:00
|
|
|
#.
|
|
|
|
#' elvis
|
|
|
|
#
|
|
|
|
|
|
|
|
elvis:
|
|
|
|
$(REBAR) lint
|
|
|
|
|
2024-01-16 13:51:42 +01:00
|
|
|
#.
|
|
|
|
#' test
|
|
|
|
#
|
|
|
|
|
2013-04-08 11:12:54 +02:00
|
|
|
test:
|
2013-06-19 12:11:20 +02:00
|
|
|
@echo "************************** NOTICE ***************************************"
|
|
|
|
@cat test/README
|
|
|
|
@echo "*************************************************************************"
|
2015-03-16 19:53:19 +01:00
|
|
|
@cd priv && ln -sf ../sql
|
2020-09-21 16:14:12 +02:00
|
|
|
$(REBAR) $(SKIPDEPS) ct
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2024-06-25 12:04:31 +02:00
|
|
|
test-eunit:
|
|
|
|
$(REBAR) $(SKIPDEPS) eunit --verbose
|
|
|
|
|
2024-01-16 13:51:42 +01:00
|
|
|
#.
|
|
|
|
#' phony
|
|
|
|
#
|
|
|
|
|
2024-01-08 19:02:35 +01:00
|
|
|
.PHONY: src edoc dialyzer Makefile TAGS clean clean-rel distclean prod rel \
|
2024-06-25 12:04:31 +02:00
|
|
|
install uninstall uninstall-binary uninstall-all translations deps test test-eunit \
|
2024-01-16 13:53:43 +01:00
|
|
|
all dev doap help install-rel relive scripts uninstall-rel update \
|
2024-06-02 13:36:37 +02:00
|
|
|
erlang_plt deps_plt ejabberd_plt xref hooks options format indent
|
2021-06-25 12:33:24 +02:00
|
|
|
|
2024-01-16 13:51:42 +01:00
|
|
|
#.
|
|
|
|
#' help
|
|
|
|
#
|
|
|
|
|
2021-06-25 12:33:24 +02:00
|
|
|
help:
|
|
|
|
@echo ""
|
2022-05-23 13:13:56 +02:00
|
|
|
@echo " [all] "
|
|
|
|
@echo " scripts Prepare ejabberd start scripts"
|
|
|
|
@echo " deps Get and configure dependencies"
|
|
|
|
@echo " src Compile dependencies and ejabberd"
|
2024-02-26 11:37:09 +01:00
|
|
|
@echo " update Update dependencies source code"
|
2021-06-25 12:33:24 +02:00
|
|
|
@echo " clean Clean binary files"
|
|
|
|
@echo " distclean Clean completely the development files"
|
|
|
|
@echo ""
|
|
|
|
@echo " install Install ejabberd to /usr/local"
|
2024-01-16 13:53:43 +01:00
|
|
|
@echo " install-rel Install ejabberd to /usr/local (using release)"
|
2021-06-25 12:33:24 +02:00
|
|
|
@echo " uninstall Uninstall ejabberd (buggy)"
|
2024-01-16 13:53:43 +01:00
|
|
|
@echo " uninstall-rel Uninstall ejabberd (using release)"
|
2021-06-25 12:33:24 +02:00
|
|
|
@echo " uninstall-all Uninstall also configuration, logs, mnesia... (buggy)"
|
|
|
|
@echo ""
|
2024-01-08 19:02:35 +01:00
|
|
|
@echo " prod Build a production release"
|
2021-06-25 12:33:24 +02:00
|
|
|
@echo " dev Build a development release"
|
2022-01-17 11:49:16 +01:00
|
|
|
@echo " relive Start a live ejabberd in _build/relive/"
|
2021-06-25 12:33:24 +02:00
|
|
|
@echo ""
|
2022-11-04 11:41:14 +01:00
|
|
|
@echo " doap Generate DOAP file"
|
2024-02-23 12:44:39 +01:00
|
|
|
@echo " edoc Generate EDoc documentation [mix]"
|
2021-06-25 12:33:24 +02:00
|
|
|
@echo " options Generate ejabberd_option.erl"
|
2024-02-13 13:05:09 +01:00
|
|
|
@echo " translations Extract translation files"
|
2024-01-16 13:52:38 +01:00
|
|
|
@echo " TAGS Generate tags file for text editors"
|
2021-06-25 12:33:24 +02:00
|
|
|
@echo ""
|
2024-11-22 10:48:05 +01:00
|
|
|
@echo " format Format source code using rebar3_format"
|
2024-06-02 13:36:37 +02:00
|
|
|
@echo " indent Indent source code using erlang-mode [emacs]"
|
|
|
|
@echo ""
|
2024-02-29 16:46:05 +01:00
|
|
|
@echo " dialyzer Run Dialyzer static analyzer"
|
2024-08-26 11:54:36 +02:00
|
|
|
@echo " elvis Run Elvis source code style reviewer [rebar3]"
|
2021-06-25 12:33:24 +02:00
|
|
|
@echo " hooks Run hooks validator"
|
2024-02-26 11:37:09 +01:00
|
|
|
@echo " test Run Common Tests suite [rebar3]"
|
2024-06-25 12:04:31 +02:00
|
|
|
@echo " test-eunit Run EUnit suite [rebar3]"
|
2024-02-26 11:37:09 +01:00
|
|
|
@echo " xref Run cross reference analysis [rebar3]"
|
2024-01-16 13:51:42 +01:00
|
|
|
|
|
|
|
#.
|
|
|
|
#'
|
|
|
|
# vim: foldmarker=#',#. foldmethod=marker:
|