Makefile 2.75 KB
Newer Older
1
# 	$Id$
2
# ----------------------------------------------------------------------
3 4
#    Copyright (c) 1999, 2004-2009 NOVELL (All rights reserved)
#    Copyright (c) 2010 Canonical Ltd.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#
#    This program is free software; you can redistribute it and/or
#    modify it under the terms of version 2 of the GNU General Public
#    License published by the Free Software Foundation.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, contact Novell, Inc.
# ----------------------------------------------------------------------
NAME 		= apparmor-utils
all:
20
COMMONDIR=../common/
21

22
include common/Make.rules
23 24 25

COMMONDIR_EXISTS=$(strip $(shell [ -d ${COMMONDIR} ] && echo true))
ifeq ($(COMMONDIR_EXISTS), true)
26 27
common/Make.rules: $(COMMONDIR)/Make.rules
	ln -sf $(COMMONDIR) .
28 29 30
endif

TOOLS = genprof logprof autodep audit complain enforce \
31 32
	unconfined aa-eventd apparmor_status aa-decode \
	apparmor_notify
33

34
AA_MANPAGES = autodep.8 complain.8 enforce.8 logprof.8 genprof.8 unconfined.8 audit.8
35
MANPAGES    = ${AA_MANPAGES} logprof.conf.5 apparmor_status.8 aa-decode.8 apparmor_notify.8
36 37

all: ${MANPAGES} ${HTMLMANPAGES}
38 39
	make -C po all

40 41 42 43 44 45 46
# need some better way of determining this
DESTDIR=/
BINDIR=${DESTDIR}/usr/sbin
CONFDIR=${DESTDIR}/etc/apparmor
PERLDIR=${DESTDIR}/usr/lib/perl5/vendor_perl/Immunix

po/${NAME}.pot: ${TOOLS}
47
	make -C po ${NAME}.pot NAME=${NAME} SOURCES="${TOOLS} SubDomain.pm Repository.pm Config.pm Reports.pm"
48 49

.PHONY: install
50
install: ${MANPAGES} ${HTMLMANPAGES}
51
	install -d ${CONFDIR}
52
	install -m 644 logprof.conf severity.db notify.conf ${CONFDIR}
53 54 55 56 57 58 59 60 61
	install -d ${BINDIR}
	ln -sf apparmor_status ${BINDIR}/aa-status
	ln -sf audit ${BINDIR}/aa-audit
	ln -sf autodep ${BINDIR}/aa-autodep
	ln -sf complain ${BINDIR}/aa-complain
	ln -sf enforce ${BINDIR}/aa-enforce
	ln -sf genprof ${BINDIR}/aa-genprof
	ln -sf logprof ${BINDIR}/aa-logprof
	ln -sf unconfined ${BINDIR}/aa-unconfined
62
	ln -sf apparmor_notify ${BINDIR}/aa-notify
63 64
	install -m 755 ${TOOLS} ${BINDIR}
	install -d ${PERLDIR}
65
	install -m 755 SubDomain.pm Repository.pm Config.pm Reports.pm Severity.pm ${PERLDIR}
66 67
	make -C po install DESTDIR=${DESTDIR} NAME=${NAME}
	mkdir -m 0700 -p $(DESTDIR)/var/log/apparmor
68 69 70
	make install_manpages DESTDIR=${DESTDIR}
	# special case for apparmor_status
	ln -sf apparmor_status.8 ${DESTDIR}/${MANDIR}/man8/aa-status.8
71 72
	ln -sf apparmor_notify.8 ${DESTDIR}/${MANDIR}/man8/aa-notify.8

73
.PHONY: clean
74 75
.SILENT: clean
clean: _clean
76
	rm -f core core.* *.o *.s *.a *~
77
	rm -f Make.rules
78 79
	make -C po clean