1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #8507 from kaspar030/allow_git_pkg_source_override

pkg: add local.mk, allow source folder override for git packages
This commit is contained in:
Kaspar Schleiser 2018-02-13 14:47:46 +01:00 committed by GitHub
commit 88e79fb825
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions

24
pkg/local.mk Normal file
View File

@ -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

View File

@ -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
@ -39,3 +44,5 @@ clean::
distclean::
rm -rf "$(PKG_BUILDDIR)"
endif