Update Makefile

pull/1498/head
Zaoqi 2019-08-06 22:15:05 +08:00 committed by Alexander Medvednikov
parent 52f473d1c7
commit c7312d9d1c
1 changed files with 10 additions and 7 deletions

View File

@ -1,20 +1,23 @@
CC ?= cc
CFLAGS ?= -O2 -fPIC
PREFIX ?= /usr/local
VC ?= 0.1.17
all: clean v
all: v
$(info V has been successfully built)
v: v.c
./v -o v compiler
v: v.c.out
./v.c.out -o v compiler
v-release: v.c
./v -cflags '${CFLAGS}' -o v compiler
strip v
v.c:
curl -Os https://raw.githubusercontent.com/vlang/vc/master/v.c
${CC} -std=gnu11 -w -o v v.c -lm
v.c.out: v.${VC}.c
${CC} -std=gnu11 -w -o v.c.out v.${VC}.c -lm
v.${VC}.c:
curl -o v.${VC}.c -Ls https://github.com/vlang/vc/raw/${VC}/v.c
test: v
./v -prod -o vprod compiler # Test prod build
@ -24,7 +27,7 @@ test: v
find examples -name '*.v' -print0 | xargs -0 -n1 ./v
clean:
-rm -f v.c .v.c v vprod thirdparty/**/*.o
-rm -f v.c v*.c v.c.out v vprod thirdparty/**/*.o
find . -name '.*.c' -print0 | xargs -0 -n1 rm -f
SOURCES = $(wildcard thirdparty/**/*.c)