feat: integrate libuv as external dependency for CLI and add separate vm build target

Add a Python script to download and compile libuv v1.6.1, hook it into the Makefile so release and debug targets depend on the static library, and link libuv when building the CLI interpreter. Introduce a new "vm" target that builds only the VM library without requiring libuv. Update the Xcode project to link libuv.a into the executable.
This commit is contained in:
Bob Nystrom
2015-08-02 17:43:38 +00:00
parent 7d9e45e906
commit e24d9ef0c3
4 changed files with 149 additions and 8 deletions
+13 -3
View File
@@ -4,15 +4,21 @@
# Executables are built to bin/. Libraries are built to lib/.
LIB_UV := build/libuv/build/Release/libuv.a
# A normal, optimized release build for the current CPU architecture.
release:
release: $(LIB_UV)
@ $(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:
debug: $(LIB_UV)
@ $(MAKE) -f script/wren.mk MODE=debug
# A release build of just the VM. Does not require libuv.
vm:
@ $(MAKE) -f script/wren.mk vm
# Build all configurations.
all: debug release
@ $(MAKE) -f script/wren.mk LANG=cpp
@@ -26,6 +32,10 @@ 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.
$(LIB_UV): script/libuv.py
@ ./script/libuv.py
# Remove all build outputs and intermediate files.
clean:
@ rm -rf bin
@@ -58,4 +68,4 @@ gh-pages: docs
amalgamation: src/include/wren.h src/vm/*.h src/vm/*.c
./script/generate_amalgamation.py > build/wren.c
.PHONY: all amalgamation builtin clean debug docs gh-pages release test watchdocs
.PHONY: all amalgamation builtin clean debug docs gh-pages release test vm watchdocs