refactor: move libuv download to deps/ and build per-arch static libs

Move libuv download location from build/ to deps/ so that make clean does not
remove the downloaded source. Introduce per-architecture libuv static library
naming (build/libuv-32.a, build/libuv-64.a) and pass arch parameter through
build_libuv_linux and build_libuv functions. Add cleanall target to remove
deps/ separately from build artifacts.
This commit is contained in:
Bob Nystrom
2015-08-29 02:31:03 +00:00
parent eb1bcb35d1
commit f95436f640
5 changed files with 91 additions and 50 deletions
+9 -10
View File
@@ -4,18 +4,16 @@
# Executables are built to bin/. Libraries are built to lib/.
LIBUV := build/libuv/out/Release/libuv.a
# A normal, optimized release build for the current CPU architecture.
release: $(LIBUV)
release:
@ $(MAKE) -f script/wren.mk
@ cp bin/wren wren # For convenience, copy the interpreter to the top level.
# A debug build for the current architecture.
debug: $(LIBUV)
debug:
@ $(MAKE) -f script/wren.mk MODE=debug
# A release build of just the VM. Does not require libuv.
# A release build of just the VM.
vm:
@ $(MAKE) -f script/wren.mk vm
@@ -32,16 +30,17 @@ all: debug release
@ $(MAKE) -f script/wren.mk MODE=debug ARCH=64
@ $(MAKE) -f script/wren.mk MODE=debug LANG=cpp ARCH=64
# Download and build libuv to a static library.
$(LIBUV): script/libuv.py
@ ./script/libuv.py
# Remove all build outputs and intermediate files.
# Remove all build outputs and intermediate files. Does not remove downloaded
# dependencies. Use cleanall for that.
clean:
@ rm -rf bin
@ rm -rf build
@ rm -rf lib
# Remove all build outputs, intermediate files, and downloaded dependencies.
cleanall: clean
@ rm -rf deps
# Run the tests against the debug build of Wren.
test: debug
@ $(MAKE) -f script/wren.mk MODE=debug test