1
0
Fork 0
forked from soccera/rdo

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.
This commit is contained in:
sw1tchbl4d3 2022-02-09 19:37:43 +01:00
parent 1bc833693b
commit 97bb40e37b

View file

@ -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