From c5abe7d73eca609b9f6e09b8eeb63f9bee4b1555 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Fri, 14 Sep 2012 12:26:38 +0400 Subject: Check and install build dependencies --- rules/archive.mk | 4 ++-- rules/common.mk | 2 +- rules/ips.mk | 16 ++++++++++++++++ rules/patch.mk | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) (limited to 'rules') diff --git a/rules/archive.mk b/rules/archive.mk index 24b9205..1b9108f 100644 --- a/rules/archive.mk +++ b/rules/archive.mk @@ -53,12 +53,12 @@ download:: download-stamp archive-unpacker := /usr/share/cibs/scripts/unpack-archive -unpack-%-stamp: validate-%-stamp +unpack-%-stamp: validate-%-stamp check-build-dep-stamp $(archive-unpacker) $* $(sourcedir_$*) $(sourcedir) touch $@ unpack-stamp: $$(addprefix unpack-,$$(addsuffix -stamp,$$(archives) $$(archive))) -pre-configure-stamp: unpack-stamp +pre-configure-stamp: unpack-stamp check-build-dep-stamp checksum: @echo '# Insert this into Makefile:' diff --git a/rules/common.mk b/rules/common.mk index 9ddadae..9d283f9 100644 --- a/rules/common.mk +++ b/rules/common.mk @@ -81,7 +81,7 @@ destdir = $(destdir.$(bits)) # Common targets for internal usage. # Some modules (e. g. 32.mk, autotools.mk) add dependencies # to this, for example configure with autotools -unpack-stamp patch-stamp pre-configure-stamp configure-stamp build-stamp install-stamp: +check-build-dep-stamp unpack-stamp patch-stamp pre-configure-stamp configure-stamp build-stamp install-stamp: touch $@ # Common target to use from command line diff --git a/rules/ips.mk b/rules/ips.mk index fa3edb0..6bd46c2 100644 --- a/rules/ips.mk +++ b/rules/ips.mk @@ -121,6 +121,22 @@ publish-stamp: resolve-stamp publish: publish-stamp + +check-build-dep-stamp: check-ips-build-dep-stamp + +# issue 'make d=' to skip dependency checking: +check-ips-build-dep-stamp: d=true +check-ips-build-dep-stamp: + [ -z "$d" ] || pkg list $(build-depends) + touch $@ + + +# Install build dependencies: +build-dep: + $(root) pkg install $(build-depends) + +.PHONY: publish build-dep + __ips_mk := included endif diff --git a/rules/patch.mk b/rules/patch.mk index b76e3a3..bbbb7b8 100644 --- a/rules/patch.mk +++ b/rules/patch.mk @@ -28,7 +28,7 @@ patchdir = $(CURDIR)/patches patches := $(shell cd "$(patchdir)" && ls -1 | sort) # Try different path levels: -applied-%-stamp: $(patchdir)/% unpack-stamp +applied-%-stamp: $(patchdir)/% unpack-stamp check-build-dep-stamp cd "$(sourcedir)" && \ patch -p1 -t < $< || \ patch -p0 -t < $< || \ -- cgit v1.2.3