.PHONY: v8 all BREW = $(shell which brew) ifeq ($(BREW),/opt/homebrew/bin/brew) LLVM_BINPATH = /opt/homebrew/opt/llvm endif ifeq ($(BREW),/usr/local/bin/brew) LLVM_BINPATH = /usr/local/opt/llvm endif GN_ARGS = is_debug=true is_component_build=false v8_use_external_startup_data=false v8_enable_i18n_support=false clang_base_path=\"$(LLVM_BINPATH)\" clang_use_chrome_plugins=false use_custom_libcxx=false treat_warnings_as_errors=false use_lld=false v8_monolithic=true build/gn/out/gn: ifeq ($(LLVM_BINPATH)/bin/clang++,) @echo "Unable to find clang++" && exit 1 endif @echo "Setting up build directory" @mkdir -p build @echo "Downloading gn source" @git clone -q https://gn.googlesource.com/gn.git build/gn @cd build/gn && git checkout -q eea3906f0e2a8d3622080127d2005ff214d51383 @echo "Building gn" @cd build/gn && python3 build/gen.py && ninja -C out/ gn build/v8: build/gn/out/gn @echo "Downloading v8 source" @git clone -q https://github.com/v8/v8 build/v8 @cd build/v8 && git checkout -q 9.7.37 @echo "Patching v8" @cd build/v8 && (git apply ../../patches/*.patch || true) @echo "Downloading up third party sources" @git clone -q https://chromium.googlesource.com/chromium/src/base/trace_event/common.git build/v8/base/trace_event/common @cd build/v8/base/trace_event/common && git checkout -q 3da1e2fcf66acd5c7194497b4285ac163f32e239 @git clone -q https://chromium.googlesource.com/chromium/src/build.git build/v8/build @cd build/v8/build && git checkout -q bbf7f0ed65548c4df862d2a2748e3a9b908a3217 @git clone -q https://chromium.googlesource.com/external/github.com/google/googletest.git build/v8/third_party/googletest/src @cd build/v8/third_party/googletest/src && git checkout -q 47f819c3ca54fb602f432904443e00a0a1fe2f42 @git clone -q https://chromium.googlesource.com/chromium/deps/icu.git build/v8/third_party/icu @cd build/v8/third_party/icu && git checkout -q 75e34bcccea0be165c31fdb278b3712c516c5876 @git clone -q https://chromium.googlesource.com/chromium/src/third_party/jinja2.git build/v8/third_party/jinja2 @cd build/v8/third_party/jinja2 && git checkout -q ee69aa00ee8536f61db6a451f3858745cf587de6 @git clone -q https://chromium.googlesource.com/chromium/src/third_party/markupsafe.git build/v8/third_party/markupsafe @cd build/v8/third_party/markupsafe && git checkout -q 1b882ef6372b58bfd55a3285f37ed801be9137cd @git clone -q https://chromium.googlesource.com/chromium/src/third_party/zlib.git build/v8/third_party/zlib @cd build/v8/third_party/zlib && git checkout -q 563140dd9c24f84bf40919196e9e7666d351cc0d @cp Makefiles/gclient_args.gni build/v8/build/config/gclient_args.gni @echo "Building v8" @cd build/v8 && ../gn/out/gn gen out.gn --args="$(GN_ARGS)" @cd build/v8 && ninja -C ./out.gn v8_monolith libv8_monolith.a: build/v8 v8: libv8_monolith.a all: v8