From a6547ee9c63476c828fc4048182582ef55671fad Mon Sep 17 00:00:00 2001
From: Kaspar Schleiser <kaspar@schleiser.de>
Date: Tue, 22 Mar 2016 18:29:46 +0100
Subject: [PATCH] pkg: oonf_api: adapt to use pkg.mk

---
 pkg/oonf_api/Makefile         | 31 +++++--------------------------
 pkg/oonf_api/Makefile.include |  2 +-
 2 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/pkg/oonf_api/Makefile b/pkg/oonf_api/Makefile
index a6e278976b..288ae29b42 100644
--- a/pkg/oonf_api/Makefile
+++ b/pkg/oonf_api/Makefile
@@ -1,42 +1,21 @@
 PKG_NAME=oonf_api
 PKG_URL=https://github.com/OLSR/OONF.git
 PKG_VERSION=v0.3.0
-PKG_DIR=$(CURDIR)/$(PKG_NAME)
 
 ifneq ($(RIOTBASE),)
 INCLUDES += -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/sys/net/include \
 			-I$(RIOTBASE)/sys/posix/include
 endif
 
-MODULE:=$(shell basename $(CURDIR))
+MODULE:=$(PKG_NAME)
 
-.PHONY: all clean patch reset
+.PHONY: all
 
-all: patch
-	"$(MAKE)" -C $(PKG_DIR)
+all: download
+	"$(MAKE)" -C $(PKG_BUILDDIR)
 	"$(MAKE)" $(BINDIR)$(MODULE).a
 
-patch: $(PKG_DIR)/Makefile
-
-$(PKG_DIR)/Makefile: $(PKG_DIR)/.git/config
-	cd "$(PKG_DIR)" && git am --ignore-whitespace "$(CURDIR)"/*.patch
-
-$(PKG_DIR)/.git/config:
-	test -d "$(PKG_DIR)" || $(GITCACHE) clone "$(PKG_URL)" "$(PKG_VERSION)" "$(PKG_DIR)"
-
-clean::
-	@echo "Cleaning up oonf_api package..."
-	@cd "$(PKG_DIR)" 2> /dev/null > /dev/null && \
-		git clean -x -f && \
-		git am --abort && \
-		git reset --hard "$(PKG_VERSION)" && \
-		$(MAKE) patch || true
-
-distclean::
-	rm -rf $(PKG_DIR)
-
 $(BINDIR)$(MODULE).a: $(BINDIR)oonf_*.a
 	mkdir -p $(BINDIR)$(MODULE); cd $(BINDIR)$(MODULE); for var in $?; do ar -x $$var; done; ar -r -c -s $(BINDIR)$(MODULE).a *.o
 
-Makefile.include:
-	@true
+include $(RIOTBASE)/pkg/pkg.mk
diff --git a/pkg/oonf_api/Makefile.include b/pkg/oonf_api/Makefile.include
index 041a62ad77..3f21746b13 100644
--- a/pkg/oonf_api/Makefile.include
+++ b/pkg/oonf_api/Makefile.include
@@ -1 +1 @@
-INCLUDES += -I$(RIOTPKG)/oonf_api/oonf_api/src-api
+INCLUDES += -I$(BINDIR)/pkg/oonf_api/src-api
-- 
GitLab