2013-01-12 22:44:42 +00:00
|
|
|
# cc2538dk platform makefile
|
|
|
|
|
|
|
|
ifndef CONTIKI
|
|
|
|
$(error CONTIKI not defined! You must specify where CONTIKI resides!)
|
|
|
|
endif
|
|
|
|
|
|
|
|
CONTIKI_TARGET_DIRS = . dev
|
|
|
|
|
|
|
|
CONTIKI_TARGET_SOURCEFILES += leds.c leds-arch.c
|
|
|
|
CONTIKI_TARGET_SOURCEFILES += contiki-main.c
|
2013-11-04 19:39:56 +00:00
|
|
|
CONTIKI_TARGET_SOURCEFILES += sensors.c smartrf-sensors.c
|
2015-02-11 17:06:54 +00:00
|
|
|
CONTIKI_TARGET_SOURCEFILES += button-sensor.c als-sensor.c
|
2013-01-12 22:44:42 +00:00
|
|
|
|
|
|
|
CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
|
|
|
|
|
|
|
|
CLEAN += *.cc2538dk
|
|
|
|
|
|
|
|
### Unless the example dictates otherwise, build with code size optimisations
|
|
|
|
ifndef SMALL
|
|
|
|
SMALL = 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
### Define the CPU directory
|
|
|
|
CONTIKI_CPU=$(CONTIKI)/cpu/cc2538
|
|
|
|
include $(CONTIKI_CPU)/Makefile.cc2538
|
2013-12-05 22:56:30 +00:00
|
|
|
|
2014-11-12 09:18:29 +00:00
|
|
|
MODULES += core/net core/net/mac \
|
|
|
|
core/net/mac/contikimac \
|
2015-10-21 08:18:04 +00:00
|
|
|
core/net/llsec core/net/llsec/noncoresec
|
2014-02-01 23:46:45 +00:00
|
|
|
|
2015-11-23 19:28:34 +00:00
|
|
|
PYTHON = python
|
2015-11-24 13:08:12 +00:00
|
|
|
BSL_FLAGS += -e -w -v
|
2015-11-23 19:28:34 +00:00
|
|
|
|
|
|
|
ifdef PORT
|
|
|
|
BSL_FLAGS += -p $(PORT)
|
|
|
|
endif
|
|
|
|
|
2014-02-01 23:46:45 +00:00
|
|
|
BSL = $(CONTIKI)/tools/cc2538-bsl/cc2538-bsl.py
|
|
|
|
|
2015-11-17 22:28:38 +00:00
|
|
|
%.upload: %.bin %.elf
|
2014-02-01 23:46:45 +00:00
|
|
|
ifeq ($(wildcard $(BSL)), )
|
|
|
|
@echo "ERROR: Could not find the cc2538-bsl script. Did you run 'git submodule update --init' ?"
|
|
|
|
else
|
2015-11-24 13:08:12 +00:00
|
|
|
$(eval BSL_ADDRESS_ARG := -a $(shell $(OBJDUMP) -h $*.elf | grep -B1 LOAD | \
|
|
|
|
grep -Ev 'LOAD|\-\-' | awk '{print "0x" $$5}' | \
|
|
|
|
sort -g | head -1))
|
|
|
|
$(PYTHON) $(BSL) $(BSL_FLAGS) $(BSL_ADDRESS_ARG) $<
|
2014-02-01 23:46:45 +00:00
|
|
|
endif
|