Integrate libuv into Wren.

- Add a script that downloads and compiles libuv.
- Hook that up to the Makefile so it pulls down libuv on build.
- Add a separate "vm" target that just builds the VM library and skips
  libuv.
- Link to libuv when compiling the CLI.
- Update the XCode project to link to libuv too.

Linux and Windows support isn't done yet, but it should be pretty
straightforward to add to the Python script.
This commit is contained in:
Bob Nystrom
2015-08-02 10:43:38 -07:00
parent 71ab3ca887
commit 4a6d7e0428
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