2016-10-24 18:54:29 +08:00
|
|
|
SDK ?= $(shell cat sdk.version)
|
2016-10-26 19:24:16 +08:00
|
|
|
SRC_DIR ?= $(realpath ../../../../../../..)
|
2016-10-24 18:54:29 +08:00
|
|
|
|
|
|
|
.PHONY: all clean flash gdbserver gdb jlinkexe rtt
|
|
|
|
|
|
|
|
MAKEFLAGS += w
|
|
|
|
|
|
|
|
ifeq ("$(VERBOSE)","1")
|
|
|
|
V :=
|
|
|
|
else
|
|
|
|
V := @
|
|
|
|
endif
|
|
|
|
|
|
|
|
ADD_DOCKER_ARGS =
|
|
|
|
|
|
|
|
# For communication with the device, we need docker container to be able
|
|
|
|
# to access it.
|
|
|
|
flash gdbserver gdb jlinkexe rtt: \
|
|
|
|
ADD_DOCKER_ARGS = --privileged -v /dev/bus/usb:/dev/bus/usb --net=host
|
|
|
|
|
|
|
|
all clean flash gdbserver gdb jlinkexe rtt:
|
|
|
|
$(V)docker run --rm -it $(ADD_DOCKER_ARGS) -v $(SRC_DIR):/src $(SDK) \
|
|
|
|
/bin/bash -c "\
|
|
|
|
make -C /src/mongoose mongoose.c mongoose.h && \
|
2016-10-26 19:24:16 +08:00
|
|
|
if [ ! -e /src/mongoose/examples/nRF52/nrf5_iot_sdk ]; then ln -s /opt/nrf5_iot_sdk /src/mongoose/examples/nRF52/nrf5_iot_sdk; fi && \
|
|
|
|
make -C /src/mongoose/examples/nRF52/http/boards/pca10040/armgcc $@ -$(MAKEFLAGS) \
|
2016-10-24 18:54:29 +08:00
|
|
|
"
|