Home | History | Annotate | Download | only in audit2allow
      1 PYTHON ?= python3
      2 SECILC ?= secilc
      3 
      4 # Installation directories.
      5 LINGUAS ?= ru
      6 PREFIX ?= /usr
      7 BINDIR ?= $(PREFIX)/bin
      8 MANDIR ?= $(PREFIX)/share/man
      9 
     10 CFLAGS ?= -Werror -Wall -W
     11 
     12 # If no specific libsepol.a is specified, fall back on LDFLAGS search path
     13 # Otherwise, as $(LIBSEPOLA) already appears in the dependencies, there
     14 # is no need to define a value for LDLIBS_LIBSEPOLA
     15 ifeq ($(LIBSEPOLA),)
     16         LDLIBS_LIBSEPOLA := -l:libsepol.a
     17 endif
     18 
     19 all: audit2why sepolgen-ifgen-attr-helper
     20 
     21 sepolgen-ifgen-attr-helper: sepolgen-ifgen-attr-helper.o $(LIBSEPOLA)
     22 	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS_LIBSEPOLA)
     23 
     24 audit2why:
     25 	ln -sf audit2allow audit2why
     26 
     27 test: all test_dummy_policy
     28 	@$(PYTHON) test_audit2allow.py -v
     29 
     30 test_dummy_policy: test_dummy_policy.cil
     31 	$(SECILC) -o $@ -f /dev/null $<
     32 
     33 install: all
     34 	-mkdir -p $(DESTDIR)$(BINDIR)
     35 	install -m 755 audit2allow $(DESTDIR)$(BINDIR)
     36 	(cd $(DESTDIR)$(BINDIR); ln -sf audit2allow audit2why)
     37 	install -m 755 sepolgen-ifgen-attr-helper $(DESTDIR)$(BINDIR)
     38 	install -m 755 sepolgen-ifgen $(DESTDIR)$(BINDIR)
     39 	-mkdir -p $(DESTDIR)$(MANDIR)/man1
     40 	install -m 644 audit2allow.1 $(DESTDIR)$(MANDIR)/man1/
     41 	install -m 644 audit2why.1 $(DESTDIR)$(MANDIR)/man1/
     42 	for lang in $(LINGUAS) ; do \
     43 		if [ -e $${lang} ] ; then \
     44 			mkdir -p $(DESTDIR)$(MANDIR)/$${lang}/man1 ; \
     45 			install -m 644 $${lang}/*.1 $(DESTDIR)$(MANDIR)/$${lang}/man1/ ; \
     46 		fi ; \
     47 	done
     48 
     49 clean:
     50 	rm -f *~ *.o sepolgen-ifgen-attr-helper test_dummy_policy
     51 
     52 indent:
     53 	../../scripts/Lindent $(wildcard *.[ch])
     54 
     55 relabel: ;
     56