Home | History | Annotate | Download | only in utils
      1 # Installation directories.
      2 PREFIX ?= /usr
      3 SBINDIR ?= $(PREFIX)/sbin
      4 
      5 TARGETS=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
     10 ifeq ($(LIBSEPOLA),)
     11         LDLIBS_LIBSEPOLA := -l:libsepol.a
     12 endif
     13 
     14 all: $(TARGETS)
     15 
     16 transcon: transcon.o ../src/mcstrans.o ../src/mls_level.o $(LIBSEPOLA)
     17 	$(CC) $(LDFLAGS) -o $@ $^ -lpcre -lselinux $(LDLIBS_LIBSEPOLA)
     18 
     19 untranscon: 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 
     25 install: all
     26 	-mkdir -p $(DESTDIR)$(SBINDIR)
     27 	install -m 755 $(TARGETS) $(DESTDIR)$(SBINDIR)
     28 
     29 test:
     30 	./mlstrans-test-runner.py ../test/*.test
     31 
     32 clean:
     33 	rm -f $(TARGETS) *.o *~ \#*
     34 
     35 relabel:
     36 
     37