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