From 069bbceccd2cca23fade71af19c1bc1fb60494c2 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 10 Mar 2016 15:21:52 +0100 Subject: [PATCH] pkg: micro-ecc: build in BINDIR --- pkg/micro-ecc/Makefile | 24 ++++++++++++------------ pkg/micro-ecc/Makefile.include | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pkg/micro-ecc/Makefile b/pkg/micro-ecc/Makefile index 4dfe2d2e2e..cc4634f712 100644 --- a/pkg/micro-ecc/Makefile +++ b/pkg/micro-ecc/Makefile @@ -1,6 +1,8 @@ PKG_NAME=micro-ecc PKG_URL=https://github.com/kmackay/micro-ecc.git PKG_VERSION=f3d46f0fb77b42535168a17b4b51802beb124a32 +PKG_DIR=$(CURDIR) +PKG_BUILDDIR=$(BINDIR)/pkg/$(PKG_NAME) ifneq ($(RIOTBOARD),) include $(RIOTBOARD)/$(BOARD)/Makefile.include @@ -16,28 +18,26 @@ MODULE:=$(shell basename $(CURDIR)) .PHONY: all clean patch reset all: patch - make -C $(CURDIR)/$(PKG_NAME) + make -C $(PKG_BUILDDIR) make $(BINDIR)$(MODULE).a -patch: $(CURDIR)/$(PKG_NAME)/Makefile +patch: $(PKG_BUILDDIR)/Makefile -$(CURDIR)/$(PKG_NAME)/Makefile: $(CURDIR)/$(PKG_NAME) - $(foreach patch,$(shell ls [0-9][0-9][0-9][0-9]*.patch),cd "$<" && git am "../$(patch)" || { git am --abort; exit 1; };) - touch $(CURDIR)/$(PKG_NAME)/Makefile +$(PKG_BUILDDIR)/Makefile: $(PKG_BUILDDIR) + cd $(PKG_BUILDDIR) && \ + for patch in $(PKG_DIR)/[0-9][0-9][0-9][0-9]*.patch; do git am "$${patch}" || { git am --abort; exit 1; }; done + touch $(PKG_BUILDDIR)/Makefile -$(CURDIR)/$(PKG_NAME): - test -d $(PKG_NAME) || \ +$(PKG_BUILDDIR): + mkdir -p $(BINDIR)/pkg && \ git clone $(PKG_URL) $@ && \ cd $@ && git reset --hard $(PKG_VERSION) clean:: - # Reset package to checkout state. - cd $(CURDIR)/$(PKG_NAME) || true && \ - git clean -x -f && \ - git reset --hard $(PKG_VERSION) + rm -Rf $(PKG_BUILDDIR) distclean:: - rm -rf $(CURDIR)/$(PKG_NAME) + rm -rf $(PKG_BUILDDIR) #$(BINDIR)$(MODULE).a: $(BINDIR)micro-ecc_*.a # mkdir -p $(BINDIR)$(MODULE); cd $(BINDIR)$(MODULE); for var in $?; do ar -x $$var; done; ar -r -c -s $(BINDIR)$(MODULE).a *.o diff --git a/pkg/micro-ecc/Makefile.include b/pkg/micro-ecc/Makefile.include index 2bdc475905..8f4031d449 100644 --- a/pkg/micro-ecc/Makefile.include +++ b/pkg/micro-ecc/Makefile.include @@ -1 +1 @@ -INCLUDES += -I$(RIOTPKG)/micro-ecc/micro-ecc +INCLUDES += -I$(BINDIR)/pkg/micro-ecc