File: Makefile

package info (click to toggle)
policycoreutils 2.0.82-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 5,584 kB
  • ctags: 727
  • sloc: ansic: 5,661; python: 2,427; sh: 474; makefile: 442
file content (52 lines) | stat: -rw-r--r-- 1,437 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

# Installation directories.
PREFIX ?= ${DESTDIR}/usr
SBINDIR ?= $(PREFIX)/sbin
MANDIR ?= $(PREFIX)/share/man
ETCDIR ?= $(DESTDIR)/etc
LOCALEDIR ?= /usr/share/locale
PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null)
AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)

CFLAGS ?= -Werror -Wall -W
override CFLAGS += -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
LDLIBS += -lselinux -L$(PREFIX)/lib
ifeq (${PAMH}, /usr/include/security/pam_appl.h)
	override CFLAGS += -DUSE_PAM
	LDLIBS += -lpam -lpam_misc
else
	override CFLAGS += -D_XOPEN_SOURCE=500
	LDLIBS += -lcrypt
endif
ifeq (${AUDITH}, /usr/include/libaudit.h)
	override CFLAGS += -DUSE_AUDIT
	LDLIBS += -laudit
endif

TARGETS=$(patsubst %.c,%,$(wildcard *.c))

all: $(TARGETS)

open_init_pty: open_init_pty.c
	$(LINK.c) $^ -ldl -lutil -o $@


install: all
	test -d $(SBINDIR)      || install -m 755 -d $(SBINDIR)
	test -d $(MANDIR)/man8 || install -m 755 -d $(MANDIR)/man8
	install -m 755 run_init $(SBINDIR)
	install -m 755 open_init_pty $(SBINDIR)
	install -m 644 run_init.8 $(MANDIR)/man8/
	install -m 644 open_init_pty.8 $(MANDIR)/man8/
ifeq (${PAMH}, /usr/include/security/pam_appl.h)
	install -m 644 run_init.pamd $(ETCDIR)/pam.d/run_init
endif

clean:
	-rm -f $(TARGETS) *.o 

indent:
	../../scripts/Lindent $(wildcard *.[ch])

relabel: install
	/sbin/restorecon $(SBINDIR)/run_init $(SBINDIR)/open_init_pty