Petr Lautrbach | 1952be6 | 2019-02-18 17:27:44 +0100 | [diff] [blame] | 1 | PYTHON ?= python3 |
Nicolas Iooss | 4ac069a | 2019-01-05 20:37:56 +0100 | [diff] [blame] | 2 | SECILC ?= secilc |
Nicolas Iooss | e4d693a | 2014-09-10 21:01:28 +0200 | [diff] [blame] | 3 | |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 4 | # Installation directories. |
Aleksei Nikiforov | 0445e65 | 2018-12-25 18:25:05 +0300 | [diff] [blame] | 5 | LINGUAS ?= ru |
Marcus Folkesson | 11aaf18 | 2018-02-14 10:57:10 +0100 | [diff] [blame] | 6 | PREFIX ?= /usr |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 7 | BINDIR ?= $(PREFIX)/bin |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 8 | MANDIR ?= $(PREFIX)/share/man |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 9 | |
Stephen Smalley | b97d959 | 2016-11-02 09:52:29 -0400 | [diff] [blame] | 10 | CFLAGS ?= -Werror -Wall -W |
Stephen Smalley | b97d959 | 2016-11-02 09:52:29 -0400 | [diff] [blame] | 11 | |
Marcus Folkesson | 11aaf18 | 2018-02-14 10:57:10 +0100 | [diff] [blame] | 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 | |
Stephen Smalley | b97d959 | 2016-11-02 09:52:29 -0400 | [diff] [blame] | 19 | all: audit2why sepolgen-ifgen-attr-helper |
| 20 | |
Nicolas Iooss | dcd135c | 2017-01-14 15:38:25 +0100 | [diff] [blame] | 21 | sepolgen-ifgen-attr-helper: sepolgen-ifgen-attr-helper.o $(LIBSEPOLA) |
Marcus Folkesson | 11aaf18 | 2018-02-14 10:57:10 +0100 | [diff] [blame] | 22 | $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS_LIBSEPOLA) |
Dan Walsh | ae1cedb | 2013-10-09 17:19:30 -0400 | [diff] [blame] | 23 | |
| 24 | audit2why: |
| 25 | ln -sf audit2allow audit2why |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 26 | |
Nicolas Iooss | 4ac069a | 2019-01-05 20:37:56 +0100 | [diff] [blame] | 27 | test: all test_dummy_policy |
Dan Walsh | e27d51b | 2013-10-31 10:53:58 -0400 | [diff] [blame] | 28 | @$(PYTHON) test_audit2allow.py -v |
| 29 | |
Nicolas Iooss | 4ac069a | 2019-01-05 20:37:56 +0100 | [diff] [blame] | 30 | test_dummy_policy: test_dummy_policy.cil |
| 31 | $(SECILC) -o $@ -f /dev/null $< |
| 32 | |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 33 | install: all |
Marcus Folkesson | 11aaf18 | 2018-02-14 10:57:10 +0100 | [diff] [blame] | 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/ |
Aleksei Nikiforov | 0445e65 | 2018-12-25 18:25:05 +0300 | [diff] [blame] | 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 |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 48 | |
| 49 | clean: |
Nicolas Iooss | 4ac069a | 2019-01-05 20:37:56 +0100 | [diff] [blame] | 50 | rm -f *~ *.o sepolgen-ifgen-attr-helper test_dummy_policy |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 51 | |
Stephen Smalley | b97d959 | 2016-11-02 09:52:29 -0400 | [diff] [blame] | 52 | indent: |
| 53 | ../../scripts/Lindent $(wildcard *.[ch]) |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 54 | |
| 55 | relabel: ; |