2016-03-22 18:26:16 +01:00
|
|
|
#
|
|
|
|
# Include this file if your Package needs to be checked out by git
|
|
|
|
#
|
|
|
|
PKG_DIR?=$(CURDIR)
|
2016-03-24 23:32:34 +01:00
|
|
|
PKG_BUILDDIR?=$(BINDIRBASE)/pkg/$(BOARD)/$(PKG_NAME)
|
2016-03-22 18:26:16 +01:00
|
|
|
|
2016-04-26 13:53:51 +02:00
|
|
|
.PHONY: git-download clean
|
2016-03-22 18:26:16 +01:00
|
|
|
|
2016-04-26 13:53:51 +02:00
|
|
|
ifneq (,$(wildcard $(PKG_DIR)/patches))
|
|
|
|
git-download: $(PKG_BUILDDIR)/.git-patched
|
|
|
|
else
|
2016-03-23 16:38:19 +01:00
|
|
|
git-download: $(PKG_BUILDDIR)/.git-downloaded
|
2016-04-26 13:53:51 +02:00
|
|
|
endif
|
2016-03-23 16:38:19 +01:00
|
|
|
|
2016-04-26 13:53:51 +02:00
|
|
|
ifneq (,$(wildcard $(PKG_DIR)/patches))
|
|
|
|
$(PKG_BUILDDIR)/.git-patched: $(PKG_BUILDDIR)/.git-downloaded $(PKG_DIR)/Makefile $(PKG_DIR)/patches/*.patch
|
|
|
|
git -C $(PKG_BUILDDIR) checkout -f $(PKG_VERSION)
|
|
|
|
git -C $(PKG_BUILDDIR) am --ignore-whitespace "$(PKG_DIR)"/patches/*.patch
|
|
|
|
touch $@
|
|
|
|
endif
|
2016-03-24 23:32:34 +01:00
|
|
|
|
2016-03-23 16:38:19 +01:00
|
|
|
$(PKG_BUILDDIR)/.git-downloaded:
|
2016-03-31 23:09:23 +02:00
|
|
|
rm -Rf $(PKG_BUILDDIR)
|
2016-03-22 18:26:16 +01:00
|
|
|
mkdir -p $(PKG_BUILDDIR)
|
|
|
|
$(GITCACHE) clone "$(PKG_URL)" "$(PKG_VERSION)" "$(PKG_BUILDDIR)"
|
2016-03-24 23:32:34 +01:00
|
|
|
$(GIT_APPLY_PATCHES)
|
2016-03-23 16:38:19 +01:00
|
|
|
touch $@
|
2016-03-22 18:26:16 +01:00
|
|
|
|
|
|
|
clean::
|
2016-03-24 23:32:34 +01:00
|
|
|
@test -d $(PKG_BUILDDIR) && { \
|
2016-04-26 13:53:51 +02:00
|
|
|
rm $(PKG_BUILDDIR)/.git-patched ; \
|
2016-03-24 23:32:34 +01:00
|
|
|
git -C $(PKG_BUILDDIR) clean -f ; \
|
|
|
|
git -C $(PKG_BUILDDIR) checkout "$(PKG_VERSION)"; \
|
2016-04-26 13:53:51 +02:00
|
|
|
make $(PKG_BUILDDIR)/.git-patched ; \
|
2016-03-24 23:32:34 +01:00
|
|
|
touch $(PKG_BUILDDIR)/.git-downloaded ; \
|
|
|
|
} > /dev/null 2>&1 || true
|
2016-03-22 18:26:16 +01:00
|
|
|
|
|
|
|
distclean::
|
|
|
|
rm -rf "$(PKG_BUILDDIR)"
|