2020-09-06 16:53:08 +00:00
|
|
|
#
|
|
|
|
# QuickJS Javascript Engine
|
|
|
|
#
|
2021-03-27 10:17:31 +00:00
|
|
|
# Copyright (c) 2017-2021 Fabrice Bellard
|
|
|
|
# Copyright (c) 2017-2021 Charlie Gordon
|
2023-11-12 21:42:07 +00:00
|
|
|
# Copyright (c) 2023 Ben Noordhuis
|
|
|
|
# Copyright (c) 2023 Saúl Ibarra Corretgé
|
2020-09-06 16:53:08 +00:00
|
|
|
#
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
# of this software and associated documentation files (the "Software"), to deal
|
|
|
|
# in the Software without restriction, including without limitation the rights
|
|
|
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
# copies of the Software, and to permit persons to whom the Software is
|
|
|
|
# furnished to do so, subject to the following conditions:
|
|
|
|
#
|
|
|
|
# The above copyright notice and this permission notice shall be included in
|
|
|
|
# all copies or substantial portions of the Software.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
# THE SOFTWARE.
|
|
|
|
|
2023-11-17 09:35:52 +00:00
|
|
|
BUILD_DIR=build
|
|
|
|
BUILD_TYPE?=Release
|
|
|
|
JOBS?=$(shell getconf _NPROCESSORS_ONLN)
|
2020-09-06 16:53:08 +00:00
|
|
|
|
2023-11-17 09:35:52 +00:00
|
|
|
QJS=$(BUILD_DIR)/qjs
|
|
|
|
RUN262=$(BUILD_DIR)/run-test262
|
2020-09-06 16:53:08 +00:00
|
|
|
|
|
|
|
|
2023-11-17 09:35:52 +00:00
|
|
|
all: build
|
2020-09-06 16:53:08 +00:00
|
|
|
|
2023-11-17 09:35:52 +00:00
|
|
|
build: $(BUILD_DIR)/CMakeCache.txt
|
|
|
|
cmake --build $(BUILD_DIR) -j $(JOBS)
|
2020-09-06 16:53:08 +00:00
|
|
|
|
2023-11-17 09:35:52 +00:00
|
|
|
$(BUILD_DIR)/CMakeCache.txt:
|
|
|
|
@mkdir -p $(BUILD_DIR)
|
|
|
|
cd $(BUILD_DIR); cmake ../ -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
|
2020-09-06 17:07:30 +00:00
|
|
|
|
2023-11-17 09:35:52 +00:00
|
|
|
install: build
|
|
|
|
cmake --build $(BUILD_DIR) --target install
|
2020-09-06 16:53:08 +00:00
|
|
|
|
|
|
|
clean:
|
2023-11-17 09:35:52 +00:00
|
|
|
cmake --build $(BUILD_DIR) --target clean
|
2020-09-06 16:53:08 +00:00
|
|
|
|
2023-11-17 09:35:52 +00:00
|
|
|
debug:
|
|
|
|
BUILDTYPE=Debug $(MAKE)
|
2020-09-06 16:53:08 +00:00
|
|
|
|
2023-11-17 09:35:52 +00:00
|
|
|
distclean:
|
|
|
|
@rm -rf $(BUILD_DIR)
|
2020-09-06 16:53:08 +00:00
|
|
|
|
2023-11-17 09:35:52 +00:00
|
|
|
stats: build
|
|
|
|
$(QJS) -qd
|
2020-09-06 16:53:08 +00:00
|
|
|
|
2023-11-17 09:35:52 +00:00
|
|
|
test: build
|
|
|
|
$(QJS) tests/test_bigint.js
|
|
|
|
$(QJS) tests/test_closure.js
|
|
|
|
$(QJS) tests/test_language.js
|
|
|
|
$(QJS) tests/test_builtin.js
|
|
|
|
$(QJS) tests/test_loop.js
|
|
|
|
$(QJS) tests/test_std.js
|
|
|
|
$(QJS) tests/test_worker.js
|
2023-11-21 14:51:16 +00:00
|
|
|
$(QJS) tests/test_queue_microtask.js
|
2020-09-06 16:53:08 +00:00
|
|
|
|
2023-11-17 09:35:52 +00:00
|
|
|
test262: build
|
|
|
|
$(RUN262) -m -c test262.conf -a
|
2020-09-06 16:53:08 +00:00
|
|
|
|
2023-11-17 09:35:52 +00:00
|
|
|
test262-update: build
|
|
|
|
$(RUN262) -u -c test262.conf -a
|
2020-09-06 16:53:08 +00:00
|
|
|
|
2023-11-17 09:35:52 +00:00
|
|
|
test262-check: build
|
|
|
|
$(RUN262) -m -c test262.conf -E -a
|
2020-09-06 16:53:08 +00:00
|
|
|
|
2023-11-17 09:35:52 +00:00
|
|
|
microbench: build
|
|
|
|
$(QJS) tests/microbench.js
|
2020-09-06 16:53:08 +00:00
|
|
|
|
2023-11-17 09:35:52 +00:00
|
|
|
unicode_gen: $(BUILD_DIR)/CMakeCache.txt
|
|
|
|
cmake --build $(BUILD_DIR) --target unicode_gen
|
2020-09-06 16:53:08 +00:00
|
|
|
|
2023-11-17 09:35:52 +00:00
|
|
|
libunicode-table.h: unicode_gen
|
|
|
|
$(BUILD_DIR)/unicode_gen unicode $@
|
2020-09-06 16:53:08 +00:00
|
|
|
|
2023-11-17 09:35:52 +00:00
|
|
|
.PHONY: all build debug install clean distclean stats test test262 test262-update test262-check microbench unicode_gen
|