Merge pull request #5138 from kaspar030/pkg_unify_git_checkout

pkg: unify git checkout
This commit is contained in:
Martine Lenders 2016-03-23 16:31:02 +01:00
commit f0eaed7fb8
72 changed files with 87 additions and 269 deletions

View File

@ -1,36 +1,10 @@
PKG_NAME= # name of the package
PKG_URL= # source url of the package e.g. a git repository
PKG_URL= # source url of the package's git repository
PKG_VERSION= # version of the package to use e.g. a git commit/ref
ifneq ($(RIOTBOARD),)
include $(RIOTBOARD)/Makefile.base
include $(RIOTBOARD)/$(BOARD)/Makefile.include
endif
.PHONY: all
.PHONY: all clean patch distclean
all: patch
all: download
$(MAKE) -C $(CURDIR)/$(PKG_NAME)
patch: $(CURDIR)/$(PKG_NAME)/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)/Makefile: $(CURDIR)/$(PKG_NAME)
# Here you apply your patch.
$(foreach patch,$(shell ls [0-9][0-9][0-9][0-9]*.patch),cd "$<" && git am "$(patch)" || { git am --abort; exit 1; };)
$(PKG_NAME):
# Get PKG_VERSION of package from PKG_URL
git clone $(PKG_URL) $(PKG_NAME) && cd $(PKG_NAME) && 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)
include $(RIOTBASE)/pkg/pkg.mk

View File

@ -1 +0,0 @@
/ccn-lite

View File

@ -1,31 +1,15 @@
PKG_NAME=ccn-lite
PKG_URL=https://github.com/OlegHahm/ccn-lite/
PKG_VERSION=39b1406c11de9de364220909488eebabe7e81613
PKG_DIR=$(CURDIR)/$(PKG_NAME)
.PHONY: all clean distclean
.PHONY: all
export RIOT_CFLAGS = ${CFLAGS} ${INCLUDES}
all: $(PKG_DIR)/Makefile
"$(MAKE)" -BC $(PKG_DIR)/src lib-ccn-lite.a
"$(MAKE)" -BC $(PKG_DIR)/src lib-ccn-lite-utils.a
cp $(PKG_DIR)/src/lib-ccn-lite.a ${BINDIR}/ccn-lite.a
cp $(PKG_DIR)/src/lib-ccn-lite-utils.a ${BINDIR}/ccn-lite-utils.a
all: download
"$(MAKE)" -BC $(PKG_BUILDDIR)/src lib-ccn-lite.a
"$(MAKE)" -BC $(PKG_BUILDDIR)/src lib-ccn-lite-utils.a
cp $(PKG_BUILDDIR)/src/lib-ccn-lite.a ${BINDIR}/ccn-lite.a
cp $(PKG_BUILDDIR)/src/lib-ccn-lite-utils.a ${BINDIR}/ccn-lite-utils.a
$(PKG_DIR)/Makefile: $(PKG_DIR)/.git/config
$(PKG_DIR)/.git/config:
test -d "$(PKG_DIR)" || $(GITCACHE) clone "$(PKG_URL)" "$(PKG_VERSION)" "$(PKG_DIR)"
clean::
@echo "Cleaning up CCN-Lite package..."
@cd "$(PKG_DIR)" 2> /dev/null > /dev/null && \
git clean -x -f && \
git reset --hard "$(PKG_VERSION)"
distclean::
rm -rf "$(PKG_DIR)"
Makefile.include:
@true
include $(RIOTBASE)/pkg/pkg.mk

View File

@ -1,2 +1,2 @@
INCLUDES += -I$(RIOTPKG)/ccn-lite -I$(RIOTPKG)/ccn-lite/ccn-lite/src
INCLUDES += -I$(RIOTPKG)/ccn-lite -I$(BINDIR)/pkg/ccn-lite/src
INCLUDES += -I$(RIOTBASE)/sys/posix/include

View File

@ -1 +0,0 @@
/cmsis-dsp

View File

@ -1,29 +1,14 @@
PKG_NAME=cmsis-dsp
PKG_URL=https://github.com/gebart/CMSIS-DSP.git
PKG_VERSION=v1.4.5a-riot1
PKG_DIR=$(CURDIR)/$(PKG_NAME)
ifneq ($(RIOTBASE),)
include $(RIOTBASE)/Makefile.base
endif
.PHONY: all clean patch distclean
.PHONY: all
all: $(PKG_DIR)/Makefile
$(MAKE) -C $(CURDIR)/$(PKG_NAME)
all: download
$(MAKE) -C $(PKG_BUILDDIR)
$(PKG_DIR)/Makefile: $(PKG_DIR)/.git/config
@
$(PKG_DIR)/.git/config:
test -d "$(PKG_DIR)" || $(GITCACHE) clone "$(PKG_URL)" "$(PKG_VERSION)" "$(PKG_DIR)"
clean::
@echo "Cleaning up $(PKG_NAME) package..."
@-cd "$(PKG_DIR)" 2> /dev/null > /dev/null && \
git clean -x -f && \
git am --abort && \
git reset --hard "$(PKG_VERSION)"
distclean::
rm -rf "$(PKG_DIR)"
include $(RIOTBASE)/pkg/pkg.mk

View File

@ -1 +1 @@
INCLUDES += -I$(RIOTPKG)/cmsis-dsp/cmsis-dsp/include
INCLUDES += -I$(BINDIR)/pkg/cmsis-dsp/include

View File

@ -1 +0,0 @@
/libcoap

View File

@ -1,37 +1,15 @@
PKG_NAME=libcoap
PKG_URL=https://github.com/obgm/libcoap
PKG_VERSION=ef41ce5d02d64cec0751882ae8fd95f6c32bc018
PKG_DIR=$(CURDIR)/$(PKG_NAME)
ifneq ($(RIOTBASE),)
INCLUDES += -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/sys/net/include \
-I$(RIOTBASE)/sys/posix/include -I$(RIOTBASE)/sys/posix/pnet/include
endif
.PHONY: all clean patch reset
.PHONY: all
all: patch
"$(MAKE)" -C $(PKG_DIR)
all: download
"$(MAKE)" -C $(PKG_BUILDDIR)
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 libcoap 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)"
Makefile.include:
@true
include $(RIOTBASE)/pkg/pkg.mk

View File

@ -1,3 +1,3 @@
INCLUDES += -I$(RIOTPKG)/libcoap/libcoap \
INCLUDES += -I$(BINDIR)/pkg/libcoap \
-I$(RIOTBASE)/sys/posix/include \
-I$(RIOTBASE)/sys/net/include

View File

@ -1 +0,0 @@
/micro-ecc

View File

@ -1,38 +1,15 @@
PKG_NAME=micro-ecc
PKG_URL=https://github.com/kmackay/micro-ecc.git
PKG_VERSION=b6c0cdbe7d20af48b0c2a909a66ff00b093d1542
PKG_DIR=$(CURDIR)
PKG_BUILDDIR=$(BINDIR)/pkg/$(PKG_NAME)
ifneq ($(RIOTBASE),)
INCLUDES += -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/sys/net/include \
-I$(RIOTBASE)/sys/posix/include
endif
MODULE:=$(shell basename $(CURDIR))
.PHONY: all
.PHONY: all clean patch reset
all: patch
all: download
make -C $(PKG_BUILDDIR)
make $(BINDIR)$(MODULE).a
patch: $(PKG_BUILDDIR)/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
$(PKG_BUILDDIR):
mkdir -p $(BINDIR)/pkg && \
$(GITCACHE) clone "$(PKG_URL)" "$(PKG_VERSION)" "$(PKG_BUILDDIR)"
clean::
rm -Rf $(PKG_BUILDDIR)
distclean::
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
include $(RIOTBASE)/pkg/pkg.mk

View File

@ -1 +0,0 @@
/microcoap

View File

@ -1,37 +1,15 @@
PKG_NAME=microcoap
PKG_URL=git://github.com/1248/microcoap.git
PKG_VERSION=9cb1dcda2182a8dca8483b230cda8b591a924c82
PKG_DIR=$(CURDIR)/$(PKG_NAME)
ifneq ($(RIOTBASE),)
INCLUDES += -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/sys/net/include \
-I$(RIOTBASE)/sys/posix/include
endif
.PHONY: all clean patch reset
.PHONY: all
all: patch
"$(MAKE)" -C $(PKG_DIR)
all: download
"$(MAKE)" -C $(PKG_BUILDDIR)
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 $(PKG_NAME) 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)"
Makefile.include:
@true
include $(RIOTBASE)/pkg/pkg.mk

View File

@ -1 +1 @@
INCLUDES += -I$(RIOTPKG)/microcoap/microcoap
INCLUDES += -I$(BINDIR)/pkg/microcoap

View File

@ -1 +0,0 @@
/oonf_api

View File

@ -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

View File

@ -1 +1 @@
INCLUDES += -I$(RIOTPKG)/oonf_api/oonf_api/src-api
INCLUDES += -I$(BINDIR)/pkg/oonf_api/src-api

View File

@ -1 +0,0 @@
/openwsn

View File

@ -1,31 +1,10 @@
PKG_NAME=openwsn
PKG_URL=https://github.com/openwsn-berkeley/openwsn-fw.git
PKG_VERSION=ff25e5d0ae5d344ed793a724d60532fb917bf1f8
PKG_DIR=$(CURDIR)/$(PKG_NAME)
.PHONY: all clean patch reset
.PHONY: all
all: patch
all: download
"$(MAKE)" -C $(PKG_DIR)
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 OpenWSN 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)"
Makefile.include:
@true
include $(RIOTBASE)/pkg/pkg.mk

22
pkg/pkg.mk Normal file
View File

@ -0,0 +1,22 @@
#
# Include this file if your Package needs to be checked out by git
#
PKG_DIR?=$(CURDIR)
PKG_BUILDDIR?=$(BINDIR)/pkg/$(PKG_NAME)
download: $(PKG_BUILDDIR)/.downloaded
$(PKG_BUILDDIR)/.downloaded:
mkdir -p $(PKG_BUILDDIR)
$(GITCACHE) clone "$(PKG_URL)" "$(PKG_VERSION)" "$(PKG_BUILDDIR)"
if test -d "$(PKG_DIR)"/patches; then \
git -C "$(PKG_BUILDDIR)" am --ignore-whitespace "$(PKG_DIR)"/patches/*.patch; \
fi
touch $(PKG_BUILDDIR)/.downloaded
clean::
@echo "Cleaning package $(PKG_NAME)..."
rm -rf "$(PKG_BUILDDIR)"
distclean::
rm -rf "$(PKG_BUILDDIR)"

View File

@ -1 +0,0 @@
/relic

View File

@ -1,39 +1,28 @@
RELIC_URL=http://github.com/relic-toolkit/relic.git
RELIC_BRANCH=cdcfaeef101d18c3231c3b46359c519dd72682e8
PKG_NAME=relic
PKG_URL=$(RELIC_URL)
PKG_VERSION=$(RELIC_BRANCH)
PKG_DIR=$(CURDIR)/$(PKG_NAME)
PKG_URL=http://github.com/relic-toolkit/relic.git
PKG_VERSION=cdcfaeef101d18c3231c3b46359c519dd72682e8
ifneq ($(RIOTBASE),)
INCLUDES += -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/sys/net/include \
-I$(RIOTBASE)/sys/posix/include -I$(RIOTBASE)/sys/posix/pnet/include
endif
.PHONY: all clean reset
.PHONY: all
all: $(PKG_DIR)/Makefile
"$(MAKE)" -C $(PKG_DIR) && \
cp $(PKG_DIR)/lib/librelic_s.a $(BINDIR)$(PKG_NAME).a
all: $(PKG_BUILDDIR)/Makefile
"$(MAKE)" -C $(PKG_BUILDDIR) && \
cp $(PKG_BUILDDIR)/lib/librelic_s.a $(BINDIR)$(PKG_NAME).a
$(PKG_DIR)/comp-options.cmake: $(PKG_DIR)/.git/config
cd "$(PKG_DIR)" && perl ../generate-cmake-xcompile.perl > comp-options.cmake
$(PKG_BUILDDIR)/comp-options.cmake: fix_source
cd "$(PKG_BUILDDIR)" && perl $(PKG_DIR)/generate-cmake-xcompile.perl > comp-options.cmake
$(PKG_DIR)/Makefile: $(PKG_DIR)/comp-options.cmake
cd "$(PKG_DIR)" && COMP="$(filter-out -Werror=old-style-definition -Werror=strict-prototypes, $(CFLAGS) ) " cmake -DCMAKE_TOOLCHAIN_FILE=comp-options.cmake -DCHECK=off -DTESTS=0 -DBENCH=0 -DSHLIB=off -Wno-dev $(RELIC_CONFIG_FLAGS) .
$(PKG_DIR)/.git/config:
test -d "$(PKG_DIR)" || $(GITCACHE) clone "$(PKG_URL)" "$(PKG_VERSION)" "$(PKG_DIR)"
cd "$(PKG_DIR)" && git am --ignore-whitespace $(CURDIR)/*.patch
./fix-util_print_wo_args.sh .
./fix-old-style-definitions.sh .
$(PKG_BUILDDIR)/Makefile: $(PKG_BUILDDIR)/comp-options.cmake
cd "$(PKG_BUILDDIR)" && COMP="$(filter-out -Werror=old-style-definition -Werror=strict-prototypes, $(CFLAGS) ) " cmake -DCMAKE_TOOLCHAIN_FILE=comp-options.cmake -DCHECK=off -DTESTS=0 -DBENCH=0 -DSHLIB=off -Wno-dev $(RELIC_CONFIG_FLAGS) .
fix_source: download
./fix-util_print_wo_args.sh $(PKG_BUILDDIR)
./fix-old-style-definitions.sh $(PKG_BUILDDIR)
clean::
@echo "Cleaning up relic package..."
rm -rf "$(PKG_DIR)"
distclean::
rm -rf "$(PKG_DIR)"
Makefile.include:
@true
@rm -rf $(BINDIR)$(PKG_NAME).a
include $(RIOTBASE)/pkg/pkg.mk

View File

@ -1 +1 @@
INCLUDES += -I$(RIOTPKG)/relic/relic/include
INCLUDES += -I$(BINDIR)/pkg/relic/include

View File

@ -1 +0,0 @@
/wakaama

View File

@ -1,36 +1,18 @@
PKG_NAME=wakaama
PKG_URL=git://github.com/eclipse/wakaama.git
PKG_VERSION=69a32cfae39f66fe4eec4cc8d1cd48ced7ad447c
PKG_DIR=$(CURDIR)/$(PKG_NAME)
PKG_TEMP_DIR=$(CURDIR)/temp
.PHONY: all clean patch
.PHONY: all
all: patch
"$(MAKE)" -C $(PKG_DIR)
"$(MAKE)" -C $(PKG_BUILDDIR)/riotbuild
patch: $(PKG_DIR)/Makefile
patch: download
mkdir -p "$(PKG_BUILDDIR)/riotbuild"
cp $(PKG_BUILDDIR)/core/*.c $(PKG_BUILDDIR)/core/*.h $(PKG_BUILDDIR)/riotbuild
cp $(PKG_BUILDDIR)/core/er-coap-13/*.c $(PKG_TEMP_DIR)/core/er-coap-13/*.h $(PKG_BUILDDIR)/riotbuild
$(PKG_DIR)/Makefile: $(PKG_TEMP_DIR)/.git/config
echo 'include $$(RIOTBASE)/Makefile.base' > $(PKG_DIR)/Makefile
echo 'MODULE:=wakaama' > $(PKG_BUILDDIR)/riotbuild/Makefile
echo 'include $$(RIOTBASE)/Makefile.base' >> $(PKG_BUILDDIR)/riotbuild/Makefile
$(PKG_TEMP_DIR)/.git/config:
test -d "$(PKG_TEMP_DIR)" || $(GITCACHE) clone "$(PKG_URL)" "$(PKG_VERSION)" "$(PKG_TEMP_DIR)" ; \
mkdir -p "$(PKG_DIR)" ; \
cp $(PKG_TEMP_DIR)/core/*.c $(PKG_TEMP_DIR)/core/*.h $(PKG_DIR); \
cp $(PKG_TEMP_DIR)/core/er-coap-13/*.c $(PKG_TEMP_DIR)/core/er-coap-13/*.h $(PKG_DIR); \
rm -Rf "$(PKG_TEMP_DIR)"
clean::
@echo "Cleaning up $(PKG_NAME) 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)"
Makefile.include:
@true
include $(RIOTBASE)/pkg/pkg.mk