aboutsummaryrefslogtreecommitdiff
path: root/Makefiles/c.mk
diff options
context:
space:
mode:
Diffstat (limited to 'Makefiles/c.mk')
-rw-r--r--Makefiles/c.mk19
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]