mirror of
https://github.com/im-tomu/fomu-workshop.git
synced 2024-09-20 03:10:12 +00:00
makefiles: fix build under cygwin/msys2 on windows
This forces SHELL to be cmd.exe under these platforms. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
3538ebf81a
commit
7f16658435
@ -16,9 +16,17 @@ COPY := cp -a
|
||||
PATH_SEP := /
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
COPY := copy
|
||||
RM := del
|
||||
PATH_SEP := \\
|
||||
# When SHELL=sh.exe and this actually exists, make will silently
|
||||
# switch to using that instead of cmd.exe. Unfortunately, there's
|
||||
# no way to tell which environment we're running under without either
|
||||
# (1) printing out an error message, or (2) finding something that
|
||||
# works everywhere.
|
||||
# As a result, we force the shell to be cmd.exe, so it works both
|
||||
# under cygwin and normal Windows.
|
||||
SHELL = cmd.exe
|
||||
COPY = copy
|
||||
RM = del
|
||||
PATH_SEP = \\
|
||||
endif
|
||||
|
||||
BASE_DIR := .
|
||||
|
@ -16,9 +16,17 @@ COPY := cp -a
|
||||
PATH_SEP := /
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
COPY := copy
|
||||
RM := del
|
||||
PATH_SEP := \\
|
||||
# When SHELL=sh.exe and this actually exists, make will silently
|
||||
# switch to using that instead of cmd.exe. Unfortunately, there's
|
||||
# no way to tell which environment we're running under without either
|
||||
# (1) printing out an error message, or (2) finding something that
|
||||
# works everywhere.
|
||||
# As a result, we force the shell to be cmd.exe, so it works both
|
||||
# under cygwin and normal Windows.
|
||||
SHELL = cmd.exe
|
||||
COPY = copy
|
||||
RM = del
|
||||
PATH_SEP = \\
|
||||
endif
|
||||
|
||||
BASE_DIR := .
|
||||
@ -63,7 +71,7 @@ ALL := all
|
||||
TARGET := $(PACKAGE).elf
|
||||
CLEAN := clean
|
||||
|
||||
$(ALL): $(TARGET) $(PACKAGE).bin $(PACKAGE).ihex
|
||||
$(ALL): $(TARGET) $(PACKAGE).bin $(PACKAGE).ihex $(PACKAGE).dfu
|
||||
|
||||
$(OBJECTS): | $(OBJ_DIR)
|
||||
|
||||
|
@ -16,18 +16,18 @@ RM = rm -rf
|
||||
COPY = cp -a
|
||||
PATH_SEP = /
|
||||
ifeq ($(OS),Windows_NT)
|
||||
# When SHELL=sh.exe and this actually exists, we're able to run
|
||||
# the `which` command. Under these circumstances, the cmd.exe
|
||||
# equivalents "copy" and "del" don't work. Additionally, the
|
||||
# path separator can mess things up.
|
||||
# Therefore, if we're running under Windows but have a valid `sh.exe`,
|
||||
# don't use the Windows equivalents.
|
||||
ifneq (, $(shell which $(SHELL)))
|
||||
# When SHELL=sh.exe and this actually exists, make will silently
|
||||
# switch to using that instead of cmd.exe. Unfortunately, there's
|
||||
# no way to tell which environment we're running under without either
|
||||
# (1) printing out an error message, or (2) finding something that
|
||||
# works everywhere.
|
||||
# As a result, we force the shell to be cmd.exe, so it works both
|
||||
# under cygwin and normal Windows.
|
||||
SHELL = cmd.exe
|
||||
COPY = copy
|
||||
RM = del
|
||||
PATH_SEP = \\
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(FOMU_REV),evt3)
|
||||
PCF ?= $(PCF_PATH)/fomu-evt3.pcf
|
||||
|
Loading…
Reference in New Issue
Block a user