2008-08-19 19:30:36 +00:00
|
|
|
# Installation directories.
|
|
|
|
PREFIX ?= ${DESTDIR}/usr
|
|
|
|
SBINDIR ?= $(DESTDIR)/sbin
|
|
|
|
MANDIR = $(PREFIX)/share/man
|
|
|
|
LIBDIR ?= $(PREFIX)/lib
|
|
|
|
AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
|
|
|
|
|
2009-09-10 18:54:35 +00:00
|
|
|
CFLAGS = -g -Werror -Wall -W
|
2009-07-06 13:49:39 +00:00
|
|
|
override CFLAGS += -I$(PREFIX)/include
|
2008-08-19 19:30:36 +00:00
|
|
|
LDLIBS = -lselinux -lsepol -L$(LIBDIR)
|
|
|
|
|
|
|
|
ifeq (${AUDITH}, /usr/include/libaudit.h)
|
|
|
|
override CFLAGS += -DUSE_AUDIT
|
|
|
|
LDLIBS += -laudit
|
|
|
|
endif
|
|
|
|
|
|
|
|
all: setfiles restorecon
|
|
|
|
|
2009-09-10 18:54:35 +00:00
|
|
|
setfiles: setfiles.o restore.o
|
2008-08-19 19:30:36 +00:00
|
|
|
|
|
|
|
restorecon: setfiles
|
|
|
|
ln -sf setfiles restorecon
|
|
|
|
|
|
|
|
install: all
|
|
|
|
[ -d $(MANDIR)/man8 ] || mkdir -p $(MANDIR)/man8
|
|
|
|
-mkdir -p $(SBINDIR)
|
|
|
|
install -m 755 setfiles $(SBINDIR)
|
|
|
|
(cd $(SBINDIR) && ln -sf setfiles restorecon)
|
|
|
|
install -m 644 setfiles.8 restorecon.8 $(MANDIR)/man8
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f setfiles restorecon *.o
|
|
|
|
|
|
|
|
indent:
|
|
|
|
../../scripts/Lindent $(wildcard *.[ch])
|
|
|
|
|
|
|
|
relabel: install
|
|
|
|
/sbin/restorecon $(SBINDIR)/setfiles
|