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