1 PREFIX ?= $(DESTDIR)/usr 2 LIBDIR ?= $(PREFIX)/lib 3 4 # Add your test source files here: 5 SOURCES = $(wildcard *.c) 6 7 # Add the required external object files here: 8 LIBS = ../src/libsemanage.a -L$(LIBDIR) -lselinux -lsepol 9 10 ########################################################################### 11 12 EXECUTABLE = libsemanage-tests 13 CFLAGS += -g -O0 -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter 14 INCLUDE = -I../src -I../include 15 LDFLAGS += -lcunit -lbz2 -laudit 16 OBJECTS = $(SOURCES:.c=.o) 17 18 all: $(EXECUTABLE) 19 20 $(EXECUTABLE): $(OBJECTS) ../src/libsemanage.a 21 $(CC) $(OBJECTS) $(LIBS) $(LDFLAGS) -o $@ 22 23 %.o: %.c 24 $(CC) $(CFLAGS) $(INCLUDE) -c $*.c -o $*.o 25 26 clean distclean: 27 rm -rf $(OBJECTS) $(EXECUTABLE) 28 29 test: all 30 ./$(EXECUTABLE) 31 32