py/{mkenv.mk,mkrules.mk}: Append .exe for Windows executable files.

Building mpy-cross: this patch adds .exe to the PROG name when building
executables for host (eg mpy-cross) on Windows.  make clean now removes
mpy-cross.exe under Windows.

Building MicroPython: this patch sets MPY_CROSS to mpy-cross.exe or
mpy-cross so they can coexist and use cygwin or WSL without rebuilding
mpy-cross.  The dependency in the mpy rule now uses mpy-cross.exe for
Windows and mpy-cross for Linux.
pull/3336/merge
chrismas9 2017-09-10 00:51:44 +10:00 zatwierdzone przez Damien George
rodzic b00040c43c
commit 3289b9b7a7
2 zmienionych plików z 10 dodań i 4 usunięć

Wyświetl plik

@ -59,7 +59,13 @@ LD += -m32
endif
MAKE_FROZEN = $(TOP)/tools/make-frozen.py
# allow mpy-cross (for WSL) and mpy-cross.exe (for cygwin) to coexist
ifeq ($(OS),Windows_NT)
MPY_CROSS = $(TOP)/mpy-cross/mpy-cross.exe
PROG_EXT = .exe
else
MPY_CROSS = $(TOP)/mpy-cross/mpy-cross
endif
MPY_TOOL = $(TOP)/tools/mpy-tool.py
all:

Wyświetl plik

@ -111,7 +111,7 @@ FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR) -type f -name '*.py' |
FROZEN_MPY_MPY_FILES := $(addprefix $(BUILD)/frozen_mpy/,$(FROZEN_MPY_PY_FILES:.py=.mpy))
# to build .mpy files from .py files
$(BUILD)/frozen_mpy/%.mpy: $(FROZEN_MPY_DIR)/%.py $(TOP)/mpy-cross/mpy-cross
$(BUILD)/frozen_mpy/%.mpy: $(FROZEN_MPY_DIR)/%.py $(MPY_CROSS)
@$(ECHO) "MPY $<"
$(Q)$(MKDIR) -p $(dir $@)
$(Q)$(MPY_CROSS) -o $@ -s $(<:$(FROZEN_MPY_DIR)/%=%) $(MPY_CROSS_FLAGS) $<
@ -133,13 +133,13 @@ $(PROG): $(OBJ)
# we may want to compile using Thumb, but link with non-Thumb libc.
$(Q)$(CC) -o $@ $^ $(LIB) $(LDFLAGS)
ifndef DEBUG
$(Q)$(STRIP) $(STRIPFLAGS_EXTRA) $(PROG)
$(Q)$(STRIP) $(STRIPFLAGS_EXTRA) $(PROG)$(PROG_EXT)
endif
$(Q)$(SIZE) $$(find $(BUILD) -path "$(BUILD)/build/frozen*.o") $(PROG)
$(Q)$(SIZE) $$(find $(BUILD) -path "$(BUILD)/build/frozen*.o") $(PROG)$(PROG_EXT)
clean: clean-prog
clean-prog:
$(RM) -f $(PROG)
$(RM) -f $(PROG)$(PROG_EXT)
$(RM) -f $(PROG).map
.PHONY: clean-prog