# Makefile # # Targets: # # build: builds all C executables # # run: runs all found solutions for $DAY # (default all, example: make DAY=1 run) # # clean: removes all C executables CFLAGS = -g -O2 -Wall -Wpedantic -Wextra DAY = * TARGETS = 01/a 01/b \ 02/a 02/b \ 03/a \ 05/a 05/b \ 06/a 06/b .PHONY: build build: $(TARGETS) .PHONY: run run: build @for d in $(DAY)/; do \ for sol in a.py a b.py b; do \ [ -e $$d/$$sol ] && printf "%-9s" "$${d}$$sol: " && $$d/$$sol < $$d/input || true; \ done; \ done .PHONY: clean clean: rm -f $(TARGETS) %: %.c $(CC) $(CFLAGS) -o $@ $<