2008-08-19 19:30:36 +00:00
|
|
|
# Installation directories.
|
|
|
|
PREFIX ?= $(DESTDIR)/usr
|
|
|
|
LIBDIR ?= $(PREFIX)/lib
|
2012-01-27 19:00:34 +00:00
|
|
|
USRBINDIR ?= $(PREFIX)/sbin
|
|
|
|
SBINDIR ?= $(DESTDIR)/sbin
|
2016-08-04 12:44:06 +00:00
|
|
|
INCLUDEDIR ?= $(PREFIX)/include
|
2008-08-19 19:30:36 +00:00
|
|
|
|
2012-01-23 15:41:21 +00:00
|
|
|
MAX_STACK_SIZE=8192
|
2012-05-25 11:11:51 +00:00
|
|
|
CFLAGS ?= -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissing-include-dirs \
|
2012-01-23 15:41:21 +00:00
|
|
|
-Wunused -Wunknown-pragmas -Wstrict-aliasing -Wshadow -Wpointer-arith \
|
|
|
|
-Wbad-function-cast -Wcast-align -Wwrite-strings -Wlogical-op -Waggregate-return \
|
|
|
|
-Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes \
|
|
|
|
-Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute \
|
|
|
|
-Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wvolatile-register-var \
|
2015-04-16 12:18:57 +00:00
|
|
|
-Wdisabled-optimization -Wbuiltin-macro-redefined -Wpacked-bitfield-compat \
|
2012-01-23 15:41:21 +00:00
|
|
|
-Wsync-nand -Wattributes -Wcoverage-mismatch -Wmultichar -Wcpp \
|
|
|
|
-Wdeprecated-declarations -Wdiv-by-zero -Wdouble-promotion -Wendif-labels -Wextra \
|
|
|
|
-Wformat-contains-nul -Wformat-extra-args -Wformat-zero-length -Wformat=2 -Wmultichar \
|
|
|
|
-Wnormalized=nfc -Woverflow -Wpointer-to-int-cast -Wpragmas -Wsuggest-attribute=const \
|
|
|
|
-Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wtrampolines \
|
|
|
|
-Wno-missing-field-initializers -Wno-sign-compare -Wjump-misses-init \
|
|
|
|
-Wno-format-nonliteral -Wframe-larger-than=$(MAX_STACK_SIZE) -Wp,-D_FORTIFY_SOURCE=2 \
|
|
|
|
-fstack-protector-all --param=ssp-buffer-size=4 -fexceptions \
|
|
|
|
-fasynchronous-unwind-tables -fdiagnostics-show-option -funit-at-a-time \
|
|
|
|
-fipa-pure-const -Wno-suggest-attribute=pure -Wno-suggest-attribute=const \
|
|
|
|
-Werror -Wno-aggregate-return -Wno-redundant-decls
|
2016-09-28 16:00:23 +00:00
|
|
|
override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS)
|
2008-08-19 19:30:36 +00:00
|
|
|
LDLIBS += -L../src -lselinux -L$(LIBDIR)
|
2016-09-15 16:14:33 +00:00
|
|
|
PCRE_LDFLAGS ?= -lpcre
|
2008-08-19 19:30:36 +00:00
|
|
|
|
2016-09-28 16:17:59 +00:00
|
|
|
ifeq ($(ANDROID_HOST),y)
|
|
|
|
TARGETS=sefcontext_compile
|
|
|
|
else
|
2008-08-19 19:30:36 +00:00
|
|
|
TARGETS=$(patsubst %.c,%,$(wildcard *.c))
|
2016-09-28 16:17:59 +00:00
|
|
|
endif
|
2009-05-07 20:05:05 +00:00
|
|
|
|
2016-09-15 16:14:33 +00:00
|
|
|
sefcontext_compile: LDLIBS += $(PCRE_LDFLAGS) ../src/libselinux.a -lsepol
|
|
|
|
|
|
|
|
sefcontext_compile: sefcontext_compile.o ../src/regex.o
|
2009-05-07 20:05:05 +00:00
|
|
|
|
2015-10-23 13:30:27 +00:00
|
|
|
selinux_restorecon: LDLIBS += -lsepol
|
|
|
|
|
2012-01-27 19:41:58 +00:00
|
|
|
all: $(TARGETS)
|
2008-08-19 19:30:36 +00:00
|
|
|
|
|
|
|
install: all
|
2012-01-27 19:00:34 +00:00
|
|
|
-mkdir -p $(USRBINDIR)
|
|
|
|
install -m 755 $(TARGETS) $(USRBINDIR)
|
|
|
|
-mkdir -p $(SBINDIR)
|
2008-08-19 19:30:36 +00:00
|
|
|
clean:
|
2012-01-27 19:41:58 +00:00
|
|
|
rm -f $(TARGETS) *.o *~
|
2008-08-19 19:30:36 +00:00
|
|
|
|
2012-01-27 19:00:34 +00:00
|
|
|
distclean: clean
|
|
|
|
|
2008-08-19 19:30:36 +00:00
|
|
|
indent:
|
|
|
|
../../scripts/Lindent $(wildcard *.[ch])
|
|
|
|
|
|
|
|
relabel:
|
|
|
|
|