Makefile 1013 Bytes
Newer Older
1 2 3 4 5 6
# use something like "VERSION=0.2 make" to override the VERSION on the command line
VERSION ?= svn
SVN_BASE = https://pycam.svn.sourceforge.net/svnroot/pycam
RELEASE_PREFIX = pycam-
EXPORT_DIR = $(RELEASE_PREFIX)$(VERSION)
EXPORT_FILE_PREFIX = $(EXPORT_DIR)
7 8
EXPORT_ZIP = "$(EXPORT_FILE_PREFIX).zip"
EXPORT_TGZ = "$(EXPORT_FILE_PREFIX).tar.gz"
lode_leroy's avatar
lode_leroy committed
9 10


11
.PHONY: zip tgz svn_export tag
lode_leroy's avatar
lode_leroy committed
12

13 14 15
dist: zip tgz
	@# remove the tmp directory when everything is done
	@rm -rf "$(EXPORT_DIR)"
lode_leroy's avatar
lode_leroy committed
16

17 18 19 20 21 22 23
clean:
	@rm -rf "$(EXPORT_DIR)"

svn_export: clean
	svn export --quiet "$(SVN_BASE)/trunk" "$(EXPORT_DIR)"

zip: svn_export
24
	zip -9rq "$(EXPORT_ZIP)" "$(EXPORT_DIR)"
25 26

tgz: svn_export
27
	tar czf "$(EXPORT_TGZ)" "$(EXPORT_DIR)"
28 29

tag:
30 31 32
	svn cp "$(SVN_BASE)/trunk" "$(SVN_BASE)/tags/release-$(VERSION)" -m "tag release $(VERSION)"
	svn import "$(EXPORT_ZIP)" "$(SVN_BASE)/tags/archives/" -m "added released zip file for version $(VERSION)"
	svn import "$(EXPORT_TGZ)" "$(SVN_BASE)/tags/archives/" -m "added released tgz file for version $(VERSION)"
lode_leroy's avatar
lode_leroy committed
33