diff --git a/.gitignore b/.gitignore index e6cce5952f..24c3ad15c3 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ /v.*.c /v.c.out /v.exe +/tools/vget +/tools/vget.exe *.exe *.o .*.c diff --git a/Makefile b/Makefile index 252227c6d4..4451211a00 100644 --- a/Makefile +++ b/Makefile @@ -3,13 +3,13 @@ CFLAGS ?= -O2 -fPIC PREFIX ?= /usr/local VC ?= 0.1.17 -all: v +all: v tools/vget $(info V has been successfully built) v: v.c.out compiler/*.v vlib/**/*.v ./v.c.out -o v compiler -v-release: +v-release: v ./v -cflags '${CFLAGS}' -o v compiler strip v @@ -20,6 +20,9 @@ v.${VC}.c: #curl -o v.${VC}.c -LsSf https://github.com/vlang/vc/raw/${VC}/v.c curl -o v.${VC}.c -LsSf https://raw.githubusercontent.com/vlang/vc/master/v.c +tools/vget: v + ./v tools/vget.v + test: v ./v -prod -o vprod compiler # Test prod build echo "Running V tests..." @@ -29,15 +32,15 @@ test: v bash ./compiler/tests/repl/repl.sh clean: - -rm -f v.c v*.c v.c.out v vprod thirdparty/**/*.o + -rm -f v.c v*.c v.c.out v vprod thirdparty/**/*.o tools/vget find . -name '.*.c' -print0 | xargs -0 -n1 rm -f SOURCES = $(wildcard thirdparty/**/*.c) OBJECTS := ${SOURCES:.c=.o} -thirdparty: ${OBJECTS} +thirdparty: v ${OBJECTS} -thirdparty-release: ${OBJECTS} +thirdparty-release: v ${OBJECTS} strip ${OBJECTS} debug: clean v thirdparty @@ -45,13 +48,15 @@ debug: clean v thirdparty release: CFLAGS += -pie release: clean v-release thirdparty-release -install: uninstall +install: uninstall all mkdir -p ${PREFIX}/lib/vlang ${PREFIX}/bin - cp -r v vlib thirdparty ${PREFIX}/lib/vlang + cp -r {v,tools,vlib,thirdparty} ${PREFIX}/lib/vlang ln -sf ${PREFIX}/lib/vlang/v ${PREFIX}/bin/v + ln -sf ${PREFIX}/lib/vlang/tools/vget ${PREFIX}/bin/vget uninstall: - rm -rf ${PREFIX}/{bin/v,lib/vlang} + rm -rf ${PREFIX}/{bin/v,bin/vget,lib/vlang} -symlink: +symlink: v tools/vget ln -sf `pwd`/v ${PREFIX}/bin/v + ln -sf `pwd`/tools/vget ${PREFIX}/bin/vget