forked from curiousdannii/ifvms.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (32 loc) · 1.16 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Makefile for testing ifvms.js
# Default to running multiple jobs
JOBS := $(shell nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 1)
MAKEFLAGS = "-j $(JOBS)"
# Add node bin scripts to path
PATH := $(shell npm bin):$(PATH)
CURL = curl -L -s -S
# Mark which rules are not actually generating files
.PHONY: all clean lint test
all: ifvms.zip
clean:
rm -rf dist
rm tests/regtest.py
dist/%.js: src/%.js src/common/* src/%/*
mkdir -p dist
browserify src/$*.js --standalone $(shell echo $* | tr a-z A-Z) > $@
dist/%.min.js: dist/%.js
echo '/* $(shell echo $* | tr a-z A-Z) v$(shell jq -r .version -- package.json) https://github.com/curiousdannii/ifvms.js */' > $@
babili dist/$*.js >> $@
ifvms.zip: dist/zvm.min.js
zip -j ifvms.zip \
LICENSE README.md package.json \
dist/zvm.min.js src/zvm/dispatch.js
lint:
eslint --ignore-path .gitignore .
tests/regtest.py:
$(CURL) -o tests/regtest.py https://raw.githubusercontent.com/erkyrath/plotex/master/regtest.py
# Run the test suite
test: dist/zvm.min.js tests/regtest.py
cd tests && python regtest.py praxix.regtest
cd tests && python regtest.py praxix-bundled.regtest
cd tests && python regtest.py curses.regtest