diff --git a/pkg/ccn-lite/Makefile.include b/pkg/ccn-lite/Makefile.include index fdf03313e7bc6f3f4e077e0f2324e2fed206d139..391f1329eb1ff58e5d89474e8b65f6b795582c9f 100644 --- a/pkg/ccn-lite/Makefile.include +++ b/pkg/ccn-lite/Makefile.include @@ -1,2 +1,2 @@ -INCLUDES += -I$(RIOTPKG)/ccn-lite -I$(BINDIR)/pkg/ccn-lite/src +INCLUDES += -I$(RIOTPKG)/ccn-lite -I$(BINDIRBASE)/pkg/$(BOARD)/ccn-lite/src INCLUDES += -I$(RIOTBASE)/sys/posix/include diff --git a/pkg/cmsis-dsp/Makefile.include b/pkg/cmsis-dsp/Makefile.include index 3fdfa74e9a42e86be508ee1278159d67fb9dd9d9..168751983e86ed99a8f6bf9409dc61f99467f774 100644 --- a/pkg/cmsis-dsp/Makefile.include +++ b/pkg/cmsis-dsp/Makefile.include @@ -1 +1 @@ -INCLUDES += -I$(BINDIR)/pkg/cmsis-dsp/include +INCLUDES += -I$(BINDIRBASE)/pkg/$(BOARD)/cmsis-dsp/include diff --git a/pkg/libcoap/Makefile.include b/pkg/libcoap/Makefile.include index 7b3d3b97569804fb65fe17f5a919b2eb920cc5e3..464f0f3a09151a2bf99c19e51c8234a2ea227762 100644 --- a/pkg/libcoap/Makefile.include +++ b/pkg/libcoap/Makefile.include @@ -1,3 +1,3 @@ -INCLUDES += -I$(BINDIR)/pkg/libcoap \ +INCLUDES += -I$(BINDIRBASE)/pkg/$(BOARD)/libcoap \ -I$(RIOTBASE)/sys/posix/include \ -I$(RIOTBASE)/sys/net/include diff --git a/pkg/micro-ecc/Makefile.include b/pkg/micro-ecc/Makefile.include index 8f4031d44909cc6eb3c16d19d3de5b3d34249323..88480400b17823fab1e0934951133ad8daf825d2 100644 --- a/pkg/micro-ecc/Makefile.include +++ b/pkg/micro-ecc/Makefile.include @@ -1 +1 @@ -INCLUDES += -I$(BINDIR)/pkg/micro-ecc +INCLUDES += -I$(BINDIRBASE)/pkg/$(BOARD)/micro-ecc diff --git a/pkg/microcoap/Makefile.include b/pkg/microcoap/Makefile.include index af7e8531bfba014f1789ac0fb449d8b91c3d4073..84444392db31267583327fe0135b28c87227de89 100644 --- a/pkg/microcoap/Makefile.include +++ b/pkg/microcoap/Makefile.include @@ -1 +1 @@ -INCLUDES += -I$(BINDIR)/pkg/microcoap +INCLUDES += -I$(BINDIRBASE)/pkg/$(BOARD)/microcoap diff --git a/pkg/oonf_api/Makefile.include b/pkg/oonf_api/Makefile.include index 3f21746b137ab5668328d17210ff7467bf020054..03a1d2e990cf1e5b2dc2a993f0b5058a87c90d32 100644 --- a/pkg/oonf_api/Makefile.include +++ b/pkg/oonf_api/Makefile.include @@ -1 +1 @@ -INCLUDES += -I$(BINDIR)/pkg/oonf_api/src-api +INCLUDES += -I$(BINDIRBASE)/pkg/$(BOARD)/oonf_api/src-api diff --git a/pkg/pkg.mk b/pkg/pkg.mk index 51fa3f37107c8e0a778538ece2993306e0c067e2..52b4c32874f65d36ffba5f164f6b340288899cb7 100644 --- a/pkg/pkg.mk +++ b/pkg/pkg.mk @@ -2,23 +2,29 @@ # Include this file if your Package needs to be checked out by git # PKG_DIR?=$(CURDIR) -PKG_BUILDDIR?=$(BINDIR)/pkg/$(PKG_NAME) +PKG_BUILDDIR?=$(BINDIRBASE)/pkg/$(BOARD)/$(PKG_NAME) .PHONY: git-download git-download: $(PKG_BUILDDIR)/.git-downloaded +GIT_APPLY_PATCHES:=if test -d "$(PKG_DIR)"/patches; then \ + git -C "$(PKG_BUILDDIR)" am --ignore-whitespace "$(PKG_DIR)"/patches/*.patch; \ + fi + $(PKG_BUILDDIR)/.git-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 + $(GIT_APPLY_PATCHES) touch $@ clean:: - @echo "Cleaning package $(PKG_NAME)..." - rm -rf "$(PKG_BUILDDIR)" + @test -d $(PKG_BUILDDIR) && { \ + git -C $(PKG_BUILDDIR) clean -f ; \ + git -C $(PKG_BUILDDIR) checkout "$(PKG_VERSION)"; \ + $(GIT_APPLY_PATCHES) ; \ + touch $(PKG_BUILDDIR)/.git-downloaded ; \ + } > /dev/null 2>&1 || true distclean:: rm -rf "$(PKG_BUILDDIR)" diff --git a/pkg/relic/Makefile.include b/pkg/relic/Makefile.include index 9cd7350a59512034baab7d7aed0396d3079f90ce..b6777ad4434a2242ad717a995e84338796ee7813 100644 --- a/pkg/relic/Makefile.include +++ b/pkg/relic/Makefile.include @@ -1 +1 @@ -INCLUDES += -I$(BINDIR)/pkg/relic/include +INCLUDES += -I$(BINDIRBASE)/pkg/$(BOARD)/relic/include