mod_csi_simple: Consider messages encrypted payload as important (fixes part of ...
[prosody.git] / GNUmakefile
blob6c134679bf3427a393f96501a6dd703819cfb1b9
2 include config.unix
4 BIN = $(DESTDIR)$(PREFIX)/bin
5 CONFIG = $(DESTDIR)$(SYSCONFDIR)
6 MODULES = $(DESTDIR)$(LIBDIR)/prosody/modules
7 SOURCE = $(DESTDIR)$(LIBDIR)/prosody
8 DATA = $(DESTDIR)$(DATADIR)
9 MAN = $(DESTDIR)$(PREFIX)/share/man
11 INSTALLEDSOURCE = $(LIBDIR)/prosody
12 INSTALLEDCONFIG = $(SYSCONFDIR)
13 INSTALLEDMODULES = $(LIBDIR)/prosody/modules
14 INSTALLEDDATA = $(DATADIR)
16 INSTALL=install -p
17 INSTALL_DATA=$(INSTALL) -m644
18 INSTALL_EXEC=$(INSTALL) -m755
19 MKDIR=install -d
20 MKDIR_PRIVATE=$(MKDIR) -m750
22 LUACHECK=luacheck
23 BUSTED=busted
25 .PHONY: all test coverage clean install
27 all: prosody.install prosodyctl.install prosody.cfg.lua.install prosody.version
28 $(MAKE) -C util-src install
29 ifeq ($(EXCERTS),yes)
30 -$(MAKE) -C certs localhost.crt example.com.crt
31 endif
33 install: prosody.install prosodyctl.install prosody.cfg.lua.install util/encodings.so util/encodings.so util/pposix.so util/signal.so
34 $(MKDIR) $(BIN) $(CONFIG) $(MODULES) $(SOURCE)
35 $(MKDIR_PRIVATE) $(DATA)
36 $(MKDIR) $(MAN)/man1
37 $(MKDIR) $(CONFIG)/certs
38 $(MKDIR) $(SOURCE)/core $(SOURCE)/net $(SOURCE)/util
39 $(INSTALL_EXEC) ./prosody.install $(BIN)/prosody
40 $(INSTALL_EXEC) ./prosodyctl.install $(BIN)/prosodyctl
41 $(INSTALL_DATA) core/*.lua $(SOURCE)/core
42 $(INSTALL_DATA) net/*.lua $(SOURCE)/net
43 $(MKDIR) $(SOURCE)/net/http $(SOURCE)/net/resolvers $(SOURCE)/net/websocket
44 $(INSTALL_DATA) net/http/*.lua $(SOURCE)/net/http
45 $(INSTALL_DATA) net/resolvers/*.lua $(SOURCE)/net/resolvers
46 $(INSTALL_DATA) net/websocket/*.lua $(SOURCE)/net/websocket
47 $(INSTALL_DATA) util/*.lua $(SOURCE)/util
48 $(INSTALL_DATA) util/*.so $(SOURCE)/util
49 $(MKDIR) $(SOURCE)/util/sasl
50 $(INSTALL_DATA) util/sasl/*.lua $(SOURCE)/util/sasl
51 $(MKDIR) $(MODULES)/mod_s2s $(MODULES)/mod_pubsub $(MODULES)/adhoc $(MODULES)/muc $(MODULES)/mod_mam
52 $(INSTALL_DATA) plugins/*.lua $(MODULES)
53 $(INSTALL_DATA) plugins/mod_s2s/*.lua $(MODULES)/mod_s2s
54 $(INSTALL_DATA) plugins/mod_pubsub/*.lua $(MODULES)/mod_pubsub
55 $(INSTALL_DATA) plugins/adhoc/*.lua $(MODULES)/adhoc
56 $(INSTALL_DATA) plugins/muc/*.lua $(MODULES)/muc
57 $(INSTALL_DATA) plugins/mod_mam/*.lua $(MODULES)/mod_mam
58 $(INSTALL_DATA) certs/* $(CONFIG)/certs
59 $(INSTALL_DATA) man/prosodyctl.man $(MAN)/man1/prosodyctl.1
60 test -f $(CONFIG)/prosody.cfg.lua || $(INSTALL_DATA) prosody.cfg.lua.install $(CONFIG)/prosody.cfg.lua
61 -test -f prosody.version && $(INSTALL_DATA) prosody.version $(SOURCE)/prosody.version
62 $(MAKE) install -C util-src
64 clean:
65 rm -f prosody.install
66 rm -f prosodyctl.install
67 rm -f prosody.cfg.lua.install
68 rm -f prosody.version
69 $(MAKE) clean -C util-src
71 test:
72 $(BUSTED) --lua=$(RUNWITH)
74 coverage:
75 -rm -- luacov.*
76 $(BUSTED) --lua=$(RUNWITH) -c
77 luacov
78 luacov-console
79 luacov-console -s
80 @echo "To inspect individual files run: luacov-console -l FILENAME"
82 lint:
83 $(LUACHECK) -q $$(HGPLAIN= hg files -I '**.lua') prosody prosodyctl
84 @echo $$(sed -n '/^\tlocal exclude_files/,/^}/p;' .luacheckrc | sed '1d;$d' | wc -l) files ignored
85 shellcheck configure
87 util/%.so:
88 $(MAKE) install -C util-src
90 %.install: %
91 sed "1s| lua$$| $(RUNWITH)|; \
92 s|^CFG_SOURCEDIR=.*;$$|CFG_SOURCEDIR='$(INSTALLEDSOURCE)';|; \
93 s|^CFG_CONFIGDIR=.*;$$|CFG_CONFIGDIR='$(INSTALLEDCONFIG)';|; \
94 s|^CFG_DATADIR=.*;$$|CFG_DATADIR='$(INSTALLEDDATA)';|; \
95 s|^CFG_PLUGINDIR=.*;$$|CFG_PLUGINDIR='$(INSTALLEDMODULES)/';|;" < $^ > $@
97 prosody.cfg.lua.install: prosody.cfg.lua.dist
98 sed 's|certs/|$(INSTALLEDCONFIG)/certs/|' $^ > $@
100 %.version: %.release
101 cp $^ $@
103 %.version: .hg_archival.txt
104 sed -n 's/^node: \(............\).*/\1/p' $^ > $@
106 %.version: .hg/dirstate
107 hexdump -n6 -e'6/1 "%02x"' $^ > $@
109 %.version:
110 echo unknown > $@