55 lines
1.3 KiB
Makefile
55 lines
1.3 KiB
Makefile
# cc2538dk platform makefile
|
|
|
|
ifndef CONTIKI
|
|
$(error CONTIKI not defined! You must specify where CONTIKI resides!)
|
|
endif
|
|
|
|
CONTIKI_TARGET_DIRS = . dev
|
|
|
|
CONTIKI_TARGET_SOURCEFILES += leds-arch.c
|
|
CONTIKI_TARGET_SOURCEFILES += platform.c
|
|
CONTIKI_TARGET_SOURCEFILES += sensors.c smartrf-sensors.c
|
|
CONTIKI_TARGET_SOURCEFILES += board-buttons.c als-sensor.c
|
|
|
|
CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
|
|
|
|
### Define the CPU directory
|
|
CONTIKI_CPU=$(ARCH_PATH)/cpu/cc2538
|
|
include $(CONTIKI_CPU)/Makefile.cc2538
|
|
|
|
MODULES += os/storage/cfs
|
|
|
|
PYTHON = python
|
|
BSL_FLAGS += -e -w -v
|
|
|
|
ifdef PORT
|
|
BSL_FLAGS += -p $(PORT)
|
|
endif
|
|
|
|
BSL = $(CONTIKI)/tools/cc2538-bsl/cc2538-bsl.py
|
|
|
|
%.upload: $(OUT_BIN) $(OUT_ELF)
|
|
ifeq ($(wildcard $(BSL)), )
|
|
@echo "ERROR: Could not find the cc2538-bsl script. Did you run 'git submodule update --init' ?"
|
|
else
|
|
$(eval BSL_ADDRESS_ARG := -a $(shell $(OBJDUMP) -h \
|
|
$(BUILD_DIR_BOARD)/$*.elf | grep -B1 LOAD | \
|
|
grep -Ev 'LOAD|\-\-' | awk '{print "0x" $$5}' | \
|
|
sort -g | head -1))
|
|
$(PYTHON) $(BSL) $(BSL_FLAGS) $(BSL_ADDRESS_ARG) $<
|
|
endif
|
|
|
|
ifeq ($(HOST_OS),Darwin)
|
|
RENODE = mono /Applications/Renode.app/Contents/MacOS/bin/Renode.exe
|
|
else
|
|
RENODE = renode
|
|
endif
|
|
|
|
SCRIPT ?= $(notdir $(CURDIR)).resc
|
|
|
|
.PHONY: renode
|
|
|
|
renode: all
|
|
$(RENODE) $(SCRIPT)
|
|
|