Home | History | Annotate | Download | only in tests
      1 # Add your test source files here:
      2 SOURCES = $(wildcard *.c)
      3 
      4 # Point this variable to the libsemanage source directory you want to test:
      5 TESTSRC=../src
      6 
      7 # Add the required external object files here:
      8 LIBS = ../src/libsemanage.a ../../libselinux/src/libselinux.a ../../libsepol/src/libsepol.a
      9 
     10 ###########################################################################
     11 
     12 EXECUTABLE = libsemanage-tests
     13 CC = gcc
     14 CFLAGS = -c -g -O0 -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter
     15 INCLUDE = -I$(TESTSRC) -I$(TESTSRC)/../include
     16 LDFLAGS = -lcunit -lustr -lbz2 -laudit
     17 OBJECTS = $(SOURCES:.c=.o) 
     18 
     19 all: $(EXECUTABLE) 
     20 
     21 $(EXECUTABLE): $(OBJECTS) 
     22 	$(CC) $(OBJECTS) $(LIBS) $(LDFLAGS) -o $@
     23 
     24 %.o: %.c
     25 	$(CC) $(CFLAGS) $(INCLUDE) $*.c -o $*.o
     26 
     27 clean distclean: 
     28 	rm -rf $(OBJECTS) $(EXECUTABLE)
     29 
     30 test: all 
     31 	./$(EXECUTABLE)
     32 
     33