1PYTHON ?= python 2 3# Installation directories. 4PREFIX ?= $(DESTDIR)/usr 5LIBDIR ?= $(PREFIX)/lib 6SBINDIR ?= $(PREFIX)/sbin 7MANDIR = $(PREFIX)/share/man 8PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig import *; print(get_python_lib(1))") 9PACKAGEDIR ?= $(DESTDIR)/$(PYTHONLIBDIR) 10BASHCOMPLETIONDIR ?= $(DESTDIR)/usr/share/bash-completion/completions 11 12TARGETS=semanage 13 14BASHCOMPLETIONS=semanage-bash-completion.sh 15 16all: $(TARGETS) 17 18install: all 19 [ -d $(MANDIR)/man8 ] || mkdir -p $(MANDIR)/man8 20 -mkdir -p $(SBINDIR) 21 install -m 755 semanage $(SBINDIR) 22 install -m 644 *.8 $(MANDIR)/man8 23 test -d $(PACKAGEDIR) || install -m 755 -d $(PACKAGEDIR) 24 install -m 755 seobject.py $(PACKAGEDIR) 25 -mkdir -p $(BASHCOMPLETIONDIR) 26 install -m 644 $(BASHCOMPLETIONS) $(BASHCOMPLETIONDIR)/semanage 27 28test: 29 @$(PYTHON) test-semanage.py -a 30clean: 31 32indent: 33 34relabel: 35