-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
33 lines (24 loc) · 873 Bytes
/
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
SRCS=$(wildcard tests/*.pas)
VERIFICATION=$(patsubst tests/%.pas,verify/%,$(SRCS))
src/pascal.js: src/pascal.pegjs $(pegjs)
npx peggy --format es src/pascal.pegjs
tests/actual/%.out: export NODE_PATH=build/
tests/actual/%.out: build/%.js
@mkdir -p tests/actual/
node $< > $@ || rm $@
@test -f $@
tests/expectations/%.out:
@mkdir -p build/fpc/
fpc $(patsubst tests/expectations/%.out,tests/%.pas,$@) -FEbuild/fpc
$(patsubst tests/expectations/%.out,build/fpc/%,$@) > $@
verify/%: tests/actual/%.out tests/expectations/%.out
@./verify.sh $^
test: $(VERIFICATION)
build/%.js: tests/%.pas src/compile.js src/pascal.js src/backend/js.js src/backend/assembler.js
@mkdir -p build/
node src/compile.js $< > $@ || rm $@
@test -f $@
clean:
rm -rf src/pascal.js build/
.PRECIOUS: tests/actual/%.out build/%.js tests/expectations/%.out
.PHONY: test clean verify/%