[PATCH v1 2/2] libsemanage: 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>
---
 libsemanage/Makefile         | 25 ++++++-------------------
 libsemanage/include/Makefile |  2 +-
 libsemanage/man/Makefile     |  2 +-
 3 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/libsemanage/Makefile b/libsemanage/Makefile
index 390176fe..66c45c5a 100644
--- a/libsemanage/Makefile
+++ b/libsemanage/Makefile
@@ -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
diff --git a/libsemanage/include/Makefile b/libsemanage/include/Makefile
index 6e44a28a..c08aafec 100644
--- a/libsemanage/include/Makefile
+++ b/libsemanage/include/Makefile
@@ -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)
diff --git a/libsemanage/man/Makefile b/libsemanage/man/Makefile
index 5e21a65e..88143db8 100644
--- a/libsemanage/man/Makefile
+++ b/libsemanage/man/Makefile
@@ -7,7 +7,7 @@ MAN5SUBDIR ?= man5
 MAN3DIR ?= $(MANDIR)/$(MAN3SUBDIR)
 MAN5DIR ?= $(MANDIR)/$(MAN5SUBDIR)
 
-all:
+all relabel clean distclean 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