diff --git a/pkg/Makefile.git b/pkg/Makefile.git index d15e683096..3a565315b4 100644 --- a/pkg/Makefile.git +++ b/pkg/Makefile.git @@ -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 diff --git a/pkg/ccn-lite/.gitignore b/pkg/ccn-lite/.gitignore deleted file mode 100644 index 72a81c4664..0000000000 --- a/pkg/ccn-lite/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/ccn-lite diff --git a/pkg/ccn-lite/Makefile b/pkg/ccn-lite/Makefile index 860ecd8611..7c4d8f5cee 100644 --- a/pkg/ccn-lite/Makefile +++ b/pkg/ccn-lite/Makefile @@ -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 diff --git a/pkg/ccn-lite/Makefile.include b/pkg/ccn-lite/Makefile.include index 40c18ee967..fdf03313e7 100644 --- a/pkg/ccn-lite/Makefile.include +++ b/pkg/ccn-lite/Makefile.include @@ -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 diff --git a/pkg/cmsis-dsp/.gitignore b/pkg/cmsis-dsp/.gitignore deleted file mode 100644 index 12a55487a7..0000000000 --- a/pkg/cmsis-dsp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/cmsis-dsp diff --git a/pkg/cmsis-dsp/Makefile b/pkg/cmsis-dsp/Makefile index 0c9510b6e4..17dae9ae24 100644 --- a/pkg/cmsis-dsp/Makefile +++ b/pkg/cmsis-dsp/Makefile @@ -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 diff --git a/pkg/cmsis-dsp/Makefile.include b/pkg/cmsis-dsp/Makefile.include index 835c7b44b7..3fdfa74e9a 100644 --- a/pkg/cmsis-dsp/Makefile.include +++ b/pkg/cmsis-dsp/Makefile.include @@ -1 +1 @@ -INCLUDES += -I$(RIOTPKG)/cmsis-dsp/cmsis-dsp/include +INCLUDES += -I$(BINDIR)/pkg/cmsis-dsp/include diff --git a/pkg/libcoap/.gitignore b/pkg/libcoap/.gitignore deleted file mode 100644 index 5c84315941..0000000000 --- a/pkg/libcoap/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/libcoap diff --git a/pkg/libcoap/Makefile b/pkg/libcoap/Makefile index 5953fc8c3c..7a97abcd3c 100644 --- a/pkg/libcoap/Makefile +++ b/pkg/libcoap/Makefile @@ -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 diff --git a/pkg/libcoap/Makefile.include b/pkg/libcoap/Makefile.include index 1370285f4d..7b3d3b9756 100644 --- a/pkg/libcoap/Makefile.include +++ b/pkg/libcoap/Makefile.include @@ -1,3 +1,3 @@ -INCLUDES += -I$(RIOTPKG)/libcoap/libcoap \ +INCLUDES += -I$(BINDIR)/pkg/libcoap \ -I$(RIOTBASE)/sys/posix/include \ -I$(RIOTBASE)/sys/net/include diff --git a/pkg/libcoap/0001-Add-RIOT-Makefile.patch b/pkg/libcoap/patches/0001-Add-RIOT-Makefile.patch similarity index 100% rename from pkg/libcoap/0001-Add-RIOT-Makefile.patch rename to pkg/libcoap/patches/0001-Add-RIOT-Makefile.patch diff --git a/pkg/libcoap/0002-Add-config.h.patch b/pkg/libcoap/patches/0002-Add-config.h.patch similarity index 100% rename from pkg/libcoap/0002-Add-config.h.patch rename to pkg/libcoap/patches/0002-Add-config.h.patch diff --git a/pkg/libcoap/0003-Remove-two-example-programs-in-root.patch b/pkg/libcoap/patches/0003-Remove-two-example-programs-in-root.patch similarity index 100% rename from pkg/libcoap/0003-Remove-two-example-programs-in-root.patch rename to pkg/libcoap/patches/0003-Remove-two-example-programs-in-root.patch diff --git a/pkg/libcoap/0004-Eliminate-some-compiler-warnings-and-errors.patch b/pkg/libcoap/patches/0004-Eliminate-some-compiler-warnings-and-errors.patch similarity index 100% rename from pkg/libcoap/0004-Eliminate-some-compiler-warnings-and-errors.patch rename to pkg/libcoap/patches/0004-Eliminate-some-compiler-warnings-and-errors.patch diff --git a/pkg/libcoap/0005-fix-old-style-function-declarations.patch b/pkg/libcoap/patches/0005-fix-old-style-function-declarations.patch similarity index 100% rename from pkg/libcoap/0005-fix-old-style-function-declarations.patch rename to pkg/libcoap/patches/0005-fix-old-style-function-declarations.patch diff --git a/pkg/libcoap/0006-debug-do-not-misuse-NDEBUG.patch b/pkg/libcoap/patches/0006-debug-do-not-misuse-NDEBUG.patch similarity index 100% rename from pkg/libcoap/0006-debug-do-not-misuse-NDEBUG.patch rename to pkg/libcoap/patches/0006-debug-do-not-misuse-NDEBUG.patch diff --git a/pkg/libcoap/0007-fix-option-parsing-with-debug-enabled.patch b/pkg/libcoap/patches/0007-fix-option-parsing-with-debug-enabled.patch similarity index 100% rename from pkg/libcoap/0007-fix-option-parsing-with-debug-enabled.patch rename to pkg/libcoap/patches/0007-fix-option-parsing-with-debug-enabled.patch diff --git a/pkg/libcoap/0008-fix-debug-out-in-PDU-parsing.patch b/pkg/libcoap/patches/0008-fix-debug-out-in-PDU-parsing.patch similarity index 100% rename from pkg/libcoap/0008-fix-debug-out-in-PDU-parsing.patch rename to pkg/libcoap/patches/0008-fix-debug-out-in-PDU-parsing.patch diff --git a/pkg/libcoap/0009-delete-unused-function-check_opt_size.patch b/pkg/libcoap/patches/0009-delete-unused-function-check_opt_size.patch similarity index 100% rename from pkg/libcoap/0009-delete-unused-function-check_opt_size.patch rename to pkg/libcoap/patches/0009-delete-unused-function-check_opt_size.patch diff --git a/pkg/micro-ecc/.gitignore b/pkg/micro-ecc/.gitignore deleted file mode 100644 index 52dfbcd45c..0000000000 --- a/pkg/micro-ecc/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/micro-ecc diff --git a/pkg/micro-ecc/Makefile b/pkg/micro-ecc/Makefile index 133e60a7ff..74dd09d005 100644 --- a/pkg/micro-ecc/Makefile +++ b/pkg/micro-ecc/Makefile @@ -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 diff --git a/pkg/micro-ecc/0001-Add-RIOT-Makefile.patch b/pkg/micro-ecc/patches/0001-Add-RIOT-Makefile.patch similarity index 100% rename from pkg/micro-ecc/0001-Add-RIOT-Makefile.patch rename to pkg/micro-ecc/patches/0001-Add-RIOT-Makefile.patch diff --git a/pkg/micro-ecc/0002-Include-RIOT-Hardware-RNG-interface.patch b/pkg/micro-ecc/patches/0002-Include-RIOT-Hardware-RNG-interface.patch similarity index 100% rename from pkg/micro-ecc/0002-Include-RIOT-Hardware-RNG-interface.patch rename to pkg/micro-ecc/patches/0002-Include-RIOT-Hardware-RNG-interface.patch diff --git a/pkg/micro-ecc/0003-Use-the-parameter-curve-instead-of-the-static-refere.patch b/pkg/micro-ecc/patches/0003-Use-the-parameter-curve-instead-of-the-static-refere.patch similarity index 100% rename from pkg/micro-ecc/0003-Use-the-parameter-curve-instead-of-the-static-refere.patch rename to pkg/micro-ecc/patches/0003-Use-the-parameter-curve-instead-of-the-static-refere.patch diff --git a/pkg/microcoap/.gitignore b/pkg/microcoap/.gitignore deleted file mode 100644 index 25dda219d2..0000000000 --- a/pkg/microcoap/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/microcoap diff --git a/pkg/microcoap/Makefile b/pkg/microcoap/Makefile index c199e9c74d..e837d11f17 100644 --- a/pkg/microcoap/Makefile +++ b/pkg/microcoap/Makefile @@ -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 diff --git a/pkg/microcoap/Makefile.include b/pkg/microcoap/Makefile.include index e1998cb617..af7e8531bf 100644 --- a/pkg/microcoap/Makefile.include +++ b/pkg/microcoap/Makefile.include @@ -1 +1 @@ -INCLUDES += -I$(RIOTPKG)/microcoap/microcoap +INCLUDES += -I$(BINDIR)/pkg/microcoap diff --git a/pkg/microcoap/0001-Remove-unneeded-.c-files.patch b/pkg/microcoap/patches/0001-Remove-unneeded-.c-files.patch similarity index 100% rename from pkg/microcoap/0001-Remove-unneeded-.c-files.patch rename to pkg/microcoap/patches/0001-Remove-unneeded-.c-files.patch diff --git a/pkg/microcoap/0002-Add-RIOT-Makefile.patch b/pkg/microcoap/patches/0002-Add-RIOT-Makefile.patch similarity index 100% rename from pkg/microcoap/0002-Add-RIOT-Makefile.patch rename to pkg/microcoap/patches/0002-Add-RIOT-Makefile.patch diff --git a/pkg/microcoap/0003-change-flag-from-DEBUG-to-MICROCOAP_DEBUG.patch b/pkg/microcoap/patches/0003-change-flag-from-DEBUG-to-MICROCOAP_DEBUG.patch similarity index 100% rename from pkg/microcoap/0003-change-flag-from-DEBUG-to-MICROCOAP_DEBUG.patch rename to pkg/microcoap/patches/0003-change-flag-from-DEBUG-to-MICROCOAP_DEBUG.patch diff --git a/pkg/microcoap/0004-increment_max_segments.patch b/pkg/microcoap/patches/0004-increment_max_segments.patch similarity index 100% rename from pkg/microcoap/0004-increment_max_segments.patch rename to pkg/microcoap/patches/0004-increment_max_segments.patch diff --git a/pkg/microcoap/0005-fix-uninitialized-variable.patch b/pkg/microcoap/patches/0005-fix-uninitialized-variable.patch similarity index 100% rename from pkg/microcoap/0005-fix-uninitialized-variable.patch rename to pkg/microcoap/patches/0005-fix-uninitialized-variable.patch diff --git a/pkg/oonf_api/.gitignore b/pkg/oonf_api/.gitignore deleted file mode 100644 index 9785e26089..0000000000 --- a/pkg/oonf_api/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/oonf_api 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 diff --git a/pkg/oonf_api/0001-add-RIOT-support.patch b/pkg/oonf_api/patches/0001-add-RIOT-support.patch similarity index 100% rename from pkg/oonf_api/0001-add-RIOT-support.patch rename to pkg/oonf_api/patches/0001-add-RIOT-support.patch diff --git a/pkg/oonf_api/0002-port-tests-to-riot.patch b/pkg/oonf_api/patches/0002-port-tests-to-riot.patch similarity index 100% rename from pkg/oonf_api/0002-port-tests-to-riot.patch rename to pkg/oonf_api/patches/0002-port-tests-to-riot.patch diff --git a/pkg/oonf_api/0003-port-example-to-riot.patch b/pkg/oonf_api/patches/0003-port-example-to-riot.patch similarity index 100% rename from pkg/oonf_api/0003-port-example-to-riot.patch rename to pkg/oonf_api/patches/0003-port-example-to-riot.patch diff --git a/pkg/oonf_api/0004-fix-conflicting-types.patch b/pkg/oonf_api/patches/0004-fix-conflicting-types.patch similarity index 100% rename from pkg/oonf_api/0004-fix-conflicting-types.patch rename to pkg/oonf_api/patches/0004-fix-conflicting-types.patch diff --git a/pkg/oonf_api/0005-only-define-container_of-when-necessary.patch b/pkg/oonf_api/patches/0005-only-define-container_of-when-necessary.patch similarity index 100% rename from pkg/oonf_api/0005-only-define-container_of-when-necessary.patch rename to pkg/oonf_api/patches/0005-only-define-container_of-when-necessary.patch diff --git a/pkg/oonf_api/0006-if_index-is-not-used.patch b/pkg/oonf_api/patches/0006-if_index-is-not-used.patch similarity index 100% rename from pkg/oonf_api/0006-if_index-is-not-used.patch rename to pkg/oonf_api/patches/0006-if_index-is-not-used.patch diff --git a/pkg/oonf_api/0007-Use-RIOT-s-container_of-implementation.patch b/pkg/oonf_api/patches/0007-Use-RIOT-s-container_of-implementation.patch similarity index 100% rename from pkg/oonf_api/0007-Use-RIOT-s-container_of-implementation.patch rename to pkg/oonf_api/patches/0007-Use-RIOT-s-container_of-implementation.patch diff --git a/pkg/oonf_api/0008-Dissolve-enum-into-single-defines.patch b/pkg/oonf_api/patches/0008-Dissolve-enum-into-single-defines.patch similarity index 100% rename from pkg/oonf_api/0008-Dissolve-enum-into-single-defines.patch rename to pkg/oonf_api/patches/0008-Dissolve-enum-into-single-defines.patch diff --git a/pkg/oonf_api/0009-Add-missing-include.patch b/pkg/oonf_api/patches/0009-Add-missing-include.patch similarity index 100% rename from pkg/oonf_api/0009-Add-missing-include.patch rename to pkg/oonf_api/patches/0009-Add-missing-include.patch diff --git a/pkg/oonf_api/0010-Change-index-of-array-from-0-to-1.patch b/pkg/oonf_api/patches/0010-Change-index-of-array-from-0-to-1.patch similarity index 100% rename from pkg/oonf_api/0010-Change-index-of-array-from-0-to-1.patch rename to pkg/oonf_api/patches/0010-Change-index-of-array-from-0-to-1.patch diff --git a/pkg/oonf_api/0011-remove-error-array-subscript-has-type-char-Werror-ch.patch b/pkg/oonf_api/patches/0011-remove-error-array-subscript-has-type-char-Werror-ch.patch similarity index 100% rename from pkg/oonf_api/0011-remove-error-array-subscript-has-type-char-Werror-ch.patch rename to pkg/oonf_api/patches/0011-remove-error-array-subscript-has-type-char-Werror-ch.patch diff --git a/pkg/openwsn/.gitignore b/pkg/openwsn/.gitignore deleted file mode 100644 index 3a3f6627cb..0000000000 --- a/pkg/openwsn/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/openwsn diff --git a/pkg/openwsn/Makefile b/pkg/openwsn/Makefile index b02298c323..89ef5075cd 100644 --- a/pkg/openwsn/Makefile +++ b/pkg/openwsn/Makefile @@ -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 diff --git a/pkg/openwsn/0001-Add-RIOT-Makefiles.patch b/pkg/openwsn/patches/0001-Add-RIOT-Makefiles.patch similarity index 100% rename from pkg/openwsn/0001-Add-RIOT-Makefiles.patch rename to pkg/openwsn/patches/0001-Add-RIOT-Makefiles.patch diff --git a/pkg/openwsn/0002-Add-RIOT-adaption.patch b/pkg/openwsn/patches/0002-Add-RIOT-adaption.patch similarity index 100% rename from pkg/openwsn/0002-Add-RIOT-adaption.patch rename to pkg/openwsn/patches/0002-Add-RIOT-adaption.patch diff --git a/pkg/openwsn/0003-Fix-old-style-definitions.patch b/pkg/openwsn/patches/0003-Fix-old-style-definitions.patch similarity index 100% rename from pkg/openwsn/0003-Fix-old-style-definitions.patch rename to pkg/openwsn/patches/0003-Fix-old-style-definitions.patch diff --git a/pkg/openwsn/0004-provide-openserial-dummies.patch b/pkg/openwsn/patches/0004-provide-openserial-dummies.patch similarity index 100% rename from pkg/openwsn/0004-provide-openserial-dummies.patch rename to pkg/openwsn/patches/0004-provide-openserial-dummies.patch diff --git a/pkg/openwsn/0005-fixes-to-RIOT-adaption.patch b/pkg/openwsn/patches/0005-fixes-to-RIOT-adaption.patch similarity index 100% rename from pkg/openwsn/0005-fixes-to-RIOT-adaption.patch rename to pkg/openwsn/patches/0005-fixes-to-RIOT-adaption.patch diff --git a/pkg/pkg.mk b/pkg/pkg.mk new file mode 100644 index 0000000000..5341404b61 --- /dev/null +++ b/pkg/pkg.mk @@ -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)" diff --git a/pkg/relic/.gitignore b/pkg/relic/.gitignore deleted file mode 100644 index 508396776c..0000000000 --- a/pkg/relic/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/relic diff --git a/pkg/relic/Makefile b/pkg/relic/Makefile index 26e4406b43..3497d89bfc 100644 --- a/pkg/relic/Makefile +++ b/pkg/relic/Makefile @@ -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 diff --git a/pkg/relic/Makefile.include b/pkg/relic/Makefile.include index c9c20ba248..9cd7350a59 100644 --- a/pkg/relic/Makefile.include +++ b/pkg/relic/Makefile.include @@ -1 +1 @@ -INCLUDES += -I$(RIOTPKG)/relic/relic/include +INCLUDES += -I$(BINDIR)/pkg/relic/include diff --git a/pkg/relic/0001-fixed-signedness-of-counter-variable.patch b/pkg/relic/patches/0001-fixed-signedness-of-counter-variable.patch similarity index 100% rename from pkg/relic/0001-fixed-signedness-of-counter-variable.patch rename to pkg/relic/patches/0001-fixed-signedness-of-counter-variable.patch diff --git a/pkg/relic/0002-don-t-redefine-ALIGN.patch b/pkg/relic/patches/0002-don-t-redefine-ALIGN.patch similarity index 100% rename from pkg/relic/0002-don-t-redefine-ALIGN.patch rename to pkg/relic/patches/0002-don-t-redefine-ALIGN.patch diff --git a/pkg/relic/0003-require-only-CMake-version-2.8.patch b/pkg/relic/patches/0003-require-only-CMake-version-2.8.patch similarity index 100% rename from pkg/relic/0003-require-only-CMake-version-2.8.patch rename to pkg/relic/patches/0003-require-only-CMake-version-2.8.patch diff --git a/pkg/wakaama/.gitignore b/pkg/wakaama/.gitignore deleted file mode 100644 index 936ad44df2..0000000000 --- a/pkg/wakaama/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/wakaama diff --git a/pkg/wakaama/Makefile b/pkg/wakaama/Makefile index 72ed926bf3..a58e74af28 100644 --- a/pkg/wakaama/Makefile +++ b/pkg/wakaama/Makefile @@ -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 diff --git a/pkg/wakaama/0001-changing-header-location.patch b/pkg/wakaama/patches/0001-changing-header-location.patch similarity index 100% rename from pkg/wakaama/0001-changing-header-location.patch rename to pkg/wakaama/patches/0001-changing-header-location.patch diff --git a/pkg/wakaama/0002-defined-endianness.patch b/pkg/wakaama/patches/0002-defined-endianness.patch similarity index 100% rename from pkg/wakaama/0002-defined-endianness.patch rename to pkg/wakaama/patches/0002-defined-endianness.patch diff --git a/pkg/wakaama/0003-fixed-warnings-in-er-coap-13.c.patch b/pkg/wakaama/patches/0003-fixed-warnings-in-er-coap-13.c.patch similarity index 100% rename from pkg/wakaama/0003-fixed-warnings-in-er-coap-13.c.patch rename to pkg/wakaama/patches/0003-fixed-warnings-in-er-coap-13.c.patch diff --git a/pkg/wakaama/0004-fixed-warnings-in-packet.c.patch b/pkg/wakaama/patches/0004-fixed-warnings-in-packet.c.patch similarity index 100% rename from pkg/wakaama/0004-fixed-warnings-in-packet.c.patch rename to pkg/wakaama/patches/0004-fixed-warnings-in-packet.c.patch diff --git a/pkg/wakaama/0005-fixed-warnings-in-tlv.c.patch b/pkg/wakaama/patches/0005-fixed-warnings-in-tlv.c.patch similarity index 100% rename from pkg/wakaama/0005-fixed-warnings-in-tlv.c.patch rename to pkg/wakaama/patches/0005-fixed-warnings-in-tlv.c.patch diff --git a/pkg/wakaama/0006-fixed-warnings-in-utils.c.patch b/pkg/wakaama/patches/0006-fixed-warnings-in-utils.c.patch similarity index 100% rename from pkg/wakaama/0006-fixed-warnings-in-utils.c.patch rename to pkg/wakaama/patches/0006-fixed-warnings-in-utils.c.patch diff --git a/pkg/wakaama/0007-fixed-warnings-in-bootstrap.c.patch b/pkg/wakaama/patches/0007-fixed-warnings-in-bootstrap.c.patch similarity index 100% rename from pkg/wakaama/0007-fixed-warnings-in-bootstrap.c.patch rename to pkg/wakaama/patches/0007-fixed-warnings-in-bootstrap.c.patch diff --git a/pkg/wakaama/0008-fixed-warnings-in-objects.c.patch b/pkg/wakaama/patches/0008-fixed-warnings-in-objects.c.patch similarity index 100% rename from pkg/wakaama/0008-fixed-warnings-in-objects.c.patch rename to pkg/wakaama/patches/0008-fixed-warnings-in-objects.c.patch diff --git a/pkg/wakaama/0009-fixed-errors-in-internals.h.patch b/pkg/wakaama/patches/0009-fixed-errors-in-internals.h.patch similarity index 100% rename from pkg/wakaama/0009-fixed-errors-in-internals.h.patch rename to pkg/wakaama/patches/0009-fixed-errors-in-internals.h.patch diff --git a/pkg/wakaama/0010-fixed-warnings-in-registration.c.patch b/pkg/wakaama/patches/0010-fixed-warnings-in-registration.c.patch similarity index 100% rename from pkg/wakaama/0010-fixed-warnings-in-registration.c.patch rename to pkg/wakaama/patches/0010-fixed-warnings-in-registration.c.patch