Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build System: Convert Python scripts to python3 #138

Merged
merged 2 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export STM32F4XX ?= 1
# Set to 1 HYDRAFW_NFC to include HydraNFC extension support
export HYDRAFW_NFC ?= 1
export HYDRAFW_DEBUG ?= 0
export FW_REVISION := $(shell python build-scripts/hydrafw-revision.py)
export FW_REVISION := $(shell python3 build-scripts/hydrafw-revision.py)

HYDRAFW_OPTS =

Expand Down Expand Up @@ -316,19 +316,19 @@ FORCE:
ifeq ($(USE_VERBOSE_COMPILE),yes)
echo Creating ./common/hydrafw_version.hdr
-rm -f $(OBJDIR)/common.o
python build-scripts/hydrafw-version.py ./common/hydrafw_version.hdr
python3 build-scripts/hydrafw-version.py ./common/hydrafw_version.hdr
else
@echo Creating ./common/hydrafw_version.hdr
@rm -f $(OBJDIR)/common.o
@python build-scripts/hydrafw-version.py ./common/hydrafw_version.hdr
@python3 build-scripts/hydrafw-version.py ./common/hydrafw_version.hdr
endif

%.dfu: %.hex $(LDSCRIPT)
ifeq ($(USE_VERBOSE_COMPILE),yes)
python build-scripts/dfu-convert.py -r $(FW_REVISION) -i $< $@
python3 build-scripts/dfu-convert.py -r $(FW_REVISION) -i $< $@
else
@echo Creating $@
@python build-scripts/dfu-convert.py -r $(FW_REVISION) -i $< $@
@python3 build-scripts/dfu-convert.py -r $(FW_REVISION) -i $< $@
endif

# This rule hook is defined in the ChibiOS build system
Expand Down
2 changes: 1 addition & 1 deletion src/build-scripts/dfu-convert.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python2
#!/usr/bin/env python3

# Written by Antonio Galea - 2010/11/18
# Distributed under Gnu LGPL 3.0
Expand Down
2 changes: 2 additions & 0 deletions src/build-scripts/hydrafw-revision.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

from git import *
import re

Expand Down
2 changes: 2 additions & 0 deletions src/build-scripts/hydrafw-version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import sys
from optparse import OptionParser
from datetime import *
Expand Down