1 2# Installation directories. 3LINGUAS ?= ru 4PREFIX ?= /usr 5SBINDIR ?= $(PREFIX)/sbin 6MANDIR ?= $(PREFIX)/share/man 7ETCDIR ?= /etc 8LOCALEDIR ?= $(DESTDIR)$(PREFIX)/share/locale 9PAMH ?= $(shell test -f /usr/include/security/pam_appl.h && echo y) 10AUDITH ?= $(shell test -f /usr/include/libaudit.h && echo y) 11 12CFLAGS ?= -Werror -Wall -W 13override CFLAGS += -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\"" 14override LDLIBS += -lselinux 15ifeq ($(PAMH), y) 16 override CFLAGS += -DUSE_PAM 17 override LDLIBS += -lpam -lpam_misc 18else 19 override CFLAGS += -D_XOPEN_SOURCE=500 20 override LDLIBS += -lcrypt 21endif 22ifeq ($(AUDITH), y) 23 override CFLAGS += -DUSE_AUDIT 24 override LDLIBS += -laudit 25endif 26 27TARGETS=$(patsubst %.c,%,$(sort $(wildcard *.c))) 28 29all: $(TARGETS) 30 31open_init_pty: open_init_pty.c 32 $(LINK.c) $^ -ldl -lutil -o $@ 33 34 35install: all 36 test -d $(DESTDIR)$(SBINDIR) || install -m 755 -d $(DESTDIR)$(SBINDIR) 37 test -d $(DESTDIR)$(MANDIR)/man8 || install -m 755 -d $(DESTDIR)$(MANDIR)/man8 38 install -m 755 run_init $(DESTDIR)$(SBINDIR) 39 install -m 755 open_init_pty $(DESTDIR)$(SBINDIR) 40 install -m 644 run_init.8 $(DESTDIR)$(MANDIR)/man8/ 41 install -m 644 open_init_pty.8 $(DESTDIR)$(MANDIR)/man8/ 42 for lang in $(LINGUAS) ; do \ 43 if [ -e $${lang} ] ; then \ 44 test -d $(DESTDIR)$(MANDIR)/$${lang}/man8 || install -m 755 -d $(DESTDIR)$(MANDIR)/$${lang}/man8 ; \ 45 install -m 644 $${lang}/*.8 $(DESTDIR)$(MANDIR)/$${lang}/man8/ ; \ 46 fi ; \ 47 done 48ifeq ($(PAMH), y) 49 install -m 644 run_init.pamd $(DESTDIR)$(ETCDIR)/pam.d/run_init 50endif 51 52clean: 53 -rm -f $(TARGETS) *.o 54 55indent: 56 ../../scripts/Lindent $(wildcard *.[ch]) 57 58relabel: install 59 /sbin/restorecon $(DESTDIR)$(SBINDIR)/run_init $(DESTDIR)$(SBINDIR)/open_init_pty 60