windows/Makefile: Add .exe extension to executables name.

Uses the same logic applied in 5b57ae985f
to determine when to add .exe.

See related: #3310, #3361, #3370, #4143, #5727.
This commit is contained in:
Bryan Tong Minh 2019-08-10 10:47:56 +02:00 committed by Damien George
parent e10a044d7c
commit 3d9af87721
3 changed files with 11 additions and 7 deletions

View File

@ -63,10 +63,7 @@ after_test:
throw "$env:MSYSTEM build exited with code $LASTEXITCODE" throw "$env:MSYSTEM build exited with code $LASTEXITCODE"
} }
cd (Join-Path $env:APPVEYOR_BUILD_FOLDER 'mpy-cross') cd (Join-Path $env:APPVEYOR_BUILD_FOLDER 'mpy-cross')
# Building of mpy-cross hasn't been fixed across all possible windows/WSL/... C:\msys64\usr\bin\bash.exe -l -c "make -B -j4 V=1"
# variations and the STRIP step tries to strip mpy-cross whereas that should be
# mpy-cross.exe. Workaround for now by skipping actual strip and size commands.
C:\msys64\usr\bin\bash.exe -l -c "make -B -j4 V=1 STRIP=echo SIZE=echo"
if ($LASTEXITCODE -ne 0) { if ($LASTEXITCODE -ne 0) {
throw "$env:MSYSTEM mpy_cross build exited with code $LASTEXITCODE" throw "$env:MSYSTEM mpy_cross build exited with code $LASTEXITCODE"
} }

View File

@ -2,7 +2,7 @@ include ../../py/mkenv.mk
-include mpconfigport.mk -include mpconfigport.mk
# define main target # define main target
PROG = micropython.exe PROG = micropython
# qstr definitions (must come before including py.mk) # qstr definitions (must come before including py.mk)
QSTR_DEFS = ../unix/qstrdefsport.h QSTR_DEFS = ../unix/qstrdefsport.h

View File

@ -178,6 +178,13 @@ endif
ifneq ($(PROG),) ifneq ($(PROG),)
# Build a standalone executable (unix does this) # Build a standalone executable (unix does this)
# The executable should have an .exe extension for builds targetting 'pure'
# Windows, i.e. msvc or mingw builds, but not when using msys or cygwin's gcc.
COMPILER_TARGET := $(shell $(CC) -dumpmachine)
ifneq (,$(findstring mingw,$(COMPILER_TARGET)))
PROG := $(PROG).exe
endif
all: $(PROG) all: $(PROG)
$(PROG): $(OBJ) $(PROG): $(OBJ)
@ -186,9 +193,9 @@ $(PROG): $(OBJ)
# we may want to compile using Thumb, but link with non-Thumb libc. # we may want to compile using Thumb, but link with non-Thumb libc.
$(Q)$(CC) -o $@ $^ $(LIB) $(LDFLAGS) $(Q)$(CC) -o $@ $^ $(LIB) $(LDFLAGS)
ifndef DEBUG ifndef DEBUG
$(Q)$(STRIP) $(STRIPFLAGS_EXTRA) $(PROG) $(Q)$(STRIP) $(STRIPFLAGS_EXTRA) $@
endif endif
$(Q)$(SIZE) $$(find $(BUILD) -path "$(BUILD)/build/frozen*.o") $(PROG) $(Q)$(SIZE) $$(find $(BUILD) -path "$(BUILD)/build/frozen*.o") $@
clean: clean-prog clean: clean-prog
clean-prog: clean-prog: