1# Installation directories. 2PREFIX ?= /usr 3SBINDIR ?= $(PREFIX)/sbin 4 5TARGETS=transcon untranscon 6 7# If no specific libsepol.a is specified, fall back on LDFLAGS search path 8# Otherwise, as $(LIBSEPOLA) already appears in the dependencies, there 9# is no need to define a value for LDLIBS_LIBSEPOLA 10ifeq ($(LIBSEPOLA),) 11 LDLIBS_LIBSEPOLA := -l:libsepol.a 12endif 13 14all: $(TARGETS) 15 16transcon: transcon.o ../src/mcstrans.o ../src/mls_level.o $(LIBSEPOLA) 17 $(CC) $(LDFLAGS) -o $@ $^ -lpcre -lselinux $(LDLIBS_LIBSEPOLA) 18 19untranscon: untranscon.o ../src/mcstrans.o ../src/mls_level.o $(LIBSEPOLA) 20 $(CC) $(LDFLAGS) -o $@ $^ -lpcre -lselinux $(LDLIBS_LIBSEPOLA) 21 22%.o: %.c 23 $(CC) $(CFLAGS) -D_GNU_SOURCE -I../src -fPIE -c -o $@ $< 24 25install: all 26 -mkdir -p $(DESTDIR)$(SBINDIR) 27 install -m 755 $(TARGETS) $(DESTDIR)$(SBINDIR) 28 29test: 30 ./mlstrans-test-runner.py ../test/*.test 31 32clean: 33 rm -f $(TARGETS) *.o *~ \#* 34 35relabel: 36 37