Windows exe: Add new target 'windist' for making the Windows zip.

This commit is contained in:
Keir Fraser
2020-05-19 10:21:08 +01:00
parent df38d91fc4
commit ec760388bd
3 changed files with 32 additions and 1 deletions

View File

@@ -2,7 +2,7 @@
export FW_MAJOR := 0
export FW_MINOR := 16
TARGETS := all blinky clean dist mrproper ocd flash start serial
TARGETS := all blinky clean dist windist mrproper ocd flash start serial
.PHONY: $(TARGETS)
ifneq ($(RULES_MK),y)
@@ -65,6 +65,16 @@ dist:
$(MAKE) clean
$(ZIP) $(PROJ)-$(VER).zip $(PROJ)-$(VER)
windist:
rm -rf $(PROJ)-*
wget https://github.com/keirf/Greaseweazle/releases/download/$(VER)/$(PROJ)-$(VER).zip
$(UNZIP) $(PROJ)-$(VER).zip
cp -a scripts/setup.py $(PROJ)-$(VER)/scripts
cd $(PROJ)-$(VER)/scripts && $(PYTHON) setup.py build
cp -a $(PROJ)-$(VER)/scripts/build/exe.win*/* $(PROJ)-$(VER)/
rm -rf $(PROJ)-$(VER)/scripts $(PROJ)-$(VER)/*.py
$(ZIP) $(PROJ)-$(VER)-win.zip $(PROJ)-$(VER)
mrproper: clean
rm -rf $(PROJ)-*

View File

@@ -6,9 +6,11 @@ LD = $(TOOL_PREFIX)ld
ifeq ($(OS), Windows_NT)
PYTHON = python
ZIP = "C:/Program Files/7-Zip/7z.exe" a
UNZIP = "C:/Program Files/7-Zip/7z.exe" x
else
PYTHON = python3
ZIP = zip -r
UNZIP = unzip
endif
ifneq ($(VERBOSE),1)

19
scripts/setup.py Normal file
View File

@@ -0,0 +1,19 @@
from cx_Freeze import setup, Executable
from greaseweazle import version
buildOptions = dict(
packages = ['greaseweazle'],
excludes = [],
include_msvcr = True)
base = 'Console'
executables = [
Executable('gw.py', base=base)
]
setup(name='Greaseweazle',
version = f'{version.major}.{version.minor}',
description = '',
options = dict(build_exe = buildOptions),
executables = executables)