2014-09-10 19:01:28 +00:00
|
|
|
PYTHON ?= python
|
2019-01-05 19:37:56 +00:00
|
|
|
SECILC ?= secilc
|
2014-09-10 19:01:28 +00:00
|
|
|
|
2008-08-19 19:30:36 +00:00
|
|
|
# Installation directories.
|
2018-02-14 09:57:10 +00:00
|
|
|
PREFIX ?= /usr
|
2008-08-19 19:30:36 +00:00
|
|
|
BINDIR ?= $(PREFIX)/bin
|
|
|
|
MANDIR ?= $(PREFIX)/share/man
|
|
|
|
|
2016-11-02 13:52:29 +00:00
|
|
|
CFLAGS ?= -Werror -Wall -W
|
|
|
|
|
2018-02-14 09:57:10 +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
|
|
|
|
|
2016-11-02 13:52:29 +00:00
|
|
|
all: audit2why sepolgen-ifgen-attr-helper
|
|
|
|
|
2017-01-14 14:38:25 +00:00
|
|
|
sepolgen-ifgen-attr-helper: sepolgen-ifgen-attr-helper.o $(LIBSEPOLA)
|
2018-02-14 09:57:10 +00:00
|
|
|
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS_LIBSEPOLA)
|
2013-10-09 21:19:30 +00:00
|
|
|
|
|
|
|
audit2why:
|
|
|
|
ln -sf audit2allow audit2why
|
2008-08-19 19:30:36 +00:00
|
|
|
|
2019-01-05 19:37:56 +00:00
|
|
|
test: all test_dummy_policy
|
2013-10-31 14:53:58 +00:00
|
|
|
@$(PYTHON) test_audit2allow.py -v
|
|
|
|
|
2019-01-05 19:37:56 +00:00
|
|
|
test_dummy_policy: test_dummy_policy.cil
|
|
|
|
$(SECILC) -o $@ -f /dev/null $<
|
|
|
|
|
2008-08-19 19:30:36 +00:00
|
|
|
install: all
|
2018-02-14 09:57:10 +00:00
|
|
|
-mkdir -p $(DESTDIR)$(BINDIR)
|
|
|
|
install -m 755 audit2allow $(DESTDIR)$(BINDIR)
|
|
|
|
(cd $(DESTDIR)$(BINDIR); ln -sf audit2allow audit2why)
|
|
|
|
install -m 755 sepolgen-ifgen-attr-helper $(DESTDIR)$(BINDIR)
|
|
|
|
install -m 755 sepolgen-ifgen $(DESTDIR)$(BINDIR)
|
|
|
|
-mkdir -p $(DESTDIR)$(MANDIR)/man1
|
|
|
|
install -m 644 audit2allow.1 $(DESTDIR)$(MANDIR)/man1/
|
|
|
|
install -m 644 audit2why.1 $(DESTDIR)$(MANDIR)/man1/
|
2008-08-19 19:30:36 +00:00
|
|
|
|
|
|
|
clean:
|
2019-01-05 19:37:56 +00:00
|
|
|
rm -f *~ *.o sepolgen-ifgen-attr-helper test_dummy_policy
|
2008-08-19 19:30:36 +00:00
|
|
|
|
2016-11-02 13:52:29 +00:00
|
|
|
indent:
|
|
|
|
../../scripts/Lindent $(wildcard *.[ch])
|
2008-08-19 19:30:36 +00:00
|
|
|
|
|
|
|
relabel: ;
|