aboutsummaryrefslogtreecommitdiffstats
path: root/libsemanage/tests/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'libsemanage/tests/Makefile')
-rw-r--r--libsemanage/tests/Makefile32
1 files changed, 32 insertions, 0 deletions
diff --git a/libsemanage/tests/Makefile b/libsemanage/tests/Makefile
new file mode 100644
index 00000000..3e93f50d
--- /dev/null
+++ b/libsemanage/tests/Makefile
@@ -0,0 +1,32 @@
+# Add your test source files here:
+SOURCES = $(wildcard *.c)
+
+# Point this variable to the libsemanage source directory you want to test:
+TESTSRC=../src
+
+# Add the required external object files here:
+LIBS = ../src/libsemanage.a ../../libselinux/src/libselinux.a ../../libsepol/src/libsepol.a
+
+###########################################################################
+
+EXECUTABLE = libsemanage-tests
+CC = gcc
+CFLAGS = -c -g -o0 -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter
+INCLUDE = -I$(TESTSRC) -I$(TESTSRC)/../include/semanage
+LDFLAGS = -lcunit -lustr
+OBJECTS = $(SOURCES:.c=.o)
+
+all: $(EXECUTABLE)
+
+$(EXECUTABLE): $(OBJECTS)
+ $(CC) $(OBJECTS) $(LIBS) $(LDFLAGS) -o $@
+
+%.o: %.c
+ $(CC) $(CFLAGS) $(INCLUDE) $*.c -o $*.o
+
+clean distclean:
+ rm -rf $(OBJECTS) $(EXECUTABLE)
+
+test: all
+ ./$(EXECUTABLE)
+