1PREFIX ?= /usr 2OPT_SUBDIRS ?= dbus gui mcstrans python restorecond sandbox semodule-utils 3SUBDIRS=libsepol libselinux libsemanage checkpolicy secilc policycoreutils $(OPT_SUBDIRS) 4PYSUBDIRS=libselinux libsemanage 5DISTCLEANSUBDIRS=libselinux libsemanage 6 7ifeq ($(DEBUG),1) 8 export CFLAGS = -g3 -O0 -gdwarf-2 -fno-strict-aliasing -Wall -Wshadow -Werror 9 export LDFLAGS = -g 10else 11 export CFLAGS ?= -O2 -Werror -Wall -Wextra \ 12 -Wfloat-equal \ 13 -Wformat=2 \ 14 -Winit-self \ 15 -Wmissing-format-attribute \ 16 -Wmissing-noreturn \ 17 -Wmissing-prototypes \ 18 -Wnull-dereference \ 19 -Wpointer-arith \ 20 -Wshadow \ 21 -Wstrict-prototypes \ 22 -Wundef \ 23 -Wunused \ 24 -Wwrite-strings \ 25 -fno-common 26endif 27 28ifneq ($(DESTDIR),) 29 LIBDIR ?= $(DESTDIR)$(PREFIX)/lib 30 LIBSEPOLA ?= $(LIBDIR)/libsepol.a 31 32 CFLAGS += -I$(DESTDIR)$(PREFIX)/include 33 LDFLAGS += -L$(DESTDIR)$(PREFIX)/lib -L$(LIBDIR) 34 export CFLAGS 35 export LDFLAGS 36 export LIBSEPOLA 37endif 38 39all install relabel clean test indent: 40 @for subdir in $(SUBDIRS); do \ 41 (cd $$subdir && $(MAKE) $@) || exit 1; \ 42 done 43 44install-pywrap install-rubywrap swigify: 45 @for subdir in $(PYSUBDIRS); do \ 46 (cd $$subdir && $(MAKE) $@) || exit 1; \ 47 done 48 49distclean: 50 @for subdir in $(DISTCLEANSUBDIRS); do \ 51 (cd $$subdir && $(MAKE) $@) || exit 1; \ 52 done 53