[PATCH v1 1/2] libsepol: allow specifying SUBDIRS when building

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Dmitry Sharshakov <dmitry.sharshakov@xxxxxxxxxxxxxx>

Allow building without utils and man for minimalist builds which do not need those.

Also make the Makefile modular as in libselinux.

Signed-off-by: Dmitry Sharshakov <dmitry.sharshakov@xxxxxxxxxxxxxx>
---
 libsepol/Makefile         | 27 +++++----------------------
 libsepol/include/Makefile |  2 +-
 libsepol/man/Makefile     |  2 +-
 3 files changed, 7 insertions(+), 24 deletions(-)

diff --git a/libsepol/Makefile b/libsepol/Makefile
index 5b5d03e2..e354d3cb 100644
--- a/libsepol/Makefile
+++ b/libsepol/Makefile
@@ -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
diff --git a/libsepol/include/Makefile b/libsepol/include/Makefile
index 1ad4ecab..8d64e846 100644
--- a/libsepol/include/Makefile
+++ b/libsepol/include/Makefile
@@ -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)
diff --git a/libsepol/man/Makefile b/libsepol/man/Makefile
index 0b410c19..6017ff51 100644
--- a/libsepol/man/Makefile
+++ b/libsepol/man/Makefile
@@ -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





[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux