Skip to content

Simplify Makefile #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 6 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,9 @@ jobs:
defaults:
run:
shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
env:
CYGWIN_NOWINPATH: 1
CHERE_INVOKING: 1
steps:
- name: Set up Cygwin
uses: cygwin/cygwin-install-action@master
Expand All @@ -365,27 +368,13 @@ jobs:
- uses: actions/checkout@v3

- name: build

# Plain `make` fails here with this error:
# No rule to make target '/cygdrive/d/a/quickjs-ng/quickjs-ng/cutils.c',
# needed by 'CMakeFiles/qjs.dir/cutils.c.o'. Stop.
#
# For some reason, making the build directory then `make`ing in there
# fixes it.
run: |
cd $GITHUB_WORKSPACE
make build/CMakeCache.txt
make --directory build
run: make

- name: stats
run: |
cd $GITHUB_WORKSPACE
make --debug stats
run: make stats

- name: test
run: |
cd $GITHUB_WORKSPACE
make --debug test
run: make test

openbsd:
runs-on: ubuntu-latest
Expand Down
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ QJS=$(BUILD_DIR)/qjs
RUN262=$(BUILD_DIR)/run-test262


all: build
all: $(QJS)

build: $(BUILD_DIR)/CMakeCache.txt
cmake --build $(BUILD_DIR) -j $(JOBS)

$(BUILD_DIR)/CMakeCache.txt:
$(BUILD_DIR):
cmake -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)

install: build
$(QJS): $(BUILD_DIR)
cmake --build $(BUILD_DIR) -j $(JOBS)

install: $(QJS)
cmake --build $(BUILD_DIR) --target install

clean:
Expand All @@ -52,10 +52,10 @@ debug:
distclean:
@rm -rf $(BUILD_DIR)

stats: build
stats: $(QJS)
$(QJS) -qd

test: build
test: $(QJS)
$(QJS) tests/test_bigint.js
$(QJS) tests/test_closure.js
$(QJS) tests/test_language.js
Expand All @@ -65,19 +65,19 @@ test: build
$(QJS) tests/test_worker.js
$(QJS) tests/test_queue_microtask.js

test262: build
test262: $(QJS)
$(RUN262) -m -c test262.conf -a

test262-update: build
test262-update: $(QJS)
$(RUN262) -u -c test262.conf -a

test262-check: build
test262-check: $(QJS)
$(RUN262) -m -c test262.conf -E -a

microbench: build
microbench: $(QJS)
$(QJS) tests/microbench.js

unicode_gen: $(BUILD_DIR)/CMakeCache.txt
unicode_gen: $(BUILD_DIR)
cmake --build $(BUILD_DIR) --target unicode_gen

libunicode-table.h: unicode_gen
Expand Down