Piss poor attempt at AoC 2021 and I'm 3 years late publishing it :/
This commit is contained in:
parent
d24d9ea337
commit
72e26635ff
9 changed files with 2344 additions and 0 deletions
17
2021/Makefile
Normal file
17
2021/Makefile
Normal file
|
@ -0,0 +1,17 @@
|
|||
day%.out: out/types.o misc/main.cpp days/day%.cpp
|
||||
g++ -O3 -std=c++2a $(flags) -Dcurrent_day=$(@:.out=) days/$(@:out=cpp) misc/main.cpp out/types.o -o $@
|
||||
|
||||
day%_test.out: out/types.o misc/main_test.cpp days/day%.cpp
|
||||
g++ -O3 -std=c++2a $(flags) -DTEST_BUILD -Dcurrent_day=$(@:_test.out=) days/$(@:_test.out=.cpp) misc/main_test.cpp out/types.o -o $@
|
||||
|
||||
days/day%.cpp:
|
||||
cp 'misc/day.cpp.template' $@
|
||||
sed -i -e "s/current_day/$(shell basename $@ | cut -f 1 -d '.')/g" $@
|
||||
|
||||
out/types.o: misc/types.hpp misc/types.cpp
|
||||
mkdir -p out/
|
||||
g++ -std=c++2a $(flags) -c misc/types.cpp -o $@
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f out/* day*.out day*.output
|
Loading…
Add table
Add a link
Reference in a new issue