Skip to content

Commit

Permalink
pkg: add unified package git checkout makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 committed Mar 23, 2016
1 parent cef984b commit 5673c51
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions pkg/pkg.mk
@@ -0,0 +1,22 @@
#
# Include this file if your Package needs to be checked out by git
#
PKG_DIR?=$(CURDIR)
PKG_BUILDDIR?=$(BINDIR)/pkg/$(PKG_NAME)

download: $(PKG_BUILDDIR)/.downloaded

$(PKG_BUILDDIR)/.downloaded:
mkdir -p $(PKG_BUILDDIR)
$(GITCACHE) clone "$(PKG_URL)" "$(PKG_VERSION)" "$(PKG_BUILDDIR)"
if test -d "$(PKG_DIR)"/patches; then \
git -C "$(PKG_BUILDDIR)" am --ignore-whitespace "$(PKG_DIR)"/patches/*.patch; \
fi
touch $(PKG_BUILDDIR)/.downloaded

clean::
@echo "Cleaning package $(PKG_NAME)..."
rm -rf "$(PKG_BUILDDIR)"

distclean::
rm -rf "$(PKG_BUILDDIR)"

0 comments on commit 5673c51

Please sign in to comment.