diff --git a/.gitattributes b/.gitattributes index e6d31d6aa..fe0c4b47e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,6 +8,7 @@ # These are binary so should never be modified by git. *.a binary +*.ico binary *.png binary *.jpg binary *.dxf binary diff --git a/logo/vector-logo-2.ico b/logo/vector-logo-2.ico new file mode 100644 index 000000000..24b12812c Binary files /dev/null and b/logo/vector-logo-2.ico differ diff --git a/ports/windows/Makefile b/ports/windows/Makefile index 47ce664d7..2215ce38d 100644 --- a/ports/windows/Makefile +++ b/ports/windows/Makefile @@ -102,3 +102,9 @@ test: $(BUILD)/$(PROG) $(TOP)/tests/run-tests.py test_full: test $(eval DIRNAME=ports/$(notdir $(CURDIR))) cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(BUILD)/$(PROG) $(PYTHON) ./run-tests.py --via-mpy $(RUN_TESTS_MPY_CROSS_FLAGS) $(RUN_TESTS_SKIP) -d basics float micropython + +$(BUILD)/$(PROG): $(BUILD)/micropython.res + +$(BUILD)/%.res: %.rc + $(ECHO) "WINDRES $<" + $(Q)$(WINDRES) $< -O coff -o $@ diff --git a/ports/windows/README.md b/ports/windows/README.md index 7b5f92f10..2b3ed4459 100644 --- a/ports/windows/README.md +++ b/ports/windows/README.md @@ -135,3 +135,13 @@ For more info, see https://www.winehq.org/docs/wineusr-guide/cui-programs . If built without line editing and history capabilities (MICROPY_USE_READLINE=0), the resulting binary can be run using the standard `wine` tool. + + +Generating the icon file +------------------------ +The windows builds use a .ico file for the executable logo. +To generate such file from a .png file use ImageMagick, as was done for the icons in the logo/ directory: + + magick convert vector-logo-2.png -define icon:auto-resize="256,128,96,64,48,32,16" vector-logo-2.ico + +Note that for versions prior to 7.0 the command is `convert` instead of `magick convert`. diff --git a/ports/windows/micropython.rc b/ports/windows/micropython.rc new file mode 100644 index 000000000..8d92bb0d8 --- /dev/null +++ b/ports/windows/micropython.rc @@ -0,0 +1 @@ +app ICON "../../logo/vector-logo-2.ico" diff --git a/ports/windows/micropython.vcxproj b/ports/windows/micropython.vcxproj index de04975cd..d5affd9e2 100644 --- a/ports/windows/micropython.vcxproj +++ b/ports/windows/micropython.vcxproj @@ -103,6 +103,9 @@ + + + diff --git a/py/mkenv.mk b/py/mkenv.mk index d3dddcc32..b52dafbc9 100644 --- a/py/mkenv.mk +++ b/py/mkenv.mk @@ -54,6 +54,7 @@ OBJCOPY = $(CROSS_COMPILE)objcopy SIZE = $(CROSS_COMPILE)size STRIP = $(CROSS_COMPILE)strip AR = $(CROSS_COMPILE)ar +WINDRES = $(CROSS_COMPILE)windres MAKE_MANIFEST = $(PYTHON) $(TOP)/tools/makemanifest.py MAKE_FROZEN = $(PYTHON) $(TOP)/tools/make-frozen.py