Make windows build optional.

This commit is contained in:
Brad Nelson
2021-01-04 20:43:18 -08:00
parent 169c0831b1
commit 21c39ec6e6

View File

@ -26,16 +26,30 @@ STRIP_ARGS = -S \
--remove-section=.note.ABI-tag
LIBS=-ldl
WIN_ARCH=i686
#WIN_ARCH=x86_64
WINFLAGS = -mwindows -luser32
# Default to 32-bit Windows for maximum portability.
ifeq ($(WIN_ARCH),)
WIN_ARCH:=i686
#WIN_ARCH=x86_64
endif
TARGETS = $(WEB)/terminal.html \
$(WEB)/ueforth.js \
$(POSIX)/ueforth \
$(WINDOWS)/uEforth.exe \
$(ARDUINO)/ueforth.ino
# Selectively enable windows if tools available
ifneq (, $(shell which $(WIN_ARCH)-w64-mingw32-windres))
ifneq (, $(shell which $(WIN_ARCH)-w64-mingw32-gcc))
TARGETS += $(WINDOWS)/uEforth.exe
else
$(warning "Missing $(WIN_ARCH)-w64-mingw32-gcc skipping Windows.")
endif
else
$(warning "Missing $(WIN_ARCH)-w64-mingw32-windres skipping Windows.")
endif
all: $(TARGETS) tests
clean: