forked from danbev/learning-v8
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (41 loc) · 1.76 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
V8_HOME ?= /Users/danielbevenius/work/google/javascript/v8
v8_build_dir = $(V8_HOME)/out.gn/x64.debug
v8_include_dir = $(V8_HOME)/include
GTEST_FILTER ?= "*"
v8_dylibs = -lv8 -lv8_libbase -lv8_libplatform -licuuc -licui18n
COMPILE_TEST = clang++ -std=c++11 -O0 -g -I`pwd`/deps/googletest/googletest/include -I$(v8_include_dir) $(v8_dylibs) -L$(v8_build_dir) -pthread tests/main.cc lib/gtest/libgtest.a -o
hello-world: natives_blob.bin snapshot_blob.bin hello-world.cc
@echo "Using v8_home = $(v8_include_dir)"
clang++ -O0 -g -I$(v8_include_dir) $(v8_dylibs) -L$(v8_build_dir) hello-world.cc -o $@ -pthread -std=c++0x
instances: natives_blob.bin snapshot_blob.bin instances.cc
clang++ -O0 -g -I$(v8_include_dir) $(v8_dylibs) -L$(v8_build_dir) instances.cc -o $@ -pthread -std=c++0x
run-script: natives_blob.bin snapshot_blob.bin run-script.cc
clang++ -O0 -g -I$(v8_include_dir) $(v8_dylibs) -L$(v8_build_dir) run-script.cc -o $@ -pthread -std=c++0x
natives_blob.bin:
@cp $(v8_build_dir)/$@ .
snapshot_blob.bin:
@cp $(v8_build_dir)/$@ .
check: tests/local_test tests/persistent-object_test tests/maybe_test tests/smi_test
./tests/smi_test
tests/local_test: tests/local_test.cc
$(COMPILE_TEST) tests/local_test
tests/persistent-object_test: tests/persistent-object_test.cc
$(COMPILE_TEST) tests/persistent-object_test
tests/maybe_test: tests/maybe_test.cc
$(COMPILE_TEST) tests/maybe_test
tests/smi_test: tests/smi_test.cc
$(COMPILE_TEST) tests/smi_test
list-gtests:
./tests/smi_test --gtest_list_tests
.PHONY: clean list-gtests
clean:
rm -f hello-world
rm -f instances
rm -f run-script
rm -f natives_blob.bin
rm -f snapshot_blob.bin
rm -rf hello-world.dSYM
rm -rf tests/local_test
rm -rf tests/persistent-object_test
rm -rf tests/maybe_test
rm -rf tests/smi_test