1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:32:45 +01:00
RIOT/pkg/local.mk
Gaëtan Harter 9b6526c911 pkg/pkg.mk: use intermediate state files
Rely on file creation and dependencies instead of .PHONY targets.
Files will be rebuilt when changing version as the main `Makefile` will
have been updated. All steps are re-done on version change.

When deleting patches, the '.prepare' step should be redone thanks
to the included 'patch-dep.inc' file (TODO TEST ME).

Implementation in order:

* '.git': means the repository has been cloned.
* '.git-downloaded': Fetches the wanted version
* '.git-prepared': will clean checkout the version and apply patches
2020-01-08 20:55:19 +01:00

22 lines
544 B
Makefile

#
# 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 clean
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