|
1 | 1 | PWD := $(shell pwd)
|
| 2 | +OS := $(shell uname -s | tr '[A-Z]' '[a-z]') |
| 3 | +CPU := $(shell uname -m) |
2 | 4 | VERSION := $(shell ./libexec/metadata version)
|
3 | 5 | NODE_VERSION := $(shell ./libexec/metadata node_version)
|
| 6 | +RUBY_VERSION = $(shell ruby -e 'puts RUBY_VERSION.gsub(/\d+$$/, "0")') |
4 | 7 |
|
5 |
| -all: |
| 8 | +vars: |
| 9 | + @echo $(PWD) |
| 10 | + @echo $(OS) $(CPU) |
| 11 | + @echo $(VERSION) $(NODE_VERSION) |
| 12 | + @echo $(RUBY_VERSION) |
6 | 13 |
|
7 |
| -pkg/libv8-node-$(VERSION)-x86_64-linux.gem: |
8 |
| - docker build --platform linux/amd64 --build-arg RUBY_VERSION=2.4 --progress plain -t libv8-node:gnu . |
9 |
| - docker run --platform linux/amd64 --rm -it -v "$(PWD)/pkg":/pkg libv8-node:gnu cp $@ /pkg/ |
| 14 | +all: gem test |
10 | 15 |
|
11 |
| -pkg/libv8-node-$(VERSION)-x86_64-linux-musl.gem: |
12 |
| - docker build --platform linux/amd64 --build-arg RUBY_VERSION=2.4-alpine --progress plain -t libv8-node:musl . |
13 |
| - docker run --platform linux/amd64 --rm -it -v "$(PWD)/pkg":/pkg libv8-node:musl cp $@ /pkg/ |
| 16 | +build: src/node-v$(NODE_VERSION)/out/Release/node |
14 | 17 |
|
15 |
| -pkg/libv8-node-$(VERSION)-aarch64-linux.gem: |
16 |
| - docker build --platform linux/arm64 --build-arg RUBY_VERSION=2.4 --progress plain -t libv8-node:gnu . |
17 |
| - docker run --platform linux/arm64 --rm -it -v "$(PWD)/pkg":/pkg libv8-node:gnu cp $@ /pkg/ |
| 18 | +lib: src/node-v$(NODE_VERSION)/out/Release/libv8_monolith.a |
18 | 19 |
|
19 |
| -pkg/libv8-node-$(VERSION)-aarch64-linux-musl.gem: |
20 |
| - docker build --platform linux/arm64 --build-arg RUBY_VERSION=2.4-alpine --progress plain -t libv8-node:musl . |
21 |
| - docker run --platform linux/arm64 --rm -it -v "$(PWD)/pkg":/pkg libv8-node:musl cp $@ /pkg/ |
| 20 | +gem: pkg/libv8-node-$(VERSION)-$(CPU)-$(OS).gem |
22 | 21 |
|
23 |
| -test/x86_64-linux: pkg/libv8-node-$(VERSION)-x86_64-linux.gem |
24 |
| - test -d test/mini_racer || git clone https://github.com/rubyjs/mini_racer.git test/mini_racer --depth 1 |
25 |
| - cd test/mini_racer && git fetch origin refs/pull/186/head && git checkout FETCH_HEAD && git reset --hard && git clean -f -d -x |
26 |
| - ruby -i -ne '$$_ =~ /^\s+LIBV8_NODE_VERSION/ ? print(" LIBV8_NODE_VERSION = \"$(VERSION)\"\n") : print' test/mini_racer/lib/mini_racer/version.rb |
27 |
| - docker run --platform linux/amd64 --rm -it -v "$(PWD)/test:/code/test" -w "/code/test/mini_racer" libv8-node:gnu sh -c 'gem install ../../$< && bundle install && bundle exec rake compile && bundle exec rake test' |
| 22 | +test: test/$(CPU)-$(OS) |
28 | 23 |
|
29 |
| -test/x86_64-linux-musl: pkg/libv8-node-$(VERSION)-x86_64-linux-musl.gem |
30 |
| - test -d test/mini_racer || git clone https://github.com/rubyjs/mini_racer.git test/mini_racer --depth 1 |
31 |
| - cd test/mini_racer && git fetch origin refs/pull/186/head && git checkout FETCH_HEAD && git reset --hard && git clean -f -d -x |
32 |
| - ruby -i -ne '$$_ =~ /^\s+LIBV8_NODE_VERSION/ ? print(" LIBV8_NODE_VERSION = \"$(VERSION)\"\n") : print' test/mini_racer/lib/mini_racer/version.rb |
33 |
| - docker run --platform linux/amd64 --rm -it -v "$(PWD)/test:/code/test" -w "/code/test/mini_racer" libv8-node:musl sh -c 'gem install ../../$< && bundle install && bundle exec rake compile && bundle exec rake test' |
| 24 | +src/node-v$(NODE_VERSION).tar.gz: |
| 25 | + ./libexec/download-node $(NODE_VERSION) |
34 | 26 |
|
35 |
| -test/aarch64-linux: pkg/libv8-node-$(VERSION)-aarch64-linux.gem |
36 |
| - test -d test/mini_racer || git clone https://github.com/rubyjs/mini_racer.git test/mini_racer --depth 1 |
37 |
| - cd test/mini_racer && git fetch origin refs/pull/186/head && git checkout FETCH_HEAD && git reset --hard && git clean -f -d -x |
38 |
| - ruby -i -ne '$$_ =~ /^\s+LIBV8_NODE_VERSION/ ? print(" LIBV8_NODE_VERSION = \"$(VERSION)\"\n") : print' test/mini_racer/lib/mini_racer/version.rb |
39 |
| - docker run --platform linux/arm64 --rm -it -v "$(PWD)/test:/code/test" -w "/code/test/mini_racer" libv8-node:gnu sh -c 'gem install ../../$< && bundle install && bundle exec rake compile && bundle exec rake test' |
| 27 | +src/node-v$(NODE_VERSION): src/node-v$(NODE_VERSION).tar.gz |
| 28 | + ./libexec/extract-node $(NODE_VERSION) |
| 29 | + |
| 30 | +src/node-v$(NODE_VERSION)/out/Release/node: src/node-v$(NODE_VERSION) |
| 31 | + ./libexec/build-libv8 $(NODE_VERSION) |
| 32 | + |
| 33 | +src/node-v$(NODE_VERSION)/out/Release/libv8_monolith.a: src/node-v$(NODE_VERSION)/out/Release/node |
| 34 | + ./libexec/build-monolith $(NODE_VERSION) |
| 35 | + |
| 36 | +vendor/v8: src/node-v$(NODE_VERSION)/out/Release/libv8_monolith.a |
| 37 | + ./libexec/inject-libv8 $(NODE_VERSION) |
| 38 | + |
| 39 | +pkg/libv8-node-$(VERSION)-$(CPU)-$(OS).gem: vendor/v8 |
| 40 | + bundle exec rake binary |
40 | 41 |
|
41 |
| -test/aarch64-linux-musl: pkg/libv8-node-$(VERSION)-aarch64-linux-musl.gem |
| 42 | +test/$(CPU)-$(OS): pkg/libv8-node-$(VERSION)-$(CPU)-$(OS).gem |
42 | 43 | test -d test/mini_racer || git clone https://github.com/rubyjs/mini_racer.git test/mini_racer --depth 1
|
43 |
| - cd test/mini_racer && git fetch origin refs/pull/186/head && git checkout FETCH_HEAD && git reset --hard && git clean -f -d -x |
| 44 | + cd test/mini_racer && git fetch origin refs/pull/232/head && git checkout FETCH_HEAD && git reset --hard && git clean -f -d -x |
44 | 45 | ruby -i -ne '$$_ =~ /^\s+LIBV8_NODE_VERSION/ ? print(" LIBV8_NODE_VERSION = \"$(VERSION)\"\n") : print' test/mini_racer/lib/mini_racer/version.rb
|
45 |
| - docker run --platform linux/arm64 --rm -it -v "$(PWD)/test:/code/test" -w "/code/test/mini_racer" libv8-node:musl sh -c 'gem install ../../$< && bundle install && bundle exec rake compile && bundle exec rake test' |
| 46 | + ruby -i -ne '$$_ =~ /spec.required_ruby_version/ ? "" : print' test/mini_racer/mini_racer.gemspec |
| 47 | + cd test/mini_racer && env TOP="$(PWD)" GEM_HOME="$(PWD)/test/bundle/ruby/$(RUBY_VERSION)" BUNDLE_PATH="$(PWD)/test/bundle" sh -c 'rm -rf "$${GEM_HOME}" && gem install $${TOP}/$< && bundle install && bundle exec rake compile && bundle exec rake test' |
0 commit comments