Skip to content

Commit 0634fc1

Browse files
committed
build: update emsdk installation sequence
1 parent 44ebe3c commit 0634fc1

File tree

2 files changed

+9
-46
lines changed

2 files changed

+9
-46
lines changed

tools/make/common.mk

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,8 @@ DEPS_EMSDK_EMSCRIPTEN_EMCC ?= $(DEPS_EMSDK_EMSCRIPTEN)/emcc
505505
# Define the path to the Emscripten C++ compiler:
506506
DEPS_EMSDK_EMSCRIPTEN_EMXX ?= $(DEPS_EMSDK_EMSCRIPTEN)/em++
507507

508-
# Define the Binaryen version:
509-
DEPS_EMSDK_BINARYEN_VERSION ?= main
508+
# Define the path to the utility for converting WebAssembly binary files to JavaScript:
509+
DEPS_EMSDK_EMSCRIPTEN_WASM2JS ?= $(DEPS_EMSDK_BUILD_OUT)/upstream/bin/wasm2js
510510

511511
# Define the output path when building the WebAssembly Binary Toolkit (WABT):
512512
DEPS_WABT_BUILD_OUT ?= $(DEPS_BUILD_DIR)/wabt
@@ -517,9 +517,6 @@ DEPS_WABT_WASM2WAT ?= $(DEPS_WABT_BUILD_OUT)/build/wasm2wat
517517
# Define the path to the utility for converting WebAssembly text format files to the WebAssembly binary format:
518518
DEPS_WABT_WAT2WASM ?= $(DEPS_WABT_BUILD_OUT)/build/wat2wasm
519519

520-
# Define the path to the utility for linking (merging) multiple WebAssembly files:
521-
DEPS_WABT_WASM_LINK ?= $(DEPS_WABT_BUILD_OUT)/build/wasm-link
522-
523520
# Define the Cephes distribution to build (netlib, moshier, cephes-2.8):
524521
DEPS_CEPHES_DIST ?= moshier
525522

tools/make/lib/install/emsdk.mk

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -52,26 +52,10 @@ DEPS_EMSDK_TEST_OUT ?= $(DEPS_EMSDK_TEST_DIR)/build
5252
DEPS_EMSDK_TEST_INSTALL ?= $(DEPS_EMSDK_TEST_DIR)/test_install.c
5353

5454
# Define output paths for a compiled test file:
55-
DEPS_EMSDK_TEST_INSTALL_ASM_OUT ?= $(DEPS_EMSDK_TEST_OUT)/test.asm.js
56-
DEPS_EMSDK_TEST_INSTALL_WASM_OUT ?= $(DEPS_EMSDK_TEST_OUT)/test.html
57-
58-
# Define the web browser to run tests:
59-
DEPS_EMSDK_TEST_INSTALL_BROWSER ?= firefox
60-
61-
# Define the port over which to serve web browser tests:
62-
DEPS_EMSDK_TEST_INSTALL_PORT ?= 6931
63-
64-
# Define the Emscripten SDK to install:
65-
deps_emsdk := sdk-$(DEPS_EMSDK_VERSION)-64bit
66-
67-
# Define the Binaryen tool to install:
68-
deps_emsdk_binaryen := binaryen-$(DEPS_EMSDK_BINARYEN_VERSION)-64bit
55+
DEPS_EMSDK_TEST_INSTALL_WASM_OUT ?= $(DEPS_EMSDK_TEST_OUT)/test.wasm
6956

7057
# Define the path to the `emcc` compiler:
71-
EMCC ?= $(DEPS_EMSDK_BUILD_OUT)/upstream/emscripten/emcc
72-
73-
# Define the path to an executable for running HTML pages:
74-
EMRUN ?= $(DEPS_EMSDK_BUILD_OUT)/upstream/emscripten/emrun
58+
EMCC ?= $(DEPS_EMSDK_EMSCRIPTEN_EMCC)
7559

7660

7761
# RULES #
@@ -103,15 +87,6 @@ $(DEPS_EMSDK_BUILD_OUT): | $(DEPS_BUILD_DIR) $(DEPS_EMSDK_DOWNLOAD_OUT)
10387
$(DEPS_EMSDK_TEST_OUT):
10488
$(QUIET) $(MKDIR_RECURSIVE) $(DEPS_EMSDK_TEST_OUT)
10589

106-
#/
107-
# Compiles an asm.js test file for testing an Emscripten SDK installation.
108-
#
109-
# @private
110-
#/
111-
$(DEPS_EMSDK_TEST_INSTALL_ASM_OUT): $(DEPS_EMSDK_BUILD_OUT) $(DEPS_EMSDK_TEST_OUT)
112-
$(QUIET) $(EMCC) $(DEPS_EMSDK_TEST_INSTALL) \
113-
-o $(DEPS_EMSDK_TEST_INSTALL_ASM_OUT)
114-
11590
#/
11691
# Compiles a WebAssembly test file for testing an Emscripten SDK installation.
11792
#
@@ -185,8 +160,8 @@ deps-prerequisites-emsdk:
185160
#/
186161
deps-install-emsdk: $(DEPS_EMSDK_BUILD_OUT) deps-prerequisites-emsdk
187162
$(QUIET) cd $(DEPS_EMSDK_BUILD_OUT) && $(GIT) pull
188-
$(QUIET) $(DEPS_EMSDK_BUILD_OUT)/emsdk install $(deps_emsdk) $(deps_emsdk_binaryen) --build=Release
189-
$(QUIET) $(DEPS_EMSDK_BUILD_OUT)/emsdk activate $(deps_emsdk) $(deps_emsdk_binaryen) --build=Release
163+
$(QUIET) $(DEPS_EMSDK_BUILD_OUT)/emsdk install $(DEPS_EMSDK_VERSION)
164+
$(QUIET) $(DEPS_EMSDK_BUILD_OUT)/emsdk activate $(DEPS_EMSDK_VERSION)
190165

191166
.PHONY: deps-install-emsdk
192167

@@ -210,16 +185,12 @@ deps-update-emsdk: deps-install-emsdk deps-test-emsdk
210185
# @example
211186
# make deps-test-emsdk
212187
#/
213-
deps-test-emsdk: $(DEPS_EMSDK_TEST_INSTALL_ASM_OUT) $(DEPS_EMSDK_TEST_INSTALL_WASM_OUT)
188+
deps-test-emsdk: $(DEPS_EMSDK_TEST_INSTALL_WASM_OUT)
214189
$(QUIET) echo '' >&2
215190
$(QUIET) echo 'emcc info...' >&2
216191
$(QUIET) echo '' >&2
217192
$(QUIET) $(EMCC) -v >&2
218193
$(QUIET) echo '' >&2
219-
$(QUIET) echo 'Running asm.js tests...' >&2
220-
$(QUIET) echo '' >&2
221-
$(QUIET) $(NODE) $(DEPS_EMSDK_TEST_INSTALL_ASM_OUT)
222-
$(QUIET) echo '' >&2
223194
$(QUIET) echo 'Success.' >&2
224195

225196
.PHONY: deps-test-emsdk
@@ -235,13 +206,8 @@ deps-test-emsdk: $(DEPS_EMSDK_TEST_INSTALL_ASM_OUT) $(DEPS_EMSDK_TEST_INSTALL_WA
235206
deps-test-emsdk-wasm: $(DEPS_EMSDK_TEST_INSTALL_WASM_OUT)
236207
$(QUIET) echo 'Running wasm tests...' >&2
237208
$(QUIET) echo '' >&2
238-
$(QUIET) $(EMRUN) \
239-
--browser $(DEPS_EMSDK_TEST_INSTALL_BROWSER) \
240-
--port $(DEPS_EMSDK_TEST_INSTALL_PORT) \
241-
--browser_info \
242-
--system_info \
243-
--no_emrun_detect \
244-
$(DEPS_EMSDK_TEST_INSTALL_WASM_OUT)
209+
$(QUIET) echo 'TODO: make more robust' >&2
210+
$(QUIET) test -f $(DEPS_EMSDK_TEST_INSTALL_WASM_OUT) >&2
245211
$(QUIET) echo '' >&2
246212
$(QUIET) echo 'Success.' >&2
247213

0 commit comments

Comments
 (0)