From 97bb40e37b1c4b50695981cf77c295cc5d6bf1e2 Mon Sep 17 00:00:00 2001 From: sw1tchbl4d3 Date: Wed, 9 Feb 2022 19:37:43 +0100 Subject: [PATCH] Refactor Makefile These changes make rdo build on my rpi, probably because this specific GCC version requires arguments in the order we now supply. We also disable ASAN in the debug build (for now), as it seems to cause a segfault on my rpi. --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index eeac0f6..cdf66da 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,14 @@ +CFLAGS = -Wall -Wextra -Werror -Wl,-z,now -D_FORTIFY_SOURCE=2 +CFLAGS_RELEASE = ${CFLAGS} -O2 -s +CFLAGS_DEBUG = ${CFLAGS} -O0 -g -fsanitize=leak,undefined +LIBS = -lbsd -lcrypt +CC = gcc + all: rdo.c - gcc -D_FORTIFY_SOURCE=2 -O2 -s -Wl,-z,now -lcrypt -lbsd -Wall -Wextra -Werror rdo.c -o rdo + ${CC} ${CFLAGS_RELEASE} rdo.c -o rdo ${LIBS} debug: rdo.c - gcc -O0 -g -Wl,-z,now -fsanitize=leak,address,undefined -lcrypt -lbsd -Wall -Wextra -Werror rdo.c -o rdo + ${CC} ${CFLAGS_DEBUG} rdo.c -o rdo ${LIBS} install: rdo cp rdo /usr/bin/rdo