2008-08-19 21:30:36 +02:00
|
|
|
# Installation directories.
|
|
|
|
PREFIX ?= $(DESTDIR)/usr
|
|
|
|
LIBDIR ?= $(PREFIX)/lib
|
2012-01-27 20:00:34 +01:00
|
|
|
USRBINDIR ?= $(PREFIX)/sbin
|
|
|
|
SBINDIR ?= $(DESTDIR)/sbin
|
2008-08-19 21:30:36 +02:00
|
|
|
|
2012-01-23 16:41:21 +01:00
|
|
|
MAX_STACK_SIZE=8192
|
2012-05-25 13:11:51 +02:00
|
|
|
CFLAGS ?= -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissing-include-dirs \
|
2012-01-23 16:41:21 +01: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 \
|
|
|
|
-Wdisabled-optimization -Wbuiltin-macro-redefined -Wmudflap -Wpacked-bitfield-compat \
|
|
|
|
-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
|
2008-08-19 21:30:36 +02:00
|
|
|
override CFLAGS += -I../include -D_GNU_SOURCE $(EMFLAGS)
|
|
|
|
LDLIBS += -L../src -lselinux -L$(LIBDIR)
|
|
|
|
|
|
|
|
TARGETS=$(patsubst %.c,%,$(wildcard *.c))
|
2009-05-07 22:05:05 +02:00
|
|
|
|
|
|
|
|
2008-08-19 21:30:36 +02:00
|
|
|
ifeq ($(DISABLE_AVC),y)
|
|
|
|
UNUSED_TARGETS+=compute_av compute_create compute_member compute_relabel
|
|
|
|
endif
|
|
|
|
ifeq ($(DISABLE_BOOL),y)
|
|
|
|
UNUSED_TARGETS+=getsebool togglesebool
|
|
|
|
endif
|
2012-01-27 20:41:58 +01:00
|
|
|
TARGETS:= $(filter-out $(UNUSED_TARGETS), $(TARGETS))
|
2008-08-19 21:30:36 +02:00
|
|
|
|
2012-01-27 20:41:58 +01:00
|
|
|
all: $(TARGETS)
|
2008-08-19 21:30:36 +02:00
|
|
|
|
|
|
|
install: all
|
2012-01-27 20:00:34 +01:00
|
|
|
-mkdir -p $(USRBINDIR)
|
|
|
|
install -m 755 $(TARGETS) $(USRBINDIR)
|
|
|
|
-mkdir -p $(SBINDIR)
|
2008-08-19 21:30:36 +02:00
|
|
|
clean:
|
2012-01-27 20:41:58 +01:00
|
|
|
rm -f $(TARGETS) *.o *~
|
2008-08-19 21:30:36 +02:00
|
|
|
|
2012-01-27 20:00:34 +01:00
|
|
|
distclean: clean
|
|
|
|
|
2008-08-19 21:30:36 +02:00
|
|
|
indent:
|
|
|
|
../../scripts/Lindent $(wildcard *.[ch])
|
|
|
|
|
|
|
|
relabel:
|
|
|
|
|