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