Blame view

RIOT/pkg/nordic_softdevice_ble/Makefile 1.53 KB
fb11e647   vrobic   reseau statique a...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
  PKG_NAME = nordic_softdevice_ble
  PKG_VERSION = 3288530
  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_DIR=$(CURDIR)
  PKG_BUILDDIR=$(BINDIRBASE)/pkg/$(BOARD)/$(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 clean distclean
  
  all: $(BINDIR)/ble_6lowpan.a $(BINDIR)/softdevice.hex
  
  $(BINDIR)/ble_6lowpan.a: $(PKG_SRCDIR)/.extracted
  	cp $(PKG_SRCDIR)/$(BLE_6LOWPAN_LIB) $@
  
  $(BINDIR)/softdevice.hex: $(PKG_SRCDIR)/.extracted
  	cp $(PKG_SRCDIR)/$(SOFTDEVICE) $@
  
  $(PKG_SRCDIR)/.extracted: $(PKG_BUILDDIR)/$(PKG_FILE)
  	rm -rf $(@D)
  	mkdir -p $(@D)
  	$(AD)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):
  	@mkdir -p $(@D)
  	$(AD)$(DOWNLOAD_TO_FILE) $@ $(PKG_URL)
  
  clean::
  	rm -rf $(PKG_SRCDIR)/
  
  distclean::
  	rm -rf $(PKG_BUILDDIR)/