selinux/secilc/Makefile
Yuli Khodorkovskiy 36f62b78f1 libsepol: Move secilc out of libsepol
Since the secilc compiler is independent of libsepol, move secilc out of
libsepol. Linke secilc dynamically rather than statically with libsepol.

- Move secilc source, test policies, docs, and secilc manpage to secilc
  directory.
- Remove unneeded Makefile from libsepol/cil. To build secilc, run make
  in the secilc directory.
- Add target to install the secilc binary to /usr/bin/.
- Create an Android makefile for secilc and move secilc out of libsepol
  Android makefile.
- Add cil_set_mls to libsepol public API as it is needed by secilc.
- Remove policy.conf from testing since it is no longer used.

Signed-off-by: Yuli Khodorkovskiy <ykhodorkovskiy@tresys.com>
2015-03-31 12:31:38 -04:00

48 lines
1006 B
Makefile

PREFIX ?= $(DESTDIR)/usr
BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man
LIBDIR ?= $(PREFIX)/lib
INCLUDEDIR ?= $(PREFIX)/include
LDLIBS = -lsepol -L$(LIBDIR)
SECILC = secilc
SECILC_SRCS := secilc.c
SECILC_OBJS := $(patsubst %.c,%.o,$(SECILC_SRCS))
# The secilc man page:
MANPAGE = secilc.8
XMLTO = xmlto
CFLAGS ?= -Wall -Wshadow -Wextra -Wundef -Wmissing-format-attribute -Wcast-align -Wstrict-prototypes -Wpointer-arith -Wunused
override CFLAGS += -I$(INCLUDEDIR) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
$(SECILC): $(SECILC_OBJS)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
all: $(SECILC) man
test: $(SECILC)
./$(SECILC) test/policy.cil
man: $(MANPAGE).xml
$(XMLTO) man $(MANPAGE).xml
install: all man
-mkdir -p $(BINDIR)
-mkdir -p $(MANDIR)/man8
install -m 755 $(SECILC) $(BINDIR)
install -m 644 $(MANPAGE) $(MANDIR)/man8
doc:
$(MAKE) -C docs
clean:
rm -f $(SECILC)
rm -f $(SECILC_OBJS)
rm -f policy.*
rm -f file_contexts
rm -f $(MANPAGE)
.PHONY: all clean test install doc