summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2015-09-07 12:11:18 (GMT)
committerTony Theodore <tonyt@logyst.com>2015-09-12 03:43:04 (GMT)
commit5c62f031758b999b0d1859a3fd304d2007f1773f (patch)
treee1e7a5444e1d6c8a1c9d1491f64e3ed52e5f2fb3 /Makefile
parentbc4e31594a96df62acf256734e67d044bf4d6425 (diff)
downloadmxe-5c62f031758b999b0d1859a3fd304d2007f1773f.zip
mxe-5c62f031758b999b0d1859a3fd304d2007f1773f.tar.gz
mxe-5c62f031758b999b0d1859a3fd304d2007f1773f.tar.bz2
Makefile: allow script-only packages
* Create PREPARE_PKG_SOURCE function to simplify conditional unpacking and patching (possibly future git init) * Only attempt download if there is a pkg url * Only prepare source if there is a pkg file - useful for target specific overrides (say gcc on $(BUILD))
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 10 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 8621cda..3bc6aa4 100644
--- a/Makefile
+++ b/Makefile
@@ -145,6 +145,13 @@ UNPACK_ARCHIVE = \
UNPACK_PKG_ARCHIVE = \
$(call UNPACK_ARCHIVE,$(PKG_DIR)/$($(1)_FILE))
+define PREPARE_PKG_SOURCE
+ cd '$(2)' && $(call UNPACK_PKG_ARCHIVE,$(1))
+ cd '$(2)/$($(1)_SUBDIR)'
+ $(foreach PKG_PATCH,$(sort $(wildcard $(TOP_DIR)/src/$(1)-*.patch)),
+ (cd '$(2)/$($(1)_SUBDIR)' && $(PATCH) -p1 -u) < $(PKG_PATCH))
+endef
+
PKG_CHECKSUM = \
openssl sha1 '$(PKG_DIR)/$($(1)_FILE)' 2>/dev/null | $(SED) -n 's,^.*\([0-9a-f]\{40\}\)$$,\1,p'
@@ -356,7 +363,7 @@ $(PREFIX)/$(3)/installed/$(1): $(TOP_DIR)/src/$(1).mk \
$(wildcard $(TOP_DIR)/src/$(1)-test*) \
$(addprefix $(PREFIX)/$(3)/installed/,$(value $(call LOOKUP_PKG_RULE,$(1),DEPS,$(3)))) \
| $(if $(DONT_CHECK_REQUIREMENTS),,check-requirements) \
- download-only-$(1)
+ $(if $(value $(call LOOKUP_PKG_RULE,$(1),URL,$(3))),download-only-$(1))
@[ -d '$(LOG_DIR)/$(TIMESTAMP)' ] || mkdir -p '$(LOG_DIR)/$(TIMESTAMP)'
$(if $(value $(call LOOKUP_PKG_RULE,$(1),BUILD,$(3))),
@$(PRINTF_FMT) '[build]' '$(1)' '$(3)',
@@ -398,10 +405,8 @@ build-only-$(1)_$(3):
automake --version 2>/dev/null | head -1
rm -rf '$(2)'
mkdir -p '$(2)'
- cd '$(2)' && $(call UNPACK_PKG_ARCHIVE,$(1))
- cd '$(2)/$($(1)_SUBDIR)'
- $(foreach PKG_PATCH,$(sort $(wildcard $(TOP_DIR)/src/$(1)-*.patch)),
- (cd '$(2)/$($(1)_SUBDIR)' && $(PATCH) -p1 -u) < $(PKG_PATCH))
+ $$(if $(value $(call LOOKUP_PKG_RULE,$(1),FILE,$(3))),\
+ $$(call PREPARE_PKG_SOURCE,$(1),$(2)))
$$(call $(call LOOKUP_PKG_RULE,$(1),BUILD,$(3)),$(2)/$($(1)_SUBDIR),$(TOP_DIR)/src/$(1)-test)
@echo
@find '$(2)' -name 'config.log' -print -exec cat {} \;