Home | History | Annotate | Download | only in selinux
      1 OPT_SUBDIRS ?= dbus gui mcstrans python restorecond sandbox semodule-utils
      2 SUBDIRS=libsepol libselinux libsemanage checkpolicy secilc policycoreutils $(OPT_SUBDIRS)
      3 PYSUBDIRS=libselinux libsemanage
      4 DISTCLEANSUBDIRS=libselinux libsemanage
      5 
      6 ifeq ($(DEBUG),1)
      7 	export CFLAGS = -g3 -O0 -gdwarf-2 -fno-strict-aliasing -Wall -Wshadow -Werror
      8 	export LDFLAGS = -g
      9 else
     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
     19 endif
     20 
     21 ifneq ($(DESTDIR),)
     22 	CFLAGS += -I$(DESTDIR)/usr/include
     23 	LDFLAGS += -L$(DESTDIR)/usr/lib
     24 	export CFLAGS
     25 	export LDFLAGS
     26 endif
     27 
     28 all install relabel clean test indent:
     29 	@for subdir in $(SUBDIRS); do \
     30 		(cd $$subdir && $(MAKE) $@) || exit 1; \
     31 	done
     32 
     33 install-pywrap install-rubywrap swigify:
     34 	@for subdir in $(PYSUBDIRS); do \
     35 		(cd $$subdir && $(MAKE) $@) || exit 1; \
     36 	done
     37 
     38 distclean:
     39 	@for subdir in $(DISTCLEANSUBDIRS); do \
     40 		(cd $$subdir && $(MAKE) $@) || exit 1; \
     41 	done
     42