mirror of
https://github.com/SELinuxProject/selinux
synced 2025-01-29 16:52:45 +00:00
c18ea1df62
when building packages (e.g. for openSUSE Linux) (random) filesystem order of input files influences ordering of functions in the output, thus without the patch, builds (in disposable VMs) would usually differ. See https://reproducible-builds.org/ for why this matters.
32 lines
774 B
Makefile
32 lines
774 B
Makefile
PREFIX ?= $(DESTDIR)/usr
|
|
LIBDIR ?= $(PREFIX)/lib
|
|
|
|
# Add your test source files here:
|
|
SOURCES = $(sort $(wildcard *.c))
|
|
|
|
# Add the required external object files here:
|
|
LIBS = ../src/libsemanage.a -lselinux -lsepol
|
|
|
|
###########################################################################
|
|
|
|
EXECUTABLE = libsemanage-tests
|
|
CFLAGS += -g -O0 -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter
|
|
INCLUDE = -I../src -I../include
|
|
LDLIBS += -lcunit -lbz2 -laudit
|
|
OBJECTS = $(SOURCES:.c=.o)
|
|
|
|
all: $(EXECUTABLE)
|
|
|
|
$(EXECUTABLE): $(OBJECTS) ../src/libsemanage.a
|
|
$(CC) $(OBJECTS) $(LIBS) $(LDFLAGS) -o $@ $(LDLIBS)
|
|
|
|
%.o: %.c
|
|
$(CC) $(CFLAGS) $(INCLUDE) -c $*.c -o $*.o
|
|
|
|
clean distclean:
|
|
rm -rf $(OBJECTS) $(EXECUTABLE)
|
|
|
|
test: all
|
|
./$(EXECUTABLE)
|
|
|