-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
65 lines (47 loc) · 1.71 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# ===== Variables =====
WIKIPEG_VERSION = `cat $(VERSION_FILE)`
# ===== Directories =====
LIB_DIR = lib
BIN_DIR = bin
SPEC_DIR = tests/jasmine
BENCHMARK_DIR = benchmark
NODE_MODULES_DIR = node_modules
NODE_MODULES_BIN_DIR = $(NODE_MODULES_DIR)/.bin
# ===== Files =====
PARSER_SRC_FILE = $(LIB_DIR)/parser.pegjs
PARSER_OUT_FILE = $(LIB_DIR)/parser.js
VERSION_FILE = VERSION
# ===== Executables =====
NODE = node
PHP = php
ESLINT = $(NODE_MODULES_BIN_DIR)/eslint
JASMINE_NODE = $(NODE_MODULES_BIN_DIR)/jasmine-node
WIKIPEG = $(BIN_DIR)/wikipeg
BENCHMARK_RUN = $(BENCHMARK_DIR)/run
# ===== Targets =====
all: parser test-parsers
# Generate the grammar parser
parser:
$(WIKIPEG) $(PARSER_SRC_FILE) $(PARSER_OUT_FILE)
test: spec common-tests-php common-tests-js
# Run the spec suite
spec:
$(JASMINE_NODE) --verbose $(SPEC_DIR)
common-tests-php:
$(PHP) tests/php/runCommonTests.php
common-tests-js:
$(NODE) tests/javascript/runCommonTests.js
# Run the benchmark suite
benchmark:
$(BENCHMARK_RUN)
# Run ESLint on the source
eslint:
$(ESLINT) \
--ignore-pattern=$(SPEC_DIR)/vendor \
$(LIB_DIR) \
$(SPEC_DIR) \
$(BENCHMARK_DIR)/*.js \
$(BENCHMARK_RUN) \
$(WIKIPEG)
.PHONY: parser test-parsers test common-tests-php spec benchmark eslint
.SILENT: parser test-parsers test common-tests-php spec benchmark eslint