1# Installation directories.
2PREFIX ?= $(DESTDIR)/usr
3INCLUDEDIR ?= $(PREFIX)/include
4SBINDIR ?= $(PREFIX)/sbin
5MANDIR = $(PREFIX)/share/man
6LIBDIR ?= $(PREFIX)/lib
7
8CFLAGS ?= -Werror -Wall -W
9override CFLAGS += -I$(INCLUDEDIR)
10LDLIBS = -lsepol -lselinux -lsemanage -L$(LIBDIR)
11SEMODULE_OBJS = semodule.o
12
13all: semodule genhomedircon
14
15semodule: $(SEMODULE_OBJS)
16	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
17
18genhomedircon:
19	ln -sf semodule genhomedircon
20
21install: all
22	-mkdir -p $(SBINDIR)
23	install -m 755 semodule $(SBINDIR)
24	(cd $(SBINDIR); ln -sf semodule genhomedircon)
25	test -d $(MANDIR)/man8 || install -m 755 -d $(MANDIR)/man8
26	install -m 644 semodule.8 $(MANDIR)/man8/
27	install -m 644 genhomedircon.8 $(MANDIR)/man8/
28
29relabel:
30
31clean:
32	-rm -f semodule *.o genhomedircon
33
34indent:
35	../../scripts/Lindent $(wildcard *.[ch])
36
37