diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-12-06 18:43:40 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-12-06 18:43:40 +0100 |
commit | 4225b181d04ee82ae8365a6303fe0adf916308f7 (patch) | |
tree | 4fd20ed3fa09d4964f2a0cccd4045417d41e8881 /Makefiles/c.mk | |
parent | d1b4d95b6f4be5115843752a522eb3ddd77b12a8 (diff) |
Update Makefiles
Diffstat (limited to 'Makefiles/c.mk')
-rw-r--r-- | Makefiles/c.mk | 26 |
1 files changed, 14 insertions, 12 deletions
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 |