Skip to content

Commit

Permalink
Merge pull request #8507 from kaspar030/allow_git_pkg_source_override
Browse files Browse the repository at this point in the history
pkg: add local.mk, allow source folder override for git packages
  • Loading branch information
kaspar030 committed Feb 13, 2018
2 parents 1b2ce2d + 9227c6f commit 88e79fb
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
24 changes: 24 additions & 0 deletions pkg/local.mk
@@ -0,0 +1,24 @@
#
# This file allows specifying a local folder using PKG_SOURCE_LOCAL.
#
# Every clean or prepare will remove $(PKG_BUILDDIR) and copy over
# $(PKG_SOURCE_LOCAL). This is intended to be used during package development.
#
# WARNING: any local changes made to $(PKG_BUILDDIR) *will* get lost!

.PHONY: prepare git-download clean

git-download:
@true

prepare: $(PKG_BUILDDIR)/.prepared
@true

$(PKG_BUILDDIR)/.prepared:
rm -Rf $(PKG_BUILDDIR)
mkdir -p $$(dirname $(PKG_BUILDDIR))
cp -a $(PKG_SOURCE_LOCAL) $(PKG_BUILDDIR)
touch $@

clean::
@rm -f $(PKG_BUILDDIR)/.prepared
7 changes: 7 additions & 0 deletions pkg/pkg.mk
Expand Up @@ -4,6 +4,11 @@
PKG_DIR?=$(CURDIR)
PKG_BUILDDIR?=$(PKGDIRBASE)/$(PKG_NAME)

# allow overriding package source with local folder (useful during development)
ifneq (,$(PKG_SOURCE_LOCAL))
include $(RIOTBASE)/pkg/local.mk
else

.PHONY: prepare git-download clean

prepare: git-download
Expand Down Expand Up @@ -39,3 +44,5 @@ clean::

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

endif

0 comments on commit 88e79fb

Please sign in to comment.