1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

pkg/nordic_softdevice_ble: don't alter archive before building

Use RIOT Makefile.base when possible or explictly set files to build in a module
This commit is contained in:
Alexandre Abadie 2020-06-14 21:36:13 +02:00
parent c25f611258
commit b0d20fa603
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
4 changed files with 20 additions and 21 deletions

View File

@ -4,20 +4,31 @@ PKG_FILE = nrf5_iot_sdk_$(PKG_VERSION).zip
PKG_URL = https://developer.nordicsemi.com/nRF5_IoT_SDK/nRF5_IoT_SDK_v0.9.x/$(PKG_FILE)
PKG_MD5 = 291c875df69c51e22491e6112128bd9c
PKG_LICENSE = nordic-bsd
PKG_DIR=$(CURDIR)
PKG_BUILDDIR=$(PKGDIRBASE)/$(PKG_NAME)
PKG_SRCDIR=$(PKG_BUILDDIR)/src
SOFTDEVICE := components/softdevice/s1xx_iot/s1xx-iot-prototype3_nrf52_softdevice.hex
BLE_6LOWPAN_LIB := components/iot/ble_6lowpan/lib/ble_6lowpan.a
MODULE_MAKEFILE := $(PKG_DIR)/Makefile.module
.PHONY: all prepare clean distclean
SOFTDEVICE_MODULES = $(filter softdevice_handler ble_common ble_ipsp,$(USEMODULE))
all: $(BINDIR)/ble_6lowpan.a $(BINDIR)/softdevice.hex
.PHONY: all prepare clean distclean $(SOFTDEVICE_MODULES)
all: $(BINDIR)/ble_6lowpan.a $(BINDIR)/softdevice.hex $(SOFTDEVICE_MODULES)
prepare: $(PKG_SRCDIR)/.extracted
softdevice_handler:
make -C $(PKG_BUILDDIR)/src/components/softdevice/common/softdevice_handler -f $(RIOTBASE)/Makefile.base
ble_common:
make -C $(PKG_BUILDDIR)/src/components/ble/common -f $(CURDIR)/ble_common.mk
ble_ipsp:
make -C $(PKG_BUILDDIR)/src/components/iot/ble_ipsp -f $(RIOTBASE)/Makefile.base
$(BINDIR)/ble_6lowpan.a: $(PKG_SRCDIR)/.extracted
cp $(PKG_SRCDIR)/$(BLE_6LOWPAN_LIB) $@
@ -31,18 +42,6 @@ $(PKG_SRCDIR)/.extracted: $(PKG_BUILDDIR)/$(PKG_FILE)
rm -rf $(@D)
mkdir -p $(@D)
$(Q)cd $(@D) && $(UNZIP_HERE) $(PKG_BUILDDIR)/$(PKG_FILE)
# this file doesn't compile with RIOT, but is not needed either
rm $(PKG_BUILDDIR)/src/components/ble/common/ble_conn_params.c
# setup RIOT module makefiles for nordic SDK components
cat $(MODULE_MAKEFILE) > $(PKG_SRCDIR)/components/softdevice/common/softdevice_handler/Makefile
echo "MODULE=ble_common" > $(PKG_SRCDIR)/components/ble/common/Makefile
cat $(MODULE_MAKEFILE) >> $(PKG_SRCDIR)/components/ble/common/Makefile
cat $(MODULE_MAKEFILE) > $(PKG_SRCDIR)/components/iot/ble_ipsp/Makefile
touch $@
$(PKG_BUILDDIR)/$(PKG_FILE):

View File

@ -26,11 +26,7 @@ CFLAGS += -Wno-pedantic -Wno-unused-parameter -Wno-sign-compare
# so set this, otherwise linking fails
CFLAGS_FPU := -mfloat-abi=hard -mfpu=fpv4-sp-d16
DIRS += \
$(RIOTBASE)/pkg/nordic_softdevice_ble/src \
$(NORDIC_SRCS)/components/softdevice/common/softdevice_handler \
$(NORDIC_SRCS)/components/ble/common \
$(NORDIC_SRCS)/components/iot/ble_ipsp
DIRS += $(RIOTBASE)/pkg/nordic_softdevice_ble/src
# LLVM ARM assembler has massive problems digesting this
TOOLCHAINS_BLACKLIST += llvm

View File

@ -1 +0,0 @@
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,5 @@
MODULE = ble_common
SRC = ble_advdata.c
include $(RIOTBASE)/Makefile.base