advent_of_code/2020/Makefile

18 lines
632 B
Makefile
Raw Normal View History

2020-12-11 17:24:22 +00:00
day%.out: out/types.o misc/main.cpp days/day%.cpp
g++-10 -std=c++2a $(flags) -Dcurrent_day=$(@:.out=) days/$(@:out=cpp) misc/main.cpp out/types.o -o $@
2020-12-03 06:03:52 +00:00
2020-12-11 17:24:22 +00:00
day%_test.out: out/types.o misc/main_test.cpp days/day%.cpp
g++-10 -std=c++2a $(flags) -DTEST_BUILD -Dcurrent_day=$(@:_test.out=) days/$(@:_test.out=.cpp) misc/main_test.cpp out/types.o -o $@
2020-12-11 17:24:22 +00:00
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
2020-12-01 08:00:04 +00:00
mkdir -p out/
2020-12-11 17:24:22 +00:00
g++-10 -std=c++2a $(flags) -c misc/types.cpp -o $@
2020-12-01 08:00:04 +00:00
.PHONY: clean
clean:
2020-12-11 17:29:57 +00:00
rm -f out/* day*.out day*.output