Merge pull request #1 from g-oikonomou/contrib/change-bsl-addr-calculation

Remove duplicate block and define the argument of -a using $(shell)
This commit is contained in:
Jelmer Tiete 2015-11-24 10:18:22 -08:00
commit ff6e559be2
2 changed files with 9 additions and 10 deletions

View File

@ -29,7 +29,7 @@ MODULES += core/net core/net/mac \
core/net/llsec core/net/llsec
PYTHON = python PYTHON = python
BSL_FLAGS += -e -w -v -a $$($(OBJDUMP) -h $*.elf | grep -B1 LOAD | grep -Ev 'LOAD|\-\-' | awk '{print "0x" $$5}' | sort -g | head -1) BSL_FLAGS += -e -w -v
ifdef PORT ifdef PORT
BSL_FLAGS += -p $(PORT) BSL_FLAGS += -p $(PORT)
@ -41,5 +41,8 @@ BSL = $(CONTIKI)/tools/cc2538-bsl/cc2538-bsl.py
ifeq ($(wildcard $(BSL)), ) ifeq ($(wildcard $(BSL)), )
@echo "ERROR: Could not find the cc2538-bsl script. Did you run 'git submodule update --init' ?" @echo "ERROR: Could not find the cc2538-bsl script. Did you run 'git submodule update --init' ?"
else else
$(PYTHON) $(BSL) $(BSL_FLAGS) $< $(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) $<
endif endif

View File

@ -36,18 +36,14 @@ MODULES += core/net core/net/mac \
core/net/mac/contikimac \ core/net/mac/contikimac \
core/net/llsec core/net/llsec
PYTHON = python
BSL_FLAGS += -e -w -v -a $$($(OBJDUMP) -h $*.elf | grep -B1 LOAD | grep -Ev 'LOAD|\-\-' | awk '{print "0x" $$5}' | sort -g | head -1)
ifdef PORT
BSL_FLAGS += -p $(PORT)
endif
BSL = $(CONTIKI)/tools/cc2538-bsl/cc2538-bsl.py BSL = $(CONTIKI)/tools/cc2538-bsl/cc2538-bsl.py
%.upload: %.bin %.elf %.upload: %.bin %.elf
ifeq ($(wildcard $(BSL)), ) ifeq ($(wildcard $(BSL)), )
@echo "ERROR: Could not find the cc2538-bsl script. Did you run 'git submodule update --init' ?" @echo "ERROR: Could not find the cc2538-bsl script. Did you run 'git submodule update --init' ?"
else else
$(PYTHON) $(BSL) $(BSL_FLAGS) $< $(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) $<
endif endif