Make Makefile make windows build succesfully on MSYS2/mingw64

pull/1598/head^2
Sauzede, Nicolas 2019-09-04 01:20:26 +02:00 committed by Alexander Medvednikov
parent 38d26c8080
commit a206667b4d
1 changed files with 10 additions and 0 deletions

View File

@ -1,10 +1,20 @@
CC ?= cc CC ?= cc
_SYS:=$(shell uname -o)
ifeq ($(_SYS),Msys)
WIN32:=1
endif
all: all:
rm -rf vc/ rm -rf vc/
git clone --depth 1 --quiet https://github.com/vlang/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 ${CC} -std=gnu11 -w -o v vc/v.c -lm
./v -o v compiler ./v -o v compiler
endif
rm -rf vc/ rm -rf vc/
@echo "V has been successfully built" @echo "V has been successfully built"