]> rtime.felk.cvut.cz Git - omk.git/blobdiff - Makefile
Merge branch 'devel' of sojka@rtime.felk.cvut.cz:/var/git/omk into devel
[omk.git] / Makefile
index 24e4679ea64c704ea5f12d1010619219b00bfebf..ef2541eda365d3d33f6f9fdca9c9357ab1d360c3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,9 @@
 
-.PHONY: all split test tests
+.PHONY: all split test tests release buildrules doc
 
-all:
+all: buildrules
+
+buildrules:
        chmod +x omkbuild.py
        ./omkbuild.py --all
 
@@ -10,4 +12,25 @@ split:
        cd snippets; ../omkbuild.py --split=../Makefile.rules
 
 test tests:
-       $(MAKE) -C tests
\ No newline at end of file
+       $(MAKE) -C tests
+
+doc:
+       $(MAKE) -C doc
+
+VERSION:=$(shell git describe|sed -e 's/^v//')
+export VERSION                 # Export for doc/
+RELEASE_DIR := omk-$(VERSION)
+release: tag-check doc buildrules
+       -rm -rf $(RELEASE_DIR)
+       mkdir -p $(RELEASE_DIR)
+       cp -a rules $(RELEASE_DIR)
+       for i in $(RELEASE_DIR)/rules/*; do cp leaf-makefile/Makefile $$i; done
+       mkdir -p $(RELEASE_DIR)/doc
+       cp -a doc/omk-manual.txt doc/omk-manual.html doc/omk-manual.pdf $(RELEASE_DIR)/doc
+       cp COPYING $(RELEASE_DIR)
+       tar czf $(RELEASE_DIR).tar.gz $(RELEASE_DIR)
+       rm -rf $(RELEASE_DIR)
+       gpg -sba $(RELEASE_DIR).tar.gz
+
+tag-check:
+       @test -n "$(VERSION)" || (echo "To create a release, please tag the repository with the tag 'vX.Y...'"; exit 1)