libsepol: allow specifying SUBDIRS when building
PATCH 1/2 libsepol: allow specifying SUBDIRS when building
From: Dmitry Sharshakov <[email protected]>
Allow building without utils and man for minimalist builds which do not need those.
Also make the Makefile modular as in libselinux.
--- libsepol/Makefile | 27 +++++---------------------- libsepol/include/Makefile | 2 +- libsepol/man/Makefile | 2 +- 3 files changed, 7 insertions(+), 24 deletions(-)
libsepol/Makefile +5 -22
@@ -1,29 +1,12 @@ +SUBDIRS = include src utils man DISABLE_CIL ?= n export DISABLE_CIL -all: - $(MAKE) -C src - $(MAKE) -C utils - -install: - $(MAKE) -C include install - $(MAKE) -C src install - $(MAKE) -C utils install - $(MAKE) -C man install - -relabel: - $(MAKE) -C src relabel - -clean: - $(MAKE) -C src clean - $(MAKE) -C utils clean - $(MAKE) -C tests clean - -indent: - $(MAKE) -C src $@ - $(MAKE) -C include $@ - $(MAKE) -C utils $@ +all install relabel clean indent: + @for subdir in $(SUBDIRS); do \ + (cd $$subdir && $(MAKE) $@) || exit 1; \ + done test: $(MAKE) -C tests test
libsepol/include/Makefile +1 -1
@@ -3,7 +3,7 @@ PREFIX ?= /usr INCDIR = $(PREFIX)/include/sepol CILDIR ?= ../cil -all: +all relabel clean: install: all test -d $(DESTDIR)$(INCDIR) || install -m 755 -d $(DESTDIR)$(INCDIR)
libsepol/man/Makefile +1 -1
@@ -7,7 +7,7 @@ MAN8SUBDIR ?= man8 MAN3DIR ?= $(MANDIR)/$(MAN3SUBDIR) MAN8DIR ?= $(MANDIR)/$(MAN8SUBDIR) -all: +all relabel clean indent: install: all mkdir -p $(DESTDIR)$(MAN3DIR)
Signature · 1 line
2.47.0
PATCH 2/2 libsemanage: allow specifying SUBDIRS when building
From: Dmitry Sharshakov <[email protected]>
Allow building without utils and man for minimalist builds which do not need those.
Also make the Makefile modular as in libselinux.
--- libsemanage/Makefile | 25 ++++++------------------- libsemanage/include/Makefile | 2 +- libsemanage/man/Makefile | 2 +- 3 files changed, 8 insertions(+), 21 deletions(-)
libsemanage/Makefile +6 -19
@@ -1,5 +1,9 @@ -all: - $(MAKE) -C src all +SUBDIRS = include src utils man + +all install relabel clean distclean indent: + @for subdir in $(SUBDIRS); do \ + (cd $$subdir && $(MAKE) $@) || exit 1; \ + done swigify: $(MAKE) -C src swigify
@@ -10,28 +14,11 @@ pywrap: rubywrap: $(MAKE) -C src rubywrap -install: - $(MAKE) -C include install - $(MAKE) -C src install - $(MAKE) -C man install - $(MAKE) -C utils install - install-pywrap: $(MAKE) -C src install-pywrap install-rubywrap: $(MAKE) -C src install-rubywrap -relabel: - $(MAKE) -C src relabel - -clean distclean: - $(MAKE) -C src $@ - $(MAKE) -C tests $@ - -indent: - $(MAKE) -C src $@ - $(MAKE) -C include $@ - test: all $(MAKE) -C tests test
libsemanage/include/Makefile +1 -1
@@ -2,7 +2,7 @@ PREFIX ?= /usr INCDIR ?= $(PREFIX)/include/semanage -all: +all relabel clean distclean: install: all test -d $(DESTDIR)$(INCDIR) || install -m 755 -d $(DESTDIR)$(INCDIR)
libsemanage/man/Makefile +1 -1
@@ -7,7 +7,7 @@ MAN5SUBDIR ?= man5 MAN3DIR ?= $(MANDIR)/$(MAN3SUBDIR) MAN5DIR ?= $(MANDIR)/$(MAN5SUBDIR) -all: +all relabel clean distclean indent: install: all mkdir -p $(DESTDIR)$(MAN3DIR)
Signature · 1 line
2.47.0
Quoted 19 lines · On Wed, Nov 13, 2024 at 2:52 AM <[email protected]> wrote:
From: Dmitry Sharshakov <[email protected]>
Allow building without utils and man for minimalist builds which do not need those.
Also make the
Makefilemodular as in libselinux.Signed-off-by Dmitry Sharshakov <[email protected]>--- libsepol/Makefile | 27 +++++---------------------- libsepol/include/Makefile | 2 +- libsepol/man/Makefile | 2 +- 3 files changed, 7 insertions(+), 24 deletions(-)libsepol/Makefile +0
-0
libsepol/Makefile line 1
Quoted 1 line
libsepol/Makefile +1
-0@@ -1,29 +1,12 @@ +SUBDIRS = include src utils man
To allow specifying only some of the subdirectories wouldn't you have to use "SUBDIRS ?= include src utils man"?
This seems to always set SUBDIRS to include those subdirectories, but I am definitely not a Makefile guru.
Thanks,
Jim
Quoted 63 lines
libsepol/Makefile +4
-22DISABLE_CIL ?= n export DISABLE_CIL -all: - $(MAKE) -C src - $(MAKE) -C utils - -install: - $(MAKE) -C include install - $(MAKE) -C src install - $(MAKE) -C utils install - $(MAKE) -C man install - -relabel: - $(MAKE) -C src relabel - -clean: - $(MAKE) -C src clean - $(MAKE) -C utils clean - $(MAKE) -C tests clean - -indent: - $(MAKE) -C src $@ - $(MAKE) -C include $@ - $(MAKE) -C utils $@ +all install relabel clean indent: + @for subdir in $(SUBDIRS); do \ + (cd $$subdir && $(MAKE) $@) || exit 1; \ + done test: $(MAKE) -C tests testlibsepol/include/Makefile +1
-1@@ -3,7 +3,7 @@ PREFIX ?= /usr INCDIR = $(PREFIX)/include/sepol CILDIR ?= ../cil -all: +all relabel clean: install: all test -d $(DESTDIR)$(INCDIR) || install -m 755 -d $(DESTDIR)$(INCDIR)libsepol/man/Makefile +1
-2@@ -7,7 +7,7 @@ MAN8SUBDIR ?= man8 MAN3DIR ?= $(MANDIR)/$(MAN3SUBDIR) MAN8DIR ?= $(MANDIR)/$(MAN8SUBDIR) -all: +all relabel clean indent: install: all mkdir -p $(DESTDIR)$(MAN3DIR) --2.47.0