Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
19959: pkg/driver_cryptocell_310: Fix Makefile r=benpicco a=mguetschow


### Contribution description

- make sure to download/extract during prepare, instead of build
- this fixes the issue of missing include dependencies for other pkgs at build time

### Testing procedure

- for an app Makefile, include both `c25519` and `driver_cryptocell_310`
- on `master`, `make all` fails with a missing include path from the `driver_cryptocell_310` package
- with this change, it works


### Issues/PRs references

- isolated from #19954 as suggested by `@miri64` 

19960: dist/tools/jlink: fix DBG_PID assignment r=benpicco a=LP-HAW



19961: ztimer_periodic: fix example in documentation r=benpicco a=benpicco



Co-authored-by: Mikolai Gütschow <[email protected]>
Co-authored-by: LP-HAW <[email protected]>
Co-authored-by: Benjamin Valentin <[email protected]>
  • Loading branch information
4 people authored Sep 29, 2023
4 parents 149cee4 + 8404ad5 + 25013f8 + 9b53f72 commit bb1b0f9
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 26 deletions.
2 changes: 1 addition & 1 deletion dist/tools/jlink/jlink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ do_debug() {
-port '${GDB_PORT}' \
-telnetport '${TELNET_PORT}'" &
# save PID for terminating the server afterwards
DBG_PID=$?
DBG_PID=$!
# connect to the GDB server
${DBG} -q ${TUI} -ex "tar ext :${GDB_PORT}" ${ELFFILE}
# clean up
Expand Down
9 changes: 5 additions & 4 deletions pkg/c25519/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ PKG_SHA512 = dbfb4285837ab2ea3d99c448b22877cc7a139ccbaebb1de367e2bec1fd562fe629

PKG_SOURCE_DIR ?= $(PKGDIRBASE)/$(PKG_NAME)
PKG_ZIPFILE = $(PKGDIRBASE)/$(PKG_NAME)-$(PKG_VERSION).$(PKG_EXT)
PKG_ZIP_URL = $(PKG_URL)/$(PKG_NAME)-$(PKG_VERSION).$(PKG_EXT)

ifneq ($(RIOTBASE),)
include $(RIOTBASE)/Makefile.base
Expand All @@ -19,17 +20,17 @@ prepare: $(PKG_SOURCE_DIR)/
all: $(PKG_SOURCE_DIR)/
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/src -f $(RIOTBASE)/Makefile.base MODULE=$(PKG_NAME)

$(PKG_SOURCE_DIR)/: $(PKGDIRBASE)/$(PKG_NAME)-$(PKG_VERSION).$(PKG_EXT)
$(QQ)test "$(PKG_SHA512) $(PKG_ZIPFILE)" = "$$(sha512sum "${PKG_ZIPFILE}")"
$(PKG_SOURCE_DIR)/: $(PKG_ZIPFILE)
$(QQ)test "$(PKG_SHA512) $(PKG_ZIPFILE)" = "$$(sha512sum "$(PKG_ZIPFILE)")"
$(Q)$(UNZIP_HERE) -D -d $(PKGDIRBASE) $<

$(PKG_ZIPFILE):
$(QQ)mkdir -p $(PKGDIRBASE)
$(Q)$(DOWNLOAD_TO_FILE) $@ $(PKG_URL)/$(PKG_NAME)-$(PKG_VERSION).$(PKG_EXT)
$(Q)$(DOWNLOAD_TO_FILE) $@ $(PKG_ZIP_URL)

clean::
# Reset package to checkout state.
rm -rf $(PKG_SOURCE_DIR)

distclean::
rm -rf $(PKG_SOURCE_DIR) $(PKGDIRBASE)/$(PKG_NAME)-$(PKG_VERSION).$(PKG_EXT)
rm -rf $(PKG_SOURCE_DIR) $(PKG_ZIPFILE)
46 changes: 26 additions & 20 deletions pkg/driver_cryptocell_310/Makefile
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
PKG_NAME=driver_cryptocell_310
PKG_URL=https://www.nordicsemi.com/-/media/Software-and-other-downloads/SDKs/nRF5/Binaries
PKG_VERSION=17.1.0
PKG_EXT=zip
PKG_DIR_NAME=nRF5_SDK_17.1.0_ddde560
PKG_LICENSE=ARM Object Code and Header Files License
PKG_NAME = driver_cryptocell_310
PKG_URL = https://www.nordicsemi.com/-/media/Software-and-other-downloads/SDKs/nRF5/Binaries
PKG_VERSION = 17.1.0_ddde560
PKG_DIR_NAME = nRF5_SDK
PKG_EXT = zip
PKG_LICENSE = ARM Object Code and Header Files License
PKG_SHA512 = cb610d724d27ef79c792511d8b889cbf2d411a3a391f5c740ea10b86139201b97eedf0c1edcf4d199c3fbd51e4cc5a4bd922c0c40d01e2f5359acd16a2b163e4

PKG_SOURCE_DIR ?= $(PKGDIRBASE)/$(PKG_NAME)
NRF_CC310_PATH = $(PKG_DIR_NAME)/external/nrf_cc310
PKG_ZIPFILE = $(PKG_DIR_NAME).$(PKG_EXT)
PKG_ZIP_DIR = $(PKGDIRBASE)/$(PKG_DIR_NAME)_$(PKG_VERSION)
PKG_ZIPFILE = $(PKGDIRBASE)/$(PKG_DIR_NAME)_$(PKG_VERSION).$(PKG_EXT)
PKG_ZIP_URL = $(PKG_URL)/$(PKG_DIR_NAME)_$(PKG_VERSION).$(PKG_EXT)

NRF_CC310_PATH = external/nrf_cc310

ifneq ($(RIOTBASE),)
include $(RIOTBASE)/Makefile.base
endif

.PHONY: all clean distclean prepare
.PHONY: all clean distcleanq

prepare: $(PKG_SOURCE_DIR)/

prepare: $(PKG_PREPARED)
@:
all: $(PKG_SOURCE_DIR)/

all: $(PKGDIRBASE)/$(PKG_ZIPFILE)
$(Q)$(UNZIP_HERE) -D -n -d $(PKGDIRBASE) $(PKGDIRBASE)/$(PKG_ZIPFILE)
$(Q) mkdir -p $(PKG_SOURCE_DIR)/include
$(Q)cp $(PKGDIRBASE)/$(NRF_CC310_PATH)/include/* $(PKG_SOURCE_DIR)/include
$(Q)cp $(PKGDIRBASE)/$(NRF_CC310_PATH)/lib/cortex-m4/hard-float/libnrf_cc310_0.9.13.a $(PKG_SOURCE_DIR)
$(Q)rm -rf $(PKGDIRBASE)/$(PKG_DIR_NAME)
$(PKG_SOURCE_DIR)/: $(PKG_ZIPFILE)
$(QQ)test "$(PKG_SHA512) $(PKG_ZIPFILE)" = "$$(sha512sum "$(PKG_ZIPFILE)")"
$(Q)$(UNZIP_HERE) -D -d $(PKGDIRBASE) $<
$(Q)mkdir -p $(PKG_SOURCE_DIR)/include
$(Q)cp $(PKG_ZIP_DIR)/$(NRF_CC310_PATH)/include/* $(PKG_SOURCE_DIR)/include
$(Q)cp $(PKG_ZIP_DIR)/$(NRF_CC310_PATH)/lib/cortex-m4/hard-float/libnrf_cc310_0.9.13.a $(PKG_SOURCE_DIR)
$(Q)rm -rf $(PKG_ZIP_DIR)

$(PKGDIRBASE)/$(PKG_ZIPFILE):
$(PKG_ZIPFILE):
$(QQ)mkdir -p $(PKGDIRBASE)
$(Q)$(DOWNLOAD_TO_FILE) $(PKGDIRBASE)/$(PKG_ZIPFILE) $(PKG_URL)/$(PKG_ZIPFILE)
$(Q)$(DOWNLOAD_TO_FILE) $@ $(PKG_ZIP_URL)

clean::
rm -rf $(PKG_SOURCE_DIR)

distclean::
rm -rf $(PKG_SOURCE_DIR) $(PKGDIRBASE)/$(PKG_ZIPFILE)
rm -rf $(PKG_SOURCE_DIR) $(PKG_ZIPFILE)
5 changes: 4 additions & 1 deletion sys/include/ztimer/periodic.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@
* ```
* #include "ztimer/periodic.h"
*
* static void callback(void *arg)
* static bool callback(void *arg)
* {
* puts(arg);
*
* /* keep the timer running */
* return true;
* }
*
*
Expand Down

0 comments on commit bb1b0f9

Please sign in to comment.