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