]> rtime.felk.cvut.cz Git - omk/sssa.git/commitdiff
Added release target to OMK makefile
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 23 Apr 2008 20:42:00 +0000 (20:42 +0000)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 23 Apr 2008 20:42:00 +0000 (20:42 +0000)
darcs-hash:20080423204204-f2ef6-2215b765179837a154ad51ad8199e8ecaefc61ba.gz

Makefile

index 24e4679ea64c704ea5f12d1010619219b00bfebf..c2af4199ed96d5b07d71e1e56157ef0417b9ea16 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 darcs changes --last=1|sed -ne '/tagged/ s/^ *tagged v\(.*\)/\1/p')
+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)