platform_external_selinux/libsemanage/tests/Makefile
Jan Zarsky 638e2f9df0 libsemanage: add helper functions to tests
- Add functions for creating and destroying test semanage store.
- Add functions for writing SELinux policy to the test store.
- Add functions for creating semanage handle, connecting to the store and for
  beginning a transaction.
- Update Makefile to compile test policies from CIL source.

Signed-off-by: Jan Zarsky <jzarsky@redhat.com>
2019-06-19 09:01:48 -07:00

28 lines
755 B
Makefile

# Add your test source files here:
SOURCES = $(sort $(wildcard *.c))
CILS = $(sort $(wildcard *.cil))
###########################################################################
EXECUTABLE = libsemanage-tests
CFLAGS += -g -O0 -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter
override CFLAGS += -I../src -I../include
override LDLIBS += -lcunit -lbz2 -laudit -lselinux -lsepol
OBJECTS = $(SOURCES:.c=.o)
POLICIES = $(CILS:.cil=.policy)
all: $(EXECUTABLE) $(POLICIES)
$(EXECUTABLE): $(OBJECTS) ../src/libsemanage.a
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
%.policy: %.cil
../../secilc/secilc $*.cil -o $*.policy -f /dev/null
clean distclean:
rm -rf $(OBJECTS) $(POLICIES) $(EXECUTABLE)
test: all
./$(EXECUTABLE)