move Makefile to root
parent
3ddbe015b4
commit
5b7a1e84a4
|
@ -2,16 +2,19 @@ all: clean v
|
||||||
|
|
||||||
v: v.c
|
v: v.c
|
||||||
cc -std=gnu11 -w -o 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:
|
v.c:
|
||||||
curl -Os https://raw.githubusercontent.com/vlang/vc/master/v.c
|
curl -Os https://raw.githubusercontent.com/vlang/vc/master/v.c
|
||||||
|
|
||||||
test: v
|
test: v
|
||||||
./v -prod -o vprod . # Test prod build
|
./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..."
|
echo "Building V examples..."
|
||||||
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 vprod
|
-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.')
|
println('Looks like you are running V for the first time.')
|
||||||
// The parent directory should contain vlib if V is run
|
// The parent directory should contain vlib if V is run
|
||||||
// from "v/compiler"
|
// from "v/compiler"
|
||||||
cur_dir := os.getwd()
|
lang_dir = os.getwd()
|
||||||
lang_dir = cur_dir.all_before_last('/')
|
|
||||||
if os.dir_exists('$lang_dir/vlib/builtin') {
|
if os.dir_exists('$lang_dir/vlib/builtin') {
|
||||||
println('Setting VROOT to "$lang_dir".')
|
println('Setting VROOT to "$lang_dir".')
|
||||||
os.write_file(TmpPath + '/VROOT', lang_dir)
|
os.write_file(TmpPath + '/VROOT', lang_dir)
|
||||||
} else {
|
} else {
|
||||||
println('V repo not found. Cloning...')
|
println('V repo not found. Go to https://vlang.io to download V.zip or')
|
||||||
exit(1)
|
println('or install V from source.')
|
||||||
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')
|
|
||||||
exit(1)
|
exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue