1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/pkg/oonf_api/Makefile
2016-01-06 16:21:36 +01:00

43 lines
1.1 KiB
Makefile

PKG_NAME=oonf_api
PKG_URL=http://olsr.org/git/oonf.git
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 \
-I$(RIOTBASE)/sys/posix/include
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)
$(foreach patch,$(shell ls [0-9][0-9][0-9][0-9]*.patch),cd "$<" && git am "../$(patch)" || { git am --abort; exit 1; };)
$(CURDIR)/$(PKG_NAME):
test -d oonf_api || \
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)
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