1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/pkg/Makefile.http
2013-11-25 17:17:00 +01:00

43 lines
1.4 KiB
HTTP

PKG_NAME= # name of the package
PKG_URL= # source url of the package e.g. a git repository
PKG_VERSION= # version of the package to use e.g. a git commit/ref
PKG_EXT= # extenison of this package
FETCH=$(shell which wget &> /dev/null && echo "wget" || echo "curl")
UNPACK=tar -xvf
ifneq ($(RIOTBOARD),)
include $(RIOTBOARD)/Makefile.base
include $(RIOTBOARD)/$(BOARD)/Makefile.include
endif
.PHONY: all clean patch reset
all: patch
make -C $(CURDIR)/$(PKG_NAME)-$(PKG_VERSION)
patch: $(CURDIR)/$(PKG_NAME)-$(PKG_VERSION)/Makefile
# Dependancy might be changed accordingly though we think the Makefile
# will be the first thing you want to change
#
# Here might not happen anything besides dependancy checks
$(CURDIR)/$(PKG_NAME)-$(PKG_VERSION)/Makefile: $(CURDIR)/$(PKG_NAME)-$(PKG_VERSION)/
# Here you apply your patch.
cd $< && patch ../patch.txt
$(CURDIR)/$(PKG_NAME)-$(PKG_VERSION)/: $(CURDIR)/$(PKG_NAME)-$(PKG_VERSION).$(PKG_EXT)
$(UNPACK) $<
$(CURDIR)/$(PKG_NAME)-$(PKG_VERSION).$(PKG_EXT):
# Get PKG_VERSION of package from PKG_URL
@$(FETCH) -O $@ $(PKG_URL)/$(PKG_NAME)-$(PKG_VERSION).$(PKG_EXT) || true
clean::
# Reset package to checkout state.
rm -rf $(CURDIR)/$(PKG_NAME)-$(PKG_VERSION) && \
make $(CURDIR)/$(PKG_NAME)-$(PKG_VERSION)/Makefile
clean::
rm -rf $(CURDIR)/$(PKG_NAME)-$(PKG_VERSION) $(CURDIR)/$(PKG_NAME)-$(PKG_VERSION).$(PKG_EXT)