From 5b7a1e84a4d283071d12cb86dc17aeda9b5306a8 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sat, 29 Jun 2019 12:21:34 +0200 Subject: [PATCH] move Makefile to root --- compiler/Makefile => Makefile | 9 ++++++--- compiler/main.v | 15 +++------------ 2 files changed, 9 insertions(+), 15 deletions(-) rename compiler/Makefile => Makefile (53%) diff --git a/compiler/Makefile b/Makefile similarity index 53% rename from compiler/Makefile rename to Makefile index 93b34c06ac..28facc734d 100644 --- a/compiler/Makefile +++ b/Makefile @@ -2,16 +2,19 @@ all: clean v v: v.c cc -std=gnu11 -w -o v v.c - ./v -o v . + ./v -o v compiler + rm v.c + echo "V has been successfully built" v.c: curl -Os https://raw.githubusercontent.com/vlang/vc/master/v.c test: v ./v -prod -o vprod . # Test prod build - find .. -name '*_test.v' -print0 | xargs -0 -n1 ./v + echo "Running V tests..." + find . -name '*_test.v' -print0 | xargs -0 -n1 ./v echo "Building V examples..." - find ../examples -name '*.v' -print0 | xargs -0 -n1 ./v + find examples -name '*.v' -print0 | xargs -0 -n1 ./v clean: -rm -f v.c v vprod diff --git a/compiler/main.v b/compiler/main.v index 165c7d2206..869cf09c1b 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -788,22 +788,13 @@ fn new_v(args[]string) *V { println('Looks like you are running V for the first time.') // The parent directory should contain vlib if V is run // from "v/compiler" - cur_dir := os.getwd() - lang_dir = cur_dir.all_before_last('/') + lang_dir = os.getwd() if os.dir_exists('$lang_dir/vlib/builtin') { println('Setting VROOT to "$lang_dir".') os.write_file(TmpPath + '/VROOT', lang_dir) } else { - println('V repo not found. Cloning...') - exit(1) - os.mv('v', 'v.bin') - os.exec('git clone https://github.com/vlang/v') - if !os.dir_exists('v') { - println('failed to clone github.com/vlang/v') - exit(1) - } - os.mv('v.bin', 'v/compiler/v') - println('Re-launch V from v/compiler') + println('V repo not found. Go to https://vlang.io to download V.zip or') + println('or install V from source.') exit(1) } }