From 4742dd73046c53cff7fe54deee58358c3b193206 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 30 Nov 2022 12:23:04 +0100 Subject: Add default Makefiles --- Makefiles/c.mk | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Makefiles/c.mk (limited to 'Makefiles/c.mk') 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] -- cgit v1.2.3