1 PREFIX ?= $(DESTDIR)/usr 2 BINDIR ?= $(PREFIX)/bin 3 MANDIR ?= $(PREFIX)/share/man 4 LIBDIR ?= $(PREFIX)/lib 5 INCLUDEDIR ?= $(PREFIX)/include 6 7 LDLIBS = -lsepol -L$(LIBDIR) 8 SECILC = secilc 9 SECILC_SRCS := secilc.c 10 SECILC_OBJS := $(patsubst %.c,%.o,$(SECILC_SRCS)) 11 12 # The secilc man page: 13 MANPAGE = secilc.8 14 XMLTO = xmlto 15 16 CFLAGS ?= -Wall -Wshadow -Wextra -Wundef -Wmissing-format-attribute -Wcast-align -Wstrict-prototypes -Wpointer-arith -Wunused 17 18 override CFLAGS += -I$(INCLUDEDIR) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 19 20 all: $(SECILC) man 21 22 $(SECILC): $(SECILC_OBJS) 23 $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) 24 25 test: $(SECILC) 26 ./$(SECILC) test/policy.cil 27 28 man: $(MANPAGE).xml 29 $(XMLTO) man $(MANPAGE).xml 30 31 install: all man 32 -mkdir -p $(BINDIR) 33 -mkdir -p $(MANDIR)/man8 34 install -m 755 $(SECILC) $(BINDIR) 35 install -m 644 $(MANPAGE) $(MANDIR)/man8 36 37 doc: 38 $(MAKE) -C docs 39 40 clean: 41 rm -f $(SECILC) 42 rm -f $(SECILC_OBJS) 43 rm -f policy.* 44 rm -f file_contexts 45 rm -f $(MANPAGE) 46 47 relabel: 48 49 .PHONY: all clean test install doc relabel man 50