platform_external_selinux/libselinux/utils/Makefile
Daniel P. Berrange a1044d4c84 libselinux: utils: Enable many more gcc warnings for libselinux/utils builds
Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2012-03-28 14:52:13 -04:00

55 lines
2.3 KiB
Makefile

# Installation directories.
PREFIX ?= $(DESTDIR)/usr
LIBDIR ?= $(PREFIX)/lib
BINDIR ?= $(PREFIX)/sbin
_BINDIR ?= $(DESTDIR)/sbin
MAX_STACK_SIZE=8192
CFLAGS ?= -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissing-include-dirs \
-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
override CFLAGS += -I../include -D_GNU_SOURCE $(EMFLAGS)
LDLIBS += -L../src -lselinux -L$(LIBDIR)
TARGETS=$(patsubst %.c,%,$(wildcard *.c))
ifeq ($(DISABLE_AVC),y)
UNUSED_TARGETS+=compute_av compute_create compute_member compute_relabel
endif
ifeq ($(DISABLE_BOOL),y)
UNUSED_TARGETS+=getsebool togglesebool
endif
TARGETS:= $(filter-out $(UNUSED_TARGETS) matchpathcon, $(TARGETS))
all: $(TARGETS) matchpathcon
install: all
-mkdir -p $(BINDIR)
install -m 755 $(TARGETS) $(BINDIR)
-mkdir -p $(_BINDIR)
install -m 755 matchpathcon $(_BINDIR)
(cd $(BINDIR); ln -fs ../../sbin/matchpathcon)
clean:
rm -f $(TARGETS) matchpathcon *.o *~
indent:
../../scripts/Lindent $(wildcard *.[ch])
relabel: