-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (47 loc) · 1.62 KB
/
Copy pathMakefile
File metadata and controls
65 lines (47 loc) · 1.62 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
55
56
57
58
59
60
61
62
63
64
65
CPP_FILES := $(wildcard src/*.cpp)
OBJ_FILES := $(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o)))
CC_FLAGS := --std=c++17 -I./src -I../lib/PEGTL/include -I../lib -g3 -DDEBUG -pedantic -pedantic-errors -Werror=pedantic
LD_FLAGS :=
CC := g++
PL_CLASS := LA
DST_PL_CLASS := IR
EXT_CLASS := a
COMPILER := bin/$(PL_CLASS)
OPT_LEVEL :=
CC_CLASS := $(PL_CLASS)c
parse_test: all
./bin/LA -p my_tests/parse_test.LA
dot -T svg -o parse_tree.svg parse_tree.dot
all: dirs $(COMPILER)
dirs: obj bin
obj:
mkdir -p $@
bin:
mkdir -p $@
$(COMPILER): $(OBJ_FILES)
$(CC) $(LD_FLAGS) -o $@ $^
obj/%.o: src/%.cpp
$(CC) $(CC_FLAGS) -c -o $@ $<
oracle: $(COMPILER)
../scripts/generateOutput.sh $(EXT_CLASS) $(CC_CLASS) "tests"
oracle_new: $(COMPILER)
../scripts/generateOutput.sh $(EXT_CLASS) $(CC_CLASS) "tests/new"
rm_tests_without_oracle:
../scripts/rm_tests_without_oracle.sh $(EXT_CLASS)
print_tests_without_oracle:
../scripts/print_tests_without_oracle.sh $(EXT_CLASS)
test: dirs $(COMPILER)
../scripts/test.sh $(EXT_CLASS) $(CC_CLASS) "tests"
test_new: dirs $(COMPILER)
../scripts/test.sh $(EXT_CLASS) $(CC_CLASS) "tests/new"
test_programs: dirs $(COMPILER)
../scripts/test_programs.sh $(EXT_CLASS) $(CC_CLASS)
performance: dirs $(COMPILER)
if ! test -f ./a.out ; then ./$(CC_CLASS) $(OPT_LEVEL) tests/competition2020.$(EXT_CLASS) ; fi ; /usr/bin/time -f'%E' ./a.out
copy_simone_bin:
mkdir -p bin ;
cp .bin/* bin/ ;
clean:
rm -fr bin obj *.out *.o core.* `find tests -iname *.tmp`
rm -fr *.$(DST_PL_CLASS)
.PHONY: dirs $(COMPILER) oracle oracle_new rm_tests_without_oracle test test_new test_programs performance clean