2010-07-21 19:40:00 +00:00
|
|
|
# Installation directories.
|
2018-02-14 09:57:08 +00:00
|
|
|
PREFIX ?= /usr
|
2017-06-20 14:49:57 +00:00
|
|
|
SBINDIR ?= $(PREFIX)/sbin
|
2010-07-21 19:40:00 +00:00
|
|
|
|
2018-02-14 09:57:08 +00:00
|
|
|
TARGETS=transcon untranscon
|
2010-07-21 19:40:00 +00:00
|
|
|
|
2018-02-14 09:57:08 +00:00
|
|
|
# If no specific libsepol.a is specified, fall back on LDFLAGS search path
|
|
|
|
# Otherwise, as $(LIBSEPOLA) already appears in the dependencies, there
|
|
|
|
# is no need to define a value for LDLIBS_LIBSEPOLA
|
|
|
|
ifeq ($(LIBSEPOLA),)
|
|
|
|
LDLIBS_LIBSEPOLA := -l:libsepol.a
|
|
|
|
endif
|
2010-07-21 19:40:00 +00:00
|
|
|
|
2017-01-14 14:38:25 +00:00
|
|
|
all: $(TARGETS)
|
|
|
|
|
2018-02-14 09:57:08 +00:00
|
|
|
transcon: transcon.o ../src/mcstrans.o ../src/mls_level.o $(LIBSEPOLA)
|
|
|
|
$(CC) $(LDFLAGS) -o $@ $^ -lpcre -lselinux $(LDLIBS_LIBSEPOLA)
|
|
|
|
|
|
|
|
untranscon: untranscon.o ../src/mcstrans.o ../src/mls_level.o $(LIBSEPOLA)
|
|
|
|
$(CC) $(LDFLAGS) -o $@ $^ -lpcre -lselinux $(LDLIBS_LIBSEPOLA)
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) -D_GNU_SOURCE -I../src -fPIE -c -o $@ $<
|
2010-07-21 19:40:00 +00:00
|
|
|
|
|
|
|
install: all
|
2018-02-14 09:57:08 +00:00
|
|
|
-mkdir -p $(DESTDIR)$(SBINDIR)
|
|
|
|
install -m 755 $(TARGETS) $(DESTDIR)$(SBINDIR)
|
2010-07-21 19:40:00 +00:00
|
|
|
|
|
|
|
test:
|
|
|
|
./mlstrans-test-runner.py ../test/*.test
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(TARGETS) *.o *~ \#*
|
|
|
|
|
|
|
|
relabel:
|
|
|
|
|