summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-04-25 21:59:06 (GMT)
committer Vincent Sanders <vince@kyllikki.org>2014-04-25 21:59:06 (GMT)
commit2469c7cf0c171606390203ba92f77ad6a3266ab7 (patch)
tree4992fbdd6990506836517d967d9e245a63a2db60
parent62790b2c17e9ddb76804093231d2d33802496127 (diff)
downloadnetsurf-all-2469c7cf0c171606390203ba92f77ad6a3266ab7.tar.gz
netsurf-all-2469c7cf0c171606390203ba92f77ad6a3266ab7.tar.bz2
add dist target
-rw-r--r--Makefile18
1 files changed, 16 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 60201f0..ecb46b9 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,12 @@
#
# NetSurf Source makefile for libraries and browser
+# Component settings
+COMPONENT := netsurf-all
+COMPONENT_VERSION := 3.1
+
+.PHONY: build install clean release-checkout dist
+
export TARGET ?= gtk
export PKG_CONFIG_PATH = $(TMP_PREFIX)/lib/pkgconfig
TMP_PREFIX := $(CURDIR)/inst-$(TARGET)
@@ -13,14 +19,14 @@ NSLIBTARG := buildsystem libwapcaplet libparserutils libcss libhubbub libdom li
# clean macro for each sub target
define do_clean
$(MAKE) distclean --directory=$1 TARGET=$(TARGET)
+
endef
# prefixed install macro for each sub target
define do_prefix_install
$(MAKE) install --directory=$1 TARGET=$(TARGET) PREFIX=$(TMP_PREFIX) DESTDIR=
-endef
-.PHONY: build install clean release-checkout
+endef
build: $(TMP_PREFIX)/build-stamp
@@ -41,3 +47,11 @@ clean:
release-checkout: $(NSLIBTARG) $(NETSURF_TARG)
for x in $^; do cd $$x; (git checkout origin/HEAD && git checkout $$(git describe --abbrev=0 --match="release/*" )); cd ..; done
+
+dist:
+ $(eval GIT_TAG := $(shell git describe --abbrev=0 --match "release/*"))
+ $(eval GIT_VER := $(shell x="$(GIT_TAG)"; echo "$${x#release/}"))
+ $(if $(subst $(GIT_VER),,$(COMPONENT_VERSION)), $(error Component Version "$(COMPONENT_VERSION)" and GIT tag version "$(GIT_VER)" do not match))
+ $(eval DIST_FILE := $(COMPONENT)-${GIT_VER})
+ $(Q)git-archive-all --force-submodules --prefix=$(DIST_FILE)/ $(DIST_FILE).tgz
+ $(Q)mv $(DIST_FILE).tgz $(DIST_FILE).tar.gz