aboutsummaryrefslogtreecommitdiff
path: root/Makefiles/c.mk
blob: d4af73098e4aa8d419b265db294947650c50d403 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
.POSIX:

CC     = cc
CFLAGS = -Wall -Wextra -Wpedantic -Werror      \
	 -march=native -mtune=native -O3 -flto \
	 -pipe

ALL    = ${CC} ${CFLAGS} ${CPPFLAGS} ${LDLIBS} ${LDFLAGS}

all:
	[ -f puzzles.c ] && {                         \
		${ALL} -DPART1 -o puzzle-1 puzzles.c; \
		${ALL} -DPART2 -o puzzle-2 puzzles.c; \
	}
	[ -f puzzle-1.c ] && ${ALL} -o puzzle-1 puzzle-1.c || true
	[ -f puzzle-2.c ] && ${ALL} -o puzzle-2 puzzle-2.c || true

clean:
	rm -f puzzle-[12]