mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
makefile: uname osx fix & detect MinGW & MSYS
This commit is contained in:
parent
2ae2ede06a
commit
a0b3d0809d
11
Makefile
11
Makefile
@ -1,7 +1,10 @@
|
||||
CC ?= cc
|
||||
|
||||
_SYS:=$(shell uname -o)
|
||||
ifeq ($(_SYS),Msys)
|
||||
_SYS := $(shell uname 2>/dev/null || echo Unknown)
|
||||
_SYS := $(patsubst MSYS%,MSYS,$(_SYS))
|
||||
_SYS := $(patsubst MINGW%,MinGW,$(_SYS))
|
||||
|
||||
ifneq ($(filter $(_SYS),MSYS MinGW),)
|
||||
WIN32:=1
|
||||
endif
|
||||
|
||||
@ -9,10 +12,10 @@ 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
|
||||
$(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
|
||||
endif
|
||||
rm -rf vc/
|
||||
|
Loading…
Reference in New Issue
Block a user