From 4225b181d04ee82ae8365a6303fe0adf916308f7 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 6 Dec 2024 18:43:40 +0100 Subject: Update Makefiles --- Makefiles/c.mk | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'Makefiles/c.mk') diff --git a/Makefiles/c.mk b/Makefiles/c.mk index d4af730..e890ad0 100644 --- a/Makefiles/c.mk +++ b/Makefiles/c.mk @@ -1,19 +1,21 @@ .POSIX: -CC = cc -CFLAGS = -Wall -Wextra -Wpedantic -Werror \ - -march=native -mtune=native -O3 -flto \ - -pipe +CC = cc +CFLAGS = \ + -Wall -Wextra -Wpedantic -Werror \ + -march=native -mtune=native -O3 -flto \ + -pipe -ALL = ${CC} ${CFLAGS} ${CPPFLAGS} ${LDLIBS} ${LDFLAGS} +ALL = ${CC} ${CFLAGS} ${CPPFLAGS} ${LDLIBS} 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 + if [ -f puzzles.c ]; \ + then \ + ${ALL} -DPART1=1 -o puzzle-1 puzzles.c; \ + ${ALL} -DPART2=1 -o puzzle-2 puzzles.c; \ + fi + if [ -f puzzle-1.c ]; then ${ALL} -o puzzle-1 puzzle-1.c; fi + if [ -f puzzle-2.c ]; then ${ALL} -o puzzle-2 puzzle-2.c; fi clean: - rm -f puzzle-[12] + rm -f puzzle-[12] \ No newline at end of file -- cgit v1.2.3