@@ -11,9 +11,9 @@ LIBS = ../src/libsemanage.a ../../libselinux/src/libselinux.a ../../libsepol/src
EXECUTABLE = libsemanage-tests
CC = gcc
-CFLAGS = -c -g -O0 -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter
+CFLAGS += -g -O0 -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter
INCLUDE = -I$(TESTSRC) -I$(TESTSRC)/../include
-LDFLAGS = -lcunit -lustr -lbz2 -laudit
+LDFLAGS += -lcunit -lustr -lbz2 -laudit
OBJECTS = $(SOURCES:.c=.o)
all: $(EXECUTABLE)
@@ -22,7 +22,7 @@ $(EXECUTABLE): $(OBJECTS)
$(CC) $(OBJECTS) $(LIBS) $(LDFLAGS) -o $@
%.o: %.c
- $(CC) $(CFLAGS) $(INCLUDE) $*.c -o $*.o
+ $(CC) $(CFLAGS) $(INCLUDE) -c $*.c -o $*.o
clean distclean:
rm -rf $(OBJECTS) $(EXECUTABLE)
libsemanage/tests/Makefile currently overwrites CFLAGS and LDFLAGS contents. This makes building with custom flags (e.g. with address sanitizer) harder. Append flags to these variables instead. Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org> --- libsemanage/tests/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)