-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
138 lines (102 loc) · 2.93 KB
/
Makefile
File metadata and controls
138 lines (102 loc) · 2.93 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
CXX = g++
CXXFLAGS = -std=gnu++17 -DLOCAL_ -D_FORTIFY_SOURCE=2 -W -Wall -Wno-unknown-pragmas -O2 -fsanitize=address
INCLUDE = -I ./.ac-library/
%.o: %.cpp
$(CXX) $(CXXFLAGS) -o $@ $^
%.exe: %.cpp
$(CXX) $(CXXFLAGS) $(INCLUDE) -o $@ $^
test%: %.o make_test.o judge.o
./make_test.o > input.txt
./$< < input.txt >> input.txt
./judge.o < input.txt
if [ $$? -eq 0 ]; then echo "OK"; else echo "Failed"; exit 1; fi
fetch:
oj d https://atcoder.jp/contests/$(ATCODER_CONTEST)/tasks/$(ATCODER_CONTEST)_a -d "testa/" && \
oj d https://atcoder.jp/contests/$(ATCODER_CONTEST)/tasks/$(ATCODER_CONTEST)_b -d "testb/" && \
oj d https://atcoder.jp/contests/$(ATCODER_CONTEST)/tasks/$(ATCODER_CONTEST)_c -d "testc/" && \
oj d https://atcoder.jp/contests/$(ATCODER_CONTEST)/tasks/$(ATCODER_CONTEST)_d -d "testd/" && \
oj d https://atcoder.jp/contests/$(ATCODER_CONTEST)/tasks/$(ATCODER_CONTEST)_e -d "teste/" && \
oj d https://atcoder.jp/contests/$(ATCODER_CONTEST)/tasks/$(ATCODER_CONTEST)_f -d "testf/" && \
oj d https://atcoder.jp/contests/$(ATCODER_CONTEST)/tasks/$(ATCODER_CONTEST)_g -d "testg/" && \
oj d https://atcoder.jp/contests/$(ATCODER_CONTEST)/tasks/$(ATCODER_CONTEST)_h -d "testh/"
a: a.o
./a.o
b: b.o
./b.o
c: c.o
./c.o
d: d.o
./d.o
e: e.o
./e.o
f: f.o
./f.o
g: g.o
./g.o
h: h.o
./h.o
atest: a.o
oj t -c "./a.o" -d "testa/"
btest: b.o
oj t -c "./b.o" -d "testb/"
ctest: c.o
oj t -c "./c.o" -d "testc/"
dtest: d.o
oj t -c "./d.o" -d "testd/"
etest: e.o
oj t -c "./e.o" -d "teste/"
ftest: f.o
oj t -c "./f.o" -d "testf/"
gtest: g.o
oj t -c "./g.o" -d "testg/"
htest: h.o
oj t -c "./h.o" -d "testh/"
aca: a.exe
./a.exe
acb: b.exe
./b.exe
acc: c.exe
./c.exe
acd: d.exe
./d.exe
ace: e.exe
./e.exe
acf: f.exe
./f.exe
acg: g.exe
./g.exe
ach: h.exe
./h.exe
setup:
cp template/test.cpp make_test.cpp
cp template/algorithm.cpp solver.cpp
cp template/algorithm.cpp judge.cpp
cp template/algorithm.cpp a.cpp
cp template/algorithm.cpp b.cpp
cp template/algorithm.cpp c.cpp
cp template/algorithm.cpp d.cpp
cp template/algorithm.cpp e.cpp
cp template/algorithm.cpp f.cpp
cp template/algorithm.cpp g.cpp
cp template/algorithm.cpp h.cpp
# for marathon
marathon:
cp template/test.cpp make_test.cpp
cp template/algorithm.cpp score_calc.cpp
cp template/marathon.cpp main.cpp
mv $$HOME/Downloads/tools ./tools
mkdir tools/out
# run one case
main: main.o
./main.o < tools/in/0000.txt > tools/out/0000.txt
cd tools && \
cargo run --release --bin vis in/0000.txt out/0000.txt && \
echo See the result from `pwd`/vis.html
# miscellaneous
clean:
rm -f *.o *.exe data_structure/*.out graph/*.out math/*.out other_algorithm/*.out string/*.out \
a.cpp b.cpp c.cpp d.cpp e.cpp f.cpp g.cpp h.cpp input.txt ans.txt output.txt make_test.cpp solver.cpp \
main.cpp score_calc.cpp main.o judge.cpp judge.o
rm -rf testa testb testc testd teste testf testg testh
.SECONDARY: make_test.o solver.o judge.o
.PHONY: test clean