From 2469c7cf0c171606390203ba92f77ad6a3266ab7 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 25 Apr 2014 22:59:06 +0100 Subject: add dist target --- Makefile | 18 ++++++++++++++++-- 1 file 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 -- cgit v1.2.3