-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (42 loc) · 1.54 KB
/
Copy pathMakefile
File metadata and controls
54 lines (42 loc) · 1.54 KB
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
# TypeScript setup
TSC=tsc
TSC_FLAGS=-b
# Node setup
NODE=node
NODE_FLAGS=--trace-uncaught --stack-trace-limit=20
NODE_DEBUG_FLAGS=--trace-uncaught --inspect --inspect-brk
# Jalangi2 setup
JALANGI_DIR=lib/jalangi2-babel
JALANGI_CMD=${JALANGI_DIR}/src/js/commands/jalangi.js --analysis
ANALYSIS_FILE := src/rewrite.js
# Configuration
LOGLEVEL=error
POLICIES=string:precise,array:precise
TAINTPATHS=true
TAINTPATHSJSON=true
# Analysis arguments
ARGS_BASE=log_level=${LOGLEVEL} policies=${POLICIES} taint_paths=${TAINTPATHS} taint_paths_json=${TAINTPATHSJSON}
ARGS=$(ARGS_BASE) assert_passed=${ASSERTPASSED} eval_sink=${EVALSINK}
ARGS_TEST=$(ARGS_BASE) eval_sink=${EVALSINK} assert_passed=${ASSERTPASSED}
# Build
.PHONY: js.stub
js.stub:
$(TSC) $(TSC_FLAGS)
@touch $@
# Commands
analyze: js.stub
$(NODE) $(NODE_FLAGS) $(JALANGI_CMD) ${ANALYSIS_FILE} ${FILE} $(ARGS)
debug: js.stub
$(NODE) $(NODE_DEBUG_FLAGS) $(JALANGI_CMD) ${ANALYSIS_FILE} ${FILE} ${ARGS}
test: js.stub
tsc -b tests/taint_precision/tests/
$(NODE) $(NODE_FLAGS) tests/taint_precision/run_unit.js
run_one_test: js.stub
tsc -b tests/taint_precision/tests/
$(NODE) $(NODE_FLAGS) $(JALANGI_CMD) ${ANALYSIS_FILE} tests/taint_precision/tests/_build/taint_precision/tests/${TEST}.js $(ARGS_TEST)
run_one_test_debug: js.stub
tsc -b tests/taint_precision/tests/
$(NODE) $(NODE_DEBUG_FLAGS) $(JALANGI_CMD) ${ANALYSIS_FILE} tests/taint_precision/tests/_build/taint_precision/tests/${TEST}.js $(ARGS_TEST)
clean:
find ./src -type f -name '*.js' -delete
find ./src -type f -name '*.js.map' -delete