blob: 5f3e0470c30aecfa3a7d7c8ef2e84c5212c41056 [file] [log] [blame]
Joshua Brindle13cd4c82008-08-19 15:30:36 -04001# Installation directories.
2PREFIX ?= $(DESTDIR)/usr
3LIBDIR ?= $(PREFIX)/lib
Dan Walsh46d294f2012-01-27 14:00:34 -05004USRBINDIR ?= $(PREFIX)/sbin
5SBINDIR ?= $(DESTDIR)/sbin
Joshua Brindle13cd4c82008-08-19 15:30:36 -04006
Daniel P. Berrangea1044d42012-01-23 15:41:21 +00007MAX_STACK_SIZE=8192
Dan Walshac6ab3a2012-05-25 07:11:51 -04008CFLAGS ?= -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissing-include-dirs \
Daniel P. Berrangea1044d42012-01-23 15:41:21 +00009 -Wunused -Wunknown-pragmas -Wstrict-aliasing -Wshadow -Wpointer-arith \
10 -Wbad-function-cast -Wcast-align -Wwrite-strings -Wlogical-op -Waggregate-return \
11 -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes \
12 -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute \
13 -Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wvolatile-register-var \
14 -Wdisabled-optimization -Wbuiltin-macro-redefined -Wmudflap -Wpacked-bitfield-compat \
15 -Wsync-nand -Wattributes -Wcoverage-mismatch -Wmultichar -Wcpp \
16 -Wdeprecated-declarations -Wdiv-by-zero -Wdouble-promotion -Wendif-labels -Wextra \
17 -Wformat-contains-nul -Wformat-extra-args -Wformat-zero-length -Wformat=2 -Wmultichar \
18 -Wnormalized=nfc -Woverflow -Wpointer-to-int-cast -Wpragmas -Wsuggest-attribute=const \
19 -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wtrampolines \
20 -Wno-missing-field-initializers -Wno-sign-compare -Wjump-misses-init \
21 -Wno-format-nonliteral -Wframe-larger-than=$(MAX_STACK_SIZE) -Wp,-D_FORTIFY_SOURCE=2 \
22 -fstack-protector-all --param=ssp-buffer-size=4 -fexceptions \
23 -fasynchronous-unwind-tables -fdiagnostics-show-option -funit-at-a-time \
24 -fipa-pure-const -Wno-suggest-attribute=pure -Wno-suggest-attribute=const \
25 -Werror -Wno-aggregate-return -Wno-redundant-decls
Joshua Brindle13cd4c82008-08-19 15:30:36 -040026override CFLAGS += -I../include -D_GNU_SOURCE $(EMFLAGS)
27LDLIBS += -L../src -lselinux -L$(LIBDIR)
28
29TARGETS=$(patsubst %.c,%,$(wildcard *.c))
Chad Sellers72d535f2009-05-07 16:05:05 -040030
31
Joshua Brindle13cd4c82008-08-19 15:30:36 -040032ifeq ($(DISABLE_AVC),y)
33 UNUSED_TARGETS+=compute_av compute_create compute_member compute_relabel
34endif
35ifeq ($(DISABLE_BOOL),y)
36 UNUSED_TARGETS+=getsebool togglesebool
37endif
Dan Walsh9b796ea2012-01-27 14:41:58 -050038TARGETS:= $(filter-out $(UNUSED_TARGETS), $(TARGETS))
Joshua Brindle13cd4c82008-08-19 15:30:36 -040039
Dan Walsh9b796ea2012-01-27 14:41:58 -050040all: $(TARGETS)
Joshua Brindle13cd4c82008-08-19 15:30:36 -040041
42install: all
Dan Walsh46d294f2012-01-27 14:00:34 -050043 -mkdir -p $(USRBINDIR)
44 install -m 755 $(TARGETS) $(USRBINDIR)
45 -mkdir -p $(SBINDIR)
Joshua Brindle13cd4c82008-08-19 15:30:36 -040046clean:
Dan Walsh9b796ea2012-01-27 14:41:58 -050047 rm -f $(TARGETS) *.o *~
Joshua Brindle13cd4c82008-08-19 15:30:36 -040048
Dan Walsh46d294f2012-01-27 14:00:34 -050049distclean: clean
50
Joshua Brindle13cd4c82008-08-19 15:30:36 -040051indent:
52 ../../scripts/Lindent $(wildcard *.[ch])
53
54relabel:
55