Merge pull request #10269 from haslinghuis/fix-dfu-pack
Fix dfuse and python check
This commit is contained in:
commit
785969031d
|
@ -6,24 +6,20 @@
|
|||
# and the ARM toolchain installed to either the Taulabs/tools directory, their
|
||||
# respective default installation locations, or made available on the system path.
|
||||
|
||||
# Check for and find Python 2
|
||||
|
||||
# Get Python version, separate major/minor/patch, then put into wordlist
|
||||
PYTHON_VERSION_=$(wordlist 2,4,$(subst ., ,$(shell python -V 2>&1)))
|
||||
# Get major version from aforementioned list
|
||||
PYTHON_MAJOR_VERSION_=$(word 1,$(PYTHON_VERSION_))
|
||||
# Just in case Make has some weird scope stuff
|
||||
PYTHON=0
|
||||
# If the major Python version is the one we want..
|
||||
ifeq ($(PYTHON_MAJOR_VERSION_),2)
|
||||
# First look for `python3`. If `which` doesn't return a null value, then it exists!
|
||||
ifneq ($(shell which python3), "")
|
||||
PYTHON:=python3
|
||||
else
|
||||
# Get Python version, separate major/minor/patch, then put into wordlist
|
||||
PYTHON_VERSION_=$(wordlist 2,4,$(subst ., ,$(shell python -V 2>&1)))
|
||||
# Get major version from aforementioned list
|
||||
PYTHON_MAJOR_VERSION_=$(word 1,$(PYTHON_VERSION_))
|
||||
# Just in case Make has some weird scope stuff
|
||||
PYTHON=0
|
||||
# If the major Python version is the one we want..
|
||||
ifeq ($(PYTHON_MAJOR_VERSION_),3)
|
||||
# Then we can just use the normal Python executable
|
||||
PYTHON:=python
|
||||
else
|
||||
# However, this isn't always the case..
|
||||
# Let's look for `python2`. If `which` doesn't return a null value, then
|
||||
# it exists!
|
||||
ifneq ($(shell which python2), "")
|
||||
PYTHON:=python2
|
||||
else
|
||||
# And if it doesn't exist, let's use the default Python, and warn the user.
|
||||
# PYTHON NOT FOUND.
|
||||
|
|
|
@ -6,24 +6,20 @@
|
|||
# ARM toolchain installed to either their respective default installation
|
||||
# locations, the tools directory or made available on the system path.
|
||||
|
||||
# Check for and find Python 2
|
||||
|
||||
# Get Python version, separate major/minor/patch, then put into wordlist
|
||||
PYTHON_VERSION_=$(wordlist 2,4,$(subst ., ,$(shell python -V 2>&1)))
|
||||
# Get major version from aforementioned list
|
||||
PYTHON_MAJOR_VERSION_=$(word 1,$(PYTHON_VERSION_))
|
||||
# Just in case Make has some weird scope stuff
|
||||
PYTHON=0
|
||||
# If the major Python version is the one we want..
|
||||
ifeq ($(PYTHON_MAJOR_VERSION_),2)
|
||||
# First look for `python3`. If `which` doesn't return a null value, then it exists!
|
||||
ifneq ($(shell which python3), "")
|
||||
PYTHON:=python3
|
||||
else
|
||||
# Get Python version, separate major/minor/patch, then put into wordlist
|
||||
PYTHON_VERSION_=$(wordlist 2,4,$(subst ., ,$(shell python -V 2>&1)))
|
||||
# Get major version from aforementioned list
|
||||
PYTHON_MAJOR_VERSION_=$(word 1,$(PYTHON_VERSION_))
|
||||
# Just in case Make has some weird scope stuff
|
||||
PYTHON=0
|
||||
# If the major Python version is the one we want..
|
||||
ifeq ($(PYTHON_MAJOR_VERSION_),3)
|
||||
# Then we can just use the normal Python executable
|
||||
PYTHON:=python
|
||||
else
|
||||
# However, this isn't always the case..
|
||||
# Let's look for `python2`. If `which` doesn't return a null value, then
|
||||
# it exists!
|
||||
ifneq ($(shell which python2), "")
|
||||
PYTHON:=python2
|
||||
else
|
||||
# And if it doesn't exist, let's use the default Python, and warn the user.
|
||||
# PYTHON NOT FOUND.
|
||||
|
|
|
@ -196,38 +196,6 @@ stm32flash_clean:
|
|||
@echo " CLEAN $(STM32FLASH_DIR)"
|
||||
$(V1) [ ! -d "$(STM32FLASH_DIR)" ] || $(RM) -r "$(STM32FLASH_DIR)"
|
||||
|
||||
DFUUTIL_DIR := $(TOOLS_DIR)/dfu-util
|
||||
|
||||
.PHONY: dfuutil_install
|
||||
dfuutil_install: DFUUTIL_URL := http://dfu-util.sourceforge.net/releases/dfu-util-0.8.tar.gz
|
||||
dfuutil_install: DFUUTIL_FILE := $(notdir $(DFUUTIL_URL))
|
||||
dfuutil_install: | $(DL_DIR) $(TOOLS_DIR)
|
||||
dfuutil_install: dfuutil_clean
|
||||
# download the source
|
||||
@echo " DOWNLOAD $(DFUUTIL_URL)"
|
||||
$(V1) curl -L -k -o "$(DL_DIR)/$(DFUUTIL_FILE)" "$(DFUUTIL_URL)"
|
||||
|
||||
# extract the source
|
||||
@echo " EXTRACT $(DFUUTIL_FILE)"
|
||||
$(V1) [ ! -d "$(DL_DIR)/dfuutil-build" ] || $(RM) -r "$(DL_DIR)/dfuutil-build"
|
||||
$(V1) mkdir -p "$(DL_DIR)/dfuutil-build"
|
||||
$(V1) tar -C $(DL_DIR)/dfuutil-build -xf "$(DL_DIR)/$(DFUUTIL_FILE)"
|
||||
|
||||
# build
|
||||
@echo " BUILD $(DFUUTIL_DIR)"
|
||||
$(V1) mkdir -p "$(DFUUTIL_DIR)"
|
||||
$(V1) ( \
|
||||
cd $(DL_DIR)/dfuutil-build/dfu-util-0.8 ; \
|
||||
./configure --prefix="$(DFUUTIL_DIR)" ; \
|
||||
$(MAKE) ; \
|
||||
$(MAKE) install ; \
|
||||
)
|
||||
|
||||
.PHONY: dfuutil_clean
|
||||
dfuutil_clean:
|
||||
@echo " CLEAN $(DFUUTIL_DIR)"
|
||||
$(V1) [ ! -d "$(DFUUTIL_DIR)" ] || $(RM) -r "$(DFUUTIL_DIR)"
|
||||
|
||||
# Set up uncrustify tools
|
||||
UNCRUSTIFY_DIR := $(TOOLS_DIR)/uncrustify-0.61
|
||||
UNCRUSTIFY_BUILD_DIR := $(DL_DIR)/uncrustify
|
||||
|
|
|
@ -135,7 +135,7 @@ if __name__=="__main__":
|
|||
try:
|
||||
address = address & 0xFFFFFFFF
|
||||
except ValueError:
|
||||
print "Address %s invalid." % address
|
||||
print("Address %s invalid." % address)
|
||||
sys.exit(1)
|
||||
target.append({ 'address': address, 'data': ih.tobinstr(start=address, end=end-1)})
|
||||
|
||||
|
|
Loading…
Reference in New Issue