From a206667b4db41d91a5be0bbee5513357e95f444f Mon Sep 17 00:00:00 2001 From: "Sauzede, Nicolas" Date: Wed, 4 Sep 2019 01:20:26 +0200 Subject: [PATCH] Make Makefile make windows build succesfully on MSYS2/mingw64 --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile b/Makefile index 8f6fc16ca7..0dd1f7f356 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,20 @@ CC ?= cc +_SYS:=$(shell uname -o) +ifeq ($(_SYS),Msys) +WIN32:=1 +endif + all: rm -rf vc/ git clone --depth 1 --quiet https://github.com/vlang/vc +ifdef WIN32 + ${CC} -std=gnu11 -DUNICODE -D_UNICODE -w -o v0.exe vc/v_win.c + ./v0.exe -o v.exe compiler +else ${CC} -std=gnu11 -w -o v vc/v.c -lm ./v -o v compiler +endif rm -rf vc/ @echo "V has been successfully built"