2014-02-05 20:37:47 +01:00
|
|
|
PKG_NAME=oonf_api
|
2016-01-06 16:21:36 +01:00
|
|
|
PKG_URL=http://olsr.org/git/oonf.git
|
2014-02-05 20:37:47 +01:00
|
|
|
PKG_VERSION=v0.3.0
|
|
|
|
|
|
|
|
ifneq ($(RIOTBOARD),)
|
|
|
|
include $(RIOTBOARD)/$(BOARD)/Makefile.include
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(RIOTBASE),)
|
|
|
|
INCLUDES += -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/sys/net/include \
|
2015-08-11 20:02:10 +02:00
|
|
|
-I$(RIOTBASE)/sys/posix/include
|
2014-02-05 20:37:47 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
MODULE:=$(shell basename $(CURDIR))
|
|
|
|
|
|
|
|
.PHONY: all clean patch reset
|
|
|
|
|
|
|
|
all: patch
|
|
|
|
make -C $(CURDIR)/$(PKG_NAME)
|
|
|
|
make $(BINDIR)$(MODULE).a
|
|
|
|
|
|
|
|
patch: $(CURDIR)/$(PKG_NAME)/Makefile
|
|
|
|
|
|
|
|
$(CURDIR)/$(PKG_NAME)/Makefile: $(CURDIR)/$(PKG_NAME)
|
2014-03-18 18:16:10 +01:00
|
|
|
$(foreach patch,$(shell ls [0-9][0-9][0-9][0-9]*.patch),cd "$<" && git am "../$(patch)" || { git am --abort; exit 1; };)
|
2014-02-05 20:37:47 +01:00
|
|
|
|
2014-03-18 14:50:35 +01:00
|
|
|
$(CURDIR)/$(PKG_NAME):
|
2014-05-12 16:53:30 +02:00
|
|
|
test -d oonf_api || \
|
2014-02-05 20:37:47 +01:00
|
|
|
git clone $(PKG_URL) $@ && \
|
2014-03-17 16:18:29 +01:00
|
|
|
cd $@ && git reset --hard $(PKG_VERSION)
|
2014-02-05 20:37:47 +01:00
|
|
|
|
|
|
|
clean::
|
|
|
|
# Reset package to checkout state.
|
|
|
|
cd $(CURDIR)/$(PKG_NAME) || true && \
|
|
|
|
git clean -x -f && \
|
|
|
|
git reset --hard $(PKG_VERSION)
|
|
|
|
|
|
|
|
distclean::
|
|
|
|
rm -rf $(CURDIR)/$(PKG_NAME)
|
|
|
|
|
|
|
|
$(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
|