-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
70 lines (57 loc) · 2.25 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
V8_SOURCE_DIR := third_party/v8
REVISION := $(shell python3 get-revision.py webview stable)
SHORT_REVISION := $(shell echo $(REVISION)|cut -b1-8)
BASE_NAME := v8-$(strip $(SHORT_REVISION))
SUPPORTED_ANDROID_ARCHS := arm arm64 ia32 x64
SUPPORTED_LINUX_ARCHS := ia32 x64
SUPPORTED_CONFIGS := release debug
LIBRARY_FILES := $(foreach arch,$(SUPPORTED_ANDROID_ARCHS),$(foreach config,$(SUPPORTED_CONFIGS),android-$(arch)-$(config).tar.xz)) \
$(foreach arch,$(SUPPORTED_LINUX_ARCHS),$(foreach config,$(SUPPORTED_CONFIGS),linux-$(arch)-$(config).tar.xz))
INCLUDES_FILE := include.tar.xz
TARGETS := build/$(INCLUDES_FILE) \
$(foreach f,$(LIBRARY_FILES),build/$(f)) \
build/info
URLS := $(foreach f,$(INCLUDES_FILE) $(LIBRARY_FILES),https://v8.eyeofiles.com/$(BASE_NAME)/$(f))
get_arch_name=$(shell echo $1|tr "/." "-"|cut -f3 -d'-')
get_os_name=$(shell echo $1|tr "/." "-"|cut -f2 -d'-')
get_configuration_name=$(shell echo $1|tr "/." "-"|cut -f4 -d'-')
all: $(TARGETS)
check_up_to_date:
@python3 remote-files-exist.py $(URLS)
debug:
$(foreach v,$(MAKECMDGOALS), \
$(if $(filter debug,$v),,$(warning $v = $($v))))
clean:
@rm -rf build/
build/%.tar.xz: arch=$(call get_arch_name,$@)
build/%.tar.xz: os=$(call get_os_name,$@)
build/%.tar.xz: configuration=$(call get_configuration_name,$@)
build/%.tar.xz:
python3 sync.py $(REVISION)
python3 v8-namespace-replace.py --action=replace --os=$(os)
python3 build.py $(os) $(arch) $(configuration)
python3 v8-namespace-replace.py --action=revert --os=$(os)
tar cJf $@ -C build/$(os).$(arch).$(configuration)/obj libv8_monolith.a
build/$(INCLUDES_FILE): $(V8_SOURCE_DIR)
@mkdir -p build
@tar cJf $@ -C third_party/v8 include
build/info:
mkdir -p build
echo $(REVISION) > $@
$(V8_SOURCE_DIR):
@python3 sync.py $(REVISION)
# the prerequisites match
# https://gitlab.com/eyeo/docker/-/tree/master/v8-project_gitlab-runner
.PHONY: build_prerequisites
build_prerequisites: check_prerequisites
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -yyq build-essential libgtk2.0-dev libc6:i386 xz-utils
.PHONY: check_prerequisites
check_prerequisites:
sudo apt-get update
sudo apt-get install -yyq python3.6 python3-requests
.PHONY: get_base_name
get_base_name:
@echo $(BASE_NAME)
.PHONY: $(V8_SOURCE_DIR) clean debug