mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
move Makefile to root
This commit is contained in:
parent
3ddbe015b4
commit
5b7a1e84a4
@ -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
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user