Merge 0.10->trunk
[prosody.git] / Makefile
index 492d7ea5fd2b3f14c3d4ab798538f50ea70814c6..06e67c9ce119df61296797db8ebdf2357eeec1a8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ INSTALLEDDATA = $(DATADIR)
 all: prosody.install prosodyctl.install prosody.cfg.lua.install prosody.version
        $(MAKE) -C util-src install
 ifeq ($(EXCERTS),yes)
-       $(MAKE) -C certs localhost.crt example.com.crt || true
+       -$(MAKE) -C certs localhost.crt example.com.crt
 endif
 
 install: prosody.install prosodyctl.install prosody.cfg.lua.install util/encodings.so util/encodings.so util/pposix.so util/signal.so
@@ -29,7 +29,7 @@ install: prosody.install prosodyctl.install prosody.cfg.lua.install util/encodin
        install -d $(SOURCE)/core $(SOURCE)/net $(SOURCE)/util
        install -m755 ./prosody.install $(BIN)/prosody
        install -m755 ./prosodyctl.install $(BIN)/prosodyctl
-       install -m644 core/* $(SOURCE)/core
+       install -m644 core/*.lua $(SOURCE)/core
        install -m644 net/*.lua $(SOURCE)/net
        install -d $(SOURCE)/net/http $(SOURCE)/net/websocket
        install -m644 net/http/*.lua $(SOURCE)/net/http
@@ -42,7 +42,7 @@ install: prosody.install prosodyctl.install prosody.cfg.lua.install util/encodin
        install -m644 certs/* $(CONFIG)/certs
        install -m644 man/prosodyctl.man $(MAN)/man1/prosodyctl.1
        test -f $(CONFIG)/prosody.cfg.lua || install -m644 prosody.cfg.lua.install $(CONFIG)/prosody.cfg.lua
-       test -f prosody.version && install -m644 prosody.version $(SOURCE)/prosody.version || true
+       -test -f prosody.version && install -m644 prosody.version $(SOURCE)/prosody.version
        $(MAKE) install -C util-src
 
 clean:
@@ -52,6 +52,10 @@ clean:
        rm -f prosody.version
        $(MAKE) clean -C util-src
 
+test:
+       cd tests && $(RUNWITH) test.lua 0
+       # Skipping: cd tests && RUNWITH=$(RUNWITH) ./test_util_json.sh
+
 util/%.so:
        $(MAKE) install -C util-src
 
@@ -65,8 +69,16 @@ util/%.so:
 prosody.cfg.lua.install: prosody.cfg.lua.dist
        sed 's|certs/|$(INSTALLEDCONFIG)/certs/|' $^ > $@
 
-prosody.version: $(wildcard prosody.release .hg/dirstate)
-       test -d .hg/dirstate && \
-               hexdump -n6 -e'6/1 "%02x"' .hg/dirstate > $@ || true
-       test -f prosody.release && \
-               cp prosody.release $@ || true
+%.version: %.release
+       cp $^ $@
+
+%.version: .hg_archival.txt
+       sed -n 's/^node: \(............\).*/\1/p' $^ > $@
+
+%.version: .hg/dirstate
+       hexdump -n6 -e'6/1 "%02x"' $^ > $@
+
+%.version:
+       echo unknown > $@
+
+