diff options
author | Thomas Voss <mail@thomasvoss.com> | 2022-11-30 12:23:04 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2022-11-30 12:23:04 +0100 |
commit | 4742dd73046c53cff7fe54deee58358c3b193206 (patch) | |
tree | a0622b3cac84df4da90f753ebef8e160adefb25d /Makefiles/c.mk | |
parent | 809b649d862cbfee004c9c87bb0c9ad7475412e1 (diff) |
Add default Makefiles
Diffstat (limited to 'Makefiles/c.mk')
-rw-r--r-- | Makefiles/c.mk | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Makefiles/c.mk b/Makefiles/c.mk new file mode 100644 index 0000000..d4af730 --- /dev/null +++ b/Makefiles/c.mk @@ -0,0 +1,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] |