CHANGES: Update for release
[prosody.git] / Makefile
bloba5f75c1926eff939833dc263727c4b8927428021
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 .PHONY: all test clean install
24 all: prosody.install prosodyctl.install prosody.cfg.lua.install prosody.version
25 $(MAKE) -C util-src install
26 ifeq ($(EXCERTS),yes)
27 -$(MAKE) -C certs localhost.crt example.com.crt
28 endif
30 install: prosody.install prosodyctl.install prosody.cfg.lua.install util/encodings.so util/encodings.so util/pposix.so util/signal.so
31 $(MKDIR) $(BIN) $(CONFIG) $(MODULES) $(SOURCE)
32 $(MKDIR_PRIVATE) $(DATA)
33 $(MKDIR) $(MAN)/man1
34 $(MKDIR) $(CONFIG)/certs
35 $(MKDIR) $(SOURCE)/core $(SOURCE)/net $(SOURCE)/util
36 $(INSTALL_EXEC) ./prosody.install $(BIN)/prosody
37 $(INSTALL_EXEC) ./prosodyctl.install $(BIN)/prosodyctl
38 $(INSTALL_DATA) core/*.lua $(SOURCE)/core
39 $(INSTALL_DATA) net/*.lua $(SOURCE)/net
40 $(MKDIR) $(SOURCE)/net/http $(SOURCE)/net/websocket
41 $(INSTALL_DATA) net/http/*.lua $(SOURCE)/net/http
42 $(INSTALL_DATA) net/websocket/*.lua $(SOURCE)/net/websocket
43 $(INSTALL_DATA) util/*.lua $(SOURCE)/util
44 $(INSTALL_DATA) util/*.so $(SOURCE)/util
45 $(MKDIR) $(SOURCE)/util/sasl
46 $(INSTALL_DATA) util/sasl/*.lua $(SOURCE)/util/sasl
47 $(MKDIR) $(MODULES)/mod_s2s $(MODULES)/mod_pubsub $(MODULES)/adhoc $(MODULES)/muc $(MODULES)/mod_mam
48 $(INSTALL_DATA) plugins/*.lua $(MODULES)
49 $(INSTALL_DATA) plugins/mod_s2s/*.lua $(MODULES)/mod_s2s
50 $(INSTALL_DATA) plugins/mod_pubsub/*.lua $(MODULES)/mod_pubsub
51 $(INSTALL_DATA) plugins/adhoc/*.lua $(MODULES)/adhoc
52 $(INSTALL_DATA) plugins/muc/*.lua $(MODULES)/muc
53 $(INSTALL_DATA) plugins/mod_mam/*.lua $(MODULES)/mod_mam
54 $(INSTALL_DATA) certs/* $(CONFIG)/certs
55 $(INSTALL_DATA) man/prosodyctl.man $(MAN)/man1/prosodyctl.1
56 test -f $(CONFIG)/prosody.cfg.lua || $(INSTALL_DATA) prosody.cfg.lua.install $(CONFIG)/prosody.cfg.lua
57 -test -f prosody.version && $(INSTALL_DATA) prosody.version $(SOURCE)/prosody.version
58 $(MAKE) install -C util-src
60 clean:
61 rm -f prosody.install
62 rm -f prosodyctl.install
63 rm -f prosody.cfg.lua.install
64 rm -f prosody.version
65 $(MAKE) clean -C util-src
67 test:
68 cd tests && $(RUNWITH) test.lua 0
69 # Skipping: cd tests && RUNWITH=$(RUNWITH) ./test_util_json.sh
71 util/%.so:
72 $(MAKE) install -C util-src
74 %.install: %
75 sed "1s| lua$$| $(RUNWITH)|; \
76 s|^CFG_SOURCEDIR=.*;$$|CFG_SOURCEDIR='$(INSTALLEDSOURCE)';|; \
77 s|^CFG_CONFIGDIR=.*;$$|CFG_CONFIGDIR='$(INSTALLEDCONFIG)';|; \
78 s|^CFG_DATADIR=.*;$$|CFG_DATADIR='$(INSTALLEDDATA)';|; \
79 s|^CFG_PLUGINDIR=.*;$$|CFG_PLUGINDIR='$(INSTALLEDMODULES)/';|;" < $^ > $@
81 prosody.cfg.lua.install: prosody.cfg.lua.dist
82 sed 's|certs/|$(INSTALLEDCONFIG)/certs/|' $^ > $@
84 %.version: %.release
85 cp $^ $@
87 %.version: .hg_archival.txt
88 sed -n 's/^node: \(............\).*/\1/p' $^ > $@
90 %.version: .hg/dirstate
91 hexdump -n6 -e'6/1 "%02x"' $^ > $@
93 %.version:
94 echo unknown > $@