CC=cc CFLAGS=-static --std=c2x -O3 -Wall -Werror -Wextra -pedantic EXES = $(wildcard day*) all: create_bin_dir $(EXES) create_bin_dir: @mkdir -p bin day1: day1/p1.c day1/p2.c ${CC} ${CFLAGS} $@/p1.c -o bin/$@p1 ${CC} ${CFLAGS} $@/p2.c -o bin/$@p2 day2: day2/p1.c day2/p2.c ${CC} ${CFLAGS} $@/p1.c -o bin/$@p1 ${CC} ${CFLAGS} $@/p2.c -o bin/$@p2 clean: rm -f bin/day*p*