2008-08-19 19:30:36 +00:00
|
|
|
|
|
|
|
# Installation directories.
|
2018-12-25 15:25:05 +00:00
|
|
|
LINGUAS ?= ru
|
2018-02-14 09:57:09 +00:00
|
|
|
PREFIX ?= /usr
|
2008-08-19 19:30:36 +00:00
|
|
|
SBINDIR ?= $(PREFIX)/sbin
|
|
|
|
MANDIR ?= $(PREFIX)/share/man
|
2018-02-14 09:57:09 +00:00
|
|
|
ETCDIR ?= /etc
|
|
|
|
LOCALEDIR ?= $(DESTDIR)$(PREFIX)/share/locale
|
2017-04-24 17:59:59 +00:00
|
|
|
PAMH ?= $(shell test -f /usr/include/security/pam_appl.h && echo y)
|
|
|
|
AUDITH ?= $(shell test -f /usr/include/libaudit.h && echo y)
|
2008-08-19 19:30:36 +00:00
|
|
|
|
|
|
|
CFLAGS ?= -Werror -Wall -W
|
2017-04-24 17:59:56 +00:00
|
|
|
override CFLAGS += -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
|
2017-06-20 15:16:41 +00:00
|
|
|
override LDLIBS += -lselinux
|
2017-04-24 17:59:59 +00:00
|
|
|
ifeq ($(PAMH), y)
|
2008-08-19 19:30:36 +00:00
|
|
|
override CFLAGS += -DUSE_PAM
|
2017-06-20 15:16:41 +00:00
|
|
|
override LDLIBS += -lpam -lpam_misc
|
2008-08-19 19:30:36 +00:00
|
|
|
else
|
|
|
|
override CFLAGS += -D_XOPEN_SOURCE=500
|
2017-06-20 15:16:41 +00:00
|
|
|
override LDLIBS += -lcrypt
|
2008-08-19 19:30:36 +00:00
|
|
|
endif
|
2017-04-24 17:59:59 +00:00
|
|
|
ifeq ($(AUDITH), y)
|
2008-08-19 19:30:36 +00:00
|
|
|
override CFLAGS += -DUSE_AUDIT
|
2017-06-20 15:16:41 +00:00
|
|
|
override LDLIBS += -laudit
|
2008-08-19 19:30:36 +00:00
|
|
|
endif
|
|
|
|
|
2017-05-30 14:21:32 +00:00
|
|
|
TARGETS=$(patsubst %.c,%,$(sort $(wildcard *.c)))
|
2008-08-19 19:30:36 +00:00
|
|
|
|
|
|
|
all: $(TARGETS)
|
|
|
|
|
|
|
|
open_init_pty: open_init_pty.c
|
|
|
|
$(LINK.c) $^ -ldl -lutil -o $@
|
|
|
|
|
|
|
|
|
|
|
|
install: all
|
2018-02-14 09:57:09 +00:00
|
|
|
test -d $(DESTDIR)$(SBINDIR) || install -m 755 -d $(DESTDIR)$(SBINDIR)
|
|
|
|
test -d $(DESTDIR)$(MANDIR)/man8 || install -m 755 -d $(DESTDIR)$(MANDIR)/man8
|
|
|
|
install -m 755 run_init $(DESTDIR)$(SBINDIR)
|
|
|
|
install -m 755 open_init_pty $(DESTDIR)$(SBINDIR)
|
|
|
|
install -m 644 run_init.8 $(DESTDIR)$(MANDIR)/man8/
|
|
|
|
install -m 644 open_init_pty.8 $(DESTDIR)$(MANDIR)/man8/
|
2018-12-25 15:25:05 +00:00
|
|
|
for lang in $(LINGUAS) ; do \
|
|
|
|
if [ -e $${lang} ] ; then \
|
|
|
|
test -d $(DESTDIR)$(MANDIR)/$${lang}/man8 || install -m 755 -d $(DESTDIR)$(MANDIR)/$${lang}/man8 ; \
|
|
|
|
install -m 644 $${lang}/*.8 $(DESTDIR)$(MANDIR)/$${lang}/man8/ ; \
|
|
|
|
fi ; \
|
|
|
|
done
|
2017-04-24 17:59:59 +00:00
|
|
|
ifeq ($(PAMH), y)
|
2018-02-14 09:57:09 +00:00
|
|
|
install -m 644 run_init.pamd $(DESTDIR)$(ETCDIR)/pam.d/run_init
|
2008-08-19 19:30:36 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
clean:
|
|
|
|
-rm -f $(TARGETS) *.o
|
|
|
|
|
|
|
|
indent:
|
|
|
|
../../scripts/Lindent $(wildcard *.[ch])
|
|
|
|
|
|
|
|
relabel: install
|
2018-02-14 09:57:09 +00:00
|
|
|
/sbin/restorecon $(DESTDIR)$(SBINDIR)/run_init $(DESTDIR)$(SBINDIR)/open_init_pty
|