util.encodings: Spell out all IDNA 2008 options ICU has
[prosody.git] / GNUmakefile
blob15362f5c8b1ddadaaa4635bc2d495d3d11888f7b
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
24 SCANSION=scansion
26 .PHONY: all test coverage clean install
28 all: prosody.install prosodyctl.install prosody.cfg.lua.install prosody.version
29 $(MAKE) -C util-src install
30 ifeq ($(EXCERTS),yes)
31 -$(MAKE) -C certs localhost.crt example.com.crt
32 endif
34 install: prosody.install prosodyctl.install prosody.cfg.lua.install util/encodings.so util/encodings.so util/pposix.so util/signal.so
35 $(MKDIR) $(BIN) $(CONFIG) $(MODULES) $(SOURCE)
36 $(MKDIR_PRIVATE) $(DATA)
37 $(MKDIR) $(MAN)/man1
38 $(MKDIR) $(CONFIG)/certs
39 $(MKDIR) $(SOURCE)/core $(SOURCE)/net $(SOURCE)/util
40 $(INSTALL_EXEC) ./prosody.install $(BIN)/prosody
41 $(INSTALL_EXEC) ./prosodyctl.install $(BIN)/prosodyctl
42 $(INSTALL_DATA) core/*.lua $(SOURCE)/core
43 $(INSTALL_DATA) net/*.lua $(SOURCE)/net
44 $(MKDIR) $(SOURCE)/net/http $(SOURCE)/net/resolvers $(SOURCE)/net/websocket
45 $(INSTALL_DATA) net/http/*.lua $(SOURCE)/net/http
46 $(INSTALL_DATA) net/resolvers/*.lua $(SOURCE)/net/resolvers
47 $(INSTALL_DATA) net/websocket/*.lua $(SOURCE)/net/websocket
48 $(INSTALL_DATA) util/*.lua $(SOURCE)/util
49 $(INSTALL_DATA) util/*.so $(SOURCE)/util
50 $(MKDIR) $(SOURCE)/util/sasl
51 $(INSTALL_DATA) util/sasl/*.lua $(SOURCE)/util/sasl
52 $(MKDIR) $(MODULES)/mod_s2s $(MODULES)/mod_pubsub $(MODULES)/adhoc $(MODULES)/muc $(MODULES)/mod_mam
53 $(INSTALL_DATA) plugins/*.lua $(MODULES)
54 $(INSTALL_DATA) plugins/mod_s2s/*.lua $(MODULES)/mod_s2s
55 $(INSTALL_DATA) plugins/mod_pubsub/*.lua $(MODULES)/mod_pubsub
56 $(INSTALL_DATA) plugins/adhoc/*.lua $(MODULES)/adhoc
57 $(INSTALL_DATA) plugins/muc/*.lua $(MODULES)/muc
58 $(INSTALL_DATA) plugins/mod_mam/*.lua $(MODULES)/mod_mam
59 $(INSTALL_DATA) certs/* $(CONFIG)/certs
60 $(INSTALL_DATA) man/prosodyctl.man $(MAN)/man1/prosodyctl.1
61 test -f $(CONFIG)/prosody.cfg.lua || $(INSTALL_DATA) prosody.cfg.lua.install $(CONFIG)/prosody.cfg.lua
62 -test -f prosody.version && $(INSTALL_DATA) prosody.version $(SOURCE)/prosody.version
63 $(MAKE) install -C util-src
65 clean:
66 rm -f prosody.install
67 rm -f prosodyctl.install
68 rm -f prosody.cfg.lua.install
69 rm -f prosody.version
70 $(MAKE) clean -C util-src
72 test:
73 $(BUSTED) --lua=$(RUNWITH)
75 integration-test: all
76 $(MKDIR) data
77 $(RUNWITH) prosodyctl --config ./spec/scansion/prosody.cfg.lua start
78 $(SCANSION) -d ./spec/scansion; R=$$? \
79 $(RUNWITH) prosodyctl --config ./spec/scansion/prosody.cfg.lua stop \
80 exit $$R
82 coverage:
83 -rm -- luacov.*
84 $(BUSTED) --lua=$(RUNWITH) -c
85 luacov
86 luacov-console
87 luacov-console -s
88 @echo "To inspect individual files run: luacov-console -l FILENAME"
90 lint:
91 $(LUACHECK) -q $$(HGPLAIN= hg files -I '**.lua') prosody prosodyctl
92 @echo $$(sed -n '/^\tlocal exclude_files/,/^}/p;' .luacheckrc | sed '1d;$d' | wc -l) files ignored
93 shellcheck configure
95 util/%.so:
96 $(MAKE) install -C util-src
98 %.install: %
99 sed "1s| lua$$| $(RUNWITH)|; \
100 s|^CFG_SOURCEDIR=.*;$$|CFG_SOURCEDIR='$(INSTALLEDSOURCE)';|; \
101 s|^CFG_CONFIGDIR=.*;$$|CFG_CONFIGDIR='$(INSTALLEDCONFIG)';|; \
102 s|^CFG_DATADIR=.*;$$|CFG_DATADIR='$(INSTALLEDDATA)';|; \
103 s|^CFG_PLUGINDIR=.*;$$|CFG_PLUGINDIR='$(INSTALLEDMODULES)/';|;" < $^ > $@
105 prosody.cfg.lua.install: prosody.cfg.lua.dist
106 sed 's|certs/|$(INSTALLEDCONFIG)/certs/|' $^ > $@
108 %.version: %.release
109 cp $^ $@
111 %.version: .hg_archival.txt
112 sed -n 's/^node: \(............\).*/\1/p' $^ > $@
114 %.version: .hg/dirstate
115 hexdump -n6 -e'6/1 "%02x"' $^ > $@
117 %.version:
118 echo unknown > $@