mirror of
https://github.com/SELinuxProject/selinux
synced 2024-12-22 14:02:17 +00:00
638e2f9df0
- 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>
29 lines
755 B
Makefile
29 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)
|
|
|