Home | History | Annotate | Download | only in utils
      1 # Installation directories.
      2 PREFIX ?= $(DESTDIR)/usr
      3 LIBDIR ?= $(PREFIX)/lib
      4 USRBINDIR ?= $(PREFIX)/sbin
      5 SBINDIR ?= $(DESTDIR)/sbin
      6 
      7 MAX_STACK_SIZE=8192
      8 CFLAGS ?= -O -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 -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
     26 override CFLAGS += -I../include -D_GNU_SOURCE $(EMFLAGS)
     27 LDLIBS += -L../src -lselinux -L$(LIBDIR)
     28 
     29 TARGETS=$(patsubst %.c,%,$(wildcard *.c))
     30 
     31 sefcontext_compile: LDLIBS += -lpcre
     32 
     33 ifeq ($(DISABLE_AVC),y)
     34 	UNUSED_TARGETS+=compute_av compute_create compute_member compute_relabel
     35 endif
     36 ifeq ($(DISABLE_BOOL),y)
     37 	UNUSED_TARGETS+=getsebool togglesebool
     38 endif
     39 TARGETS:= $(filter-out $(UNUSED_TARGETS), $(TARGETS))
     40 
     41 all: $(TARGETS)
     42 
     43 install: all
     44 	-mkdir -p $(USRBINDIR)
     45 	install -m 755 $(TARGETS) $(USRBINDIR)
     46 	-mkdir -p $(SBINDIR)
     47 clean:
     48 	rm -f $(TARGETS) *.o *~
     49 
     50 distclean: clean
     51 
     52 indent:
     53 	../../scripts/Lindent $(wildcard *.[ch])
     54 
     55 relabel:
     56 
     57