2018-02-14 10:57:17 +01:00
|
|
|
PREFIX ?= /usr
|
2016-10-31 18:52:02 +01:00
|
|
|
OPT_SUBDIRS ?= dbus gui mcstrans python restorecond sandbox semodule-utils
|
2016-10-31 18:41:12 +01:00
|
|
|
SUBDIRS=libsepol libselinux libsemanage checkpolicy secilc policycoreutils $(OPT_SUBDIRS)
|
2008-08-19 21:30:36 +02:00
|
|
|
PYSUBDIRS=libselinux libsemanage
|
2016-09-28 23:40:32 +02:00
|
|
|
DISTCLEANSUBDIRS=libselinux libsemanage
|
2008-08-19 21:30:36 +02:00
|
|
|
|
|
|
|
ifeq ($(DEBUG),1)
|
|
|
|
export CFLAGS = -g3 -O0 -gdwarf-2 -fno-strict-aliasing -Wall -Wshadow -Werror
|
|
|
|
export LDFLAGS = -g
|
2017-09-03 14:19:28 +02:00
|
|
|
else
|
|
|
|
export CFLAGS ?= -O2 -Werror -Wall -Wextra \
|
2021-11-12 16:41:53 +01:00
|
|
|
-Wfloat-equal \
|
|
|
|
-Wformat=2 \
|
|
|
|
-Winit-self \
|
2017-09-03 14:19:28 +02:00
|
|
|
-Wmissing-format-attribute \
|
|
|
|
-Wmissing-noreturn \
|
2021-11-12 16:41:53 +01:00
|
|
|
-Wnull-dereference \
|
2017-09-03 14:19:28 +02:00
|
|
|
-Wpointer-arith \
|
|
|
|
-Wshadow \
|
|
|
|
-Wstrict-prototypes \
|
|
|
|
-Wundef \
|
|
|
|
-Wunused \
|
2020-01-23 13:57:16 +01:00
|
|
|
-Wwrite-strings \
|
|
|
|
-fno-common
|
2008-08-19 21:30:36 +02:00
|
|
|
endif
|
|
|
|
|
2017-04-24 19:59:58 +02:00
|
|
|
ifneq ($(DESTDIR),)
|
2018-02-14 10:57:17 +01:00
|
|
|
LIBDIR ?= $(DESTDIR)$(PREFIX)/lib
|
|
|
|
LIBSEPOLA ?= $(LIBDIR)/libsepol.a
|
|
|
|
|
|
|
|
CFLAGS += -I$(DESTDIR)$(PREFIX)/include
|
|
|
|
LDFLAGS += -L$(DESTDIR)$(PREFIX)/lib -L$(LIBDIR)
|
2017-04-24 19:59:58 +02:00
|
|
|
export CFLAGS
|
|
|
|
export LDFLAGS
|
2018-02-14 10:57:17 +01:00
|
|
|
export LIBSEPOLA
|
2017-04-24 19:59:58 +02:00
|
|
|
endif
|
|
|
|
|
2011-08-12 05:36:14 +02:00
|
|
|
all install relabel clean test indent:
|
2008-08-19 21:30:36 +02:00
|
|
|
@for subdir in $(SUBDIRS); do \
|
|
|
|
(cd $$subdir && $(MAKE) $@) || exit 1; \
|
|
|
|
done
|
|
|
|
|
2012-06-01 15:13:24 +02:00
|
|
|
install-pywrap install-rubywrap swigify:
|
2008-08-19 21:30:36 +02:00
|
|
|
@for subdir in $(PYSUBDIRS); do \
|
|
|
|
(cd $$subdir && $(MAKE) $@) || exit 1; \
|
|
|
|
done
|
|
|
|
|
|
|
|
distclean:
|
2011-08-12 05:36:14 +02:00
|
|
|
@for subdir in $(DISTCLEANSUBDIRS); do \
|
2008-08-19 21:30:36 +02:00
|
|
|
(cd $$subdir && $(MAKE) $@) || exit 1; \
|
|
|
|
done
|