# HG changeset patch # User Oleksandr Gavenko # Date 1464780407 -10800 # Node ID 7409438608794d6229d27338114e588f98de25a2 # Parent 68220a9e1586f3b4a3640f8f5716f068496948c4 Add new target for binary distribution and update target for source distribution. diff -r 68220a9e1586 -r 740943860879 Makefile --- a/Makefile Wed Jun 01 13:40:42 2016 +0300 +++ b/Makefile Wed Jun 01 14:26:47 2016 +0300 @@ -159,16 +159,16 @@ LOGO_DIM := 32x32 48x48 64x64 LOGO_PNG_FILES := $(patsubst %,$(LOGO_NAME)-%.png,$(LOGO_DIM)) -DIST_DIR = $(fullpkgname) -DISTSRC_DIR = $(fullpkgname)_src +DISTREL_DIR = dist/$(fullpkgname) +DISTSRC_DIR = dist/$(fullpkgname)_src DIST_FILES = $(DICTDZ_FILES) $(INDEX_FILES) $(RST_HTML_FILES) $(RST_FILES) DISTSRC_HELPER_FILES = Makefile rst.css .dir-locals.el DISTSRC_FILES = $(C5_FILES) $(RST_FILES) $(DISTSRC_HELPER_FILES) -DIST_TARBALLS = $(DIST_DIR).tar.gz $(DIST_DIR).tar.bz2 -DISTSRC_TARBALLS = $(DISTSRC_DIR).tar.gz $(DISTSRC_DIR).tar.bz2 +DISTREL_TARBALLS = dist/$(fullpkgname).tar.gz dist/$(fullpkgname).zip +DISTSRC_TARBALLS = dist/$(fullpkgname)_src.tar.gz # dist/$(fullpkgname)_src.zip ################################################################ # Deploy/release targets. @@ -247,7 +247,7 @@ ) | sftp -b - $(SF_USER),$(pkgname)@web.sourceforge.net .PHONY: release2sf -deploy2sf-release: validate-release $(DIST_TARBALLS) $(DISTSRC_TARBALLS) +deploy2sf-release: validate-release $(DISTREL_TARBALLS) $(DISTSRC_TARBALLS) exit 1 : TODO broken due to new project hierarchy ( echo 'cd /home/frs/project/$(shell v=$(pkgname); echo $${v:0:1}/$${v:0:2})/$(pkgname)'; \ @@ -255,7 +255,7 @@ echo "chmod 644 README.rst"; \ echo "mkdir v$(vmajor).$(vminor)"; \ echo "cd v$(vmajor).$(vminor)"; \ -for f in $(DIST_TARBALLS) $(DISTSRC_TARBALLS); do \ +for f in $(DISTREL_TARBALLS) $(DISTSRC_TARBALLS); do \ echo "put $$f"; \ echo "chmod 644 $$f"; \ done; \ @@ -279,29 +279,62 @@ # Dist targets. .PHONY: dist -dist: dist-dictd dist-src +dist: dist-rel dist-src + +.PHONY: dist-rel +dist-rel: $(DISTREL_TARBALLS) + +DISTREL_DICTDZ_FILES := $(patsubst %,dist/$(fullpkgname)/dictd/%,$(notdir $(DICTDZ_FILES))) +DISTREL_INDEX_FILES := $(patsubst %,dist/$(fullpkgname)/dictd/%,$(notdir $(INDEX_FILES))) +DISTREL_RST_FILES := $(patsubst %,dist/$(fullpkgname)/doc/txt/%,$(notdir $(RST_FILES))) +DISTREL_HTML_FILES := $(patsubst %,dist/$(fullpkgname)/doc/html/%,$(notdir $(RST_HTML_FILES))) + +dist/$(fullpkgname).tar.gz: $(DISTREL_DICTDZ_FILES) $(DISTREL_INDEX_FILES) $(DISTREL_RST_FILES) $(DISTREL_HTML_FILES) $(BUILD_SCRIPTS) + rm -rf $@ + tar zcf $@ -C dist/ $(fullpkgname) -.PHONY: dist-dictd -dist-dictd: $(DIST_TARBALLS) +dist/$(fullpkgname).zip: $(DISTREL_DICTDZ_FILES) $(DISTREL_INDEX_FILES) $(DISTREL_RST_FILES) $(DISTREL_HTML_FILES) $(BUILD_SCRIPTS) + rm -rf $@ + cd $(dir $@) && zip -r $(notdir $@) $(fullpkgname) + +$(DISTREL_DICTDZ_FILES) $(DISTREL_INDEX_FILES): dist/$(fullpkgname)/dictd/%: dist/dictd/% | dist/$(fullpkgname)/dictd/ + cp $< $@ + +$(DISTREL_RST_FILES): dist/$(fullpkgname)/doc/txt/%: www/% | dist/$(fullpkgname)/doc/txt/ + cp $< $@ + +$(DISTREL_HTML_FILES): dist/$(fullpkgname)/doc/html/%: dist/www/% | dist/$(fullpkgname)/doc/html/ + cp $< $@ + +$(patsubst %,dist/$(fullpkgname)/%, dictd/ doc/txt/ doc/html/): + mkdir -p $@ .PHONY: dist-src dist-src: $(DISTSRC_TARBALLS) -%.tar.gz: % - tar zcf $*.tar.gz $* +DISTSRC_GADICT_FILES := $(patsubst %,dist/$(fullpkgname)_src/%,$(GADICT_FILES)) +DISTSRC_PY_FILES := $(patsubst %,dist/$(fullpkgname)_src/py/%,$(notdir $(PY_FILES))) +DISTSRC_RST_FILES := $(patsubst %,dist/$(fullpkgname)_src/www/%,$(notdir $(RST_FILES))) +DISTSRC_MAKEFILE := dist/$(fullpkgname)_src/Makefile -%.tar.bz2: % - tar jcf $*.tar.bz2 $* - -$(DIST_DIR): $(DIST_FILES) +dist/$(fullpkgname)_src.tar.gz: $(DISTSRC_GADICT_FILES) $(DISTSRC_PY_FILES) $(DISTSRC_RST_FILES) $(DISTSRC_MAKEFILE) $(BUILD_SCRIPTS) rm -rf $@ - mkdir $@ - cp $(DIST_FILES) $@ + tar zcf $@ -C dist/ $(fullpkgname)_src + +$(DISTSRC_GADICT_FILES): dist/$(fullpkgname)_src/%: % | dist/$(fullpkgname)_src/ + cp $< $@ + +$(DISTSRC_PY_FILES): dist/$(fullpkgname)_src/py/%: py/% | dist/$(fullpkgname)_src/py/ + cp $< $@ -$(DISTSRC_DIR): $(DISTSRC_FILES) - rm -rf $@ - mkdir $@ - cp $(DISTSRC_FILES) $@ +$(DISTSRC_RST_FILES): dist/$(fullpkgname)_src/www/%: www/% | dist/$(fullpkgname)_src/www/ + cp $< $@ + +$(DISTSRC_MAKEFILE): Makefile | dist/$(fullpkgname)_src/ + cp $< $@ + +dist/$(fullpkgname)_src/ $(patsubst %,dist/$(fullpkgname)_src/%, py/ www/): + mkdir -p $@ ################################################################ # Build targets.