summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-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