diff --git a/pkg/nordic_softdevice_ble/Makefile b/pkg/nordic_softdevice_ble/Makefile index 02a2822559..509589ee48 100644 --- a/pkg/nordic_softdevice_ble/Makefile +++ b/pkg/nordic_softdevice_ble/Makefile @@ -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): diff --git a/pkg/nordic_softdevice_ble/Makefile.include b/pkg/nordic_softdevice_ble/Makefile.include index a06b35192a..75648c74e5 100644 --- a/pkg/nordic_softdevice_ble/Makefile.include +++ b/pkg/nordic_softdevice_ble/Makefile.include @@ -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 diff --git a/pkg/nordic_softdevice_ble/Makefile.module b/pkg/nordic_softdevice_ble/Makefile.module deleted file mode 100644 index 48422e909a..0000000000 --- a/pkg/nordic_softdevice_ble/Makefile.module +++ /dev/null @@ -1 +0,0 @@ -include $(RIOTBASE)/Makefile.base diff --git a/pkg/nordic_softdevice_ble/ble_common.mk b/pkg/nordic_softdevice_ble/ble_common.mk new file mode 100644 index 0000000000..e9b66f5640 --- /dev/null +++ b/pkg/nordic_softdevice_ble/ble_common.mk @@ -0,0 +1,5 @@ +MODULE = ble_common + +SRC = ble_advdata.c + +include $(RIOTBASE)/Makefile.base