Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 1 | # Installation directories. |
| 2 | PREFIX ?= $(DESTDIR)/usr |
| 3 | LIBDIR ?= $(PREFIX)/lib |
Dan Walsh | 46d294f | 2012-01-27 14:00:34 -0500 | [diff] [blame] | 4 | USRBINDIR ?= $(PREFIX)/sbin |
| 5 | SBINDIR ?= $(DESTDIR)/sbin |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 6 | |
Daniel P. Berrange | a1044d4 | 2012-01-23 15:41:21 +0000 | [diff] [blame] | 7 | MAX_STACK_SIZE=8192 |
| 8 | CFLAGS ?= -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissing-include-dirs \ |
| 9 | -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 Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 26 | override CFLAGS += -I../include -D_GNU_SOURCE $(EMFLAGS) |
| 27 | LDLIBS += -L../src -lselinux -L$(LIBDIR) |
| 28 | |
| 29 | TARGETS=$(patsubst %.c,%,$(wildcard *.c)) |
Chad Sellers | 72d535f | 2009-05-07 16:05:05 -0400 | [diff] [blame] | 30 | |
| 31 | |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 32 | ifeq ($(DISABLE_AVC),y) |
| 33 | UNUSED_TARGETS+=compute_av compute_create compute_member compute_relabel |
| 34 | endif |
| 35 | ifeq ($(DISABLE_BOOL),y) |
| 36 | UNUSED_TARGETS+=getsebool togglesebool |
| 37 | endif |
Dan Walsh | 9b796ea | 2012-01-27 14:41:58 -0500 | [diff] [blame^] | 38 | TARGETS:= $(filter-out $(UNUSED_TARGETS), $(TARGETS)) |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 39 | |
Dan Walsh | 9b796ea | 2012-01-27 14:41:58 -0500 | [diff] [blame^] | 40 | all: $(TARGETS) |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 41 | |
| 42 | install: all |
Dan Walsh | 46d294f | 2012-01-27 14:00:34 -0500 | [diff] [blame] | 43 | -mkdir -p $(USRBINDIR) |
| 44 | install -m 755 $(TARGETS) $(USRBINDIR) |
| 45 | -mkdir -p $(SBINDIR) |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 46 | clean: |
Dan Walsh | 9b796ea | 2012-01-27 14:41:58 -0500 | [diff] [blame^] | 47 | rm -f $(TARGETS) *.o *~ |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 48 | |
Dan Walsh | 46d294f | 2012-01-27 14:00:34 -0500 | [diff] [blame] | 49 | distclean: clean |
| 50 | |
Joshua Brindle | 13cd4c8 | 2008-08-19 15:30:36 -0400 | [diff] [blame] | 51 | indent: |
| 52 | ../../scripts/Lindent $(wildcard *.[ch]) |
| 53 | |
| 54 | relabel: |
| 55 | |