diff options
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 |