[sr-dev] git:master: makefile: don't try to build docs for empty modules

Andrei Pelinescu-Onciul andrei at iptel.org
Tue Sep 21 17:39:14 CEST 2010


Module: sip-router
Branch: master
Commit: c0c4a3a24001e40a89e3819f6407346fe1fdf0cd
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c0c4a3a24001e40a89e3819f6407346fe1fdf0cd

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date:   Tue Sep 21 17:34:40 2010 +0200

makefile: don't try to build docs for empty modules

- don't try to build READMEs for modules directories without
  Makefiles
- don't try to build manpages for modules that do not have the
  corresponding xml file
- don't install docs for modules without Makefiles (remains of
 deleted modules)

---

 Makefile |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 7cb480a..311a16c 100644
--- a/Makefile
+++ b/Makefile
@@ -616,7 +616,7 @@ $(1): modules.lst
 .PHONY: $(1)-doc
 $(1)-doc: modules.lst
 	+ at for r in $($(1)) "" ; do \
-		if [ -n "$$$$r" ]; then \
+		if [ -n "$$$$r" -a -r "$$$$r/Makefile" ]; then \
 			$(call oecho, "" ;) \
 			$(call oecho, "" ;) \
 			$(MAKE) -C $$$$r/doc $(doc_format) $$(mk_params); \
@@ -627,7 +627,7 @@ $(1)-doc: modules.lst
 
 $(1)-readme: modules.lst
 	-+ at for r in $($(1)) "" ; do \
-		if [ -n "$$$$r" ]; then \
+		if [ -n "$$$$r" -a -r "$$$$r/Makefile" ]; then \
 			$(call oecho, "" ;) \
 			$(call oecho, "" ;) \
 			if  $(MAKE) -C $$$$r $$(mk_params) README || [ ${err_fail} != 1 ];\
@@ -641,11 +641,13 @@ $(1)-readme: modules.lst
 
 .PHONY: $(1)-man
 $(1)-man: modules.lst
-	-+ at for r in $($(1)) "" ; do \
-		if [ -n "$$$$r" ]; then \
+	-+ at for r in $($(1)_basenames) "" ; do \
+		if [ -n "$$$$r" -a -r $(1)/"$$$$r/Makefile" -a \
+			 -r $(1)/"$$$$r/$$$$r.xml" ]; then \
 			$(call oecho, "" ;) \
 			$(call oecho, "" ;) \
-			if  $(MAKE) -C $$$$r $$(mk_params) man || [ ${err_fail} != 1 ] ;\
+			if  $(MAKE) -C $(1)/"$$$$r" $$(mk_params) man || \
+				[ ${err_fail} != 1 ] ;\
 			then \
 				:; \
 			else \
@@ -675,7 +677,7 @@ install-$(1): modules.lst $$($(1)_dst)
 
 install-$(1)-doc: modules.lst $(doc_prefix)/$(doc_dir)$(1)
 	@for r in $($(1)_basenames) "" ; do \
-		if [ -n "$$$$r" ]; then \
+		if [ -n "$$$$r" -a -r $(1)/"$$$$r/Makefile" ]; then \
 			if [ -f $(1)/"$$$$r"/README ]; then \
 				$$(call try_err,\
 					$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)$(1)/README ); \
@@ -693,7 +695,7 @@ install-$(1)-doc: modules.lst $(doc_prefix)/$(doc_dir)$(1)
 
 install-$(1)-man: $(1)-man $(man_prefix)/$(man_dir)/man7
 	@for r in $($(1)_basenames) "" ; do \
-		if [ -n "$$$$r" ]; then \
+		if [ -n "$$$$r" -a -r $(1)/"$$$$r/Makefile" ]; then \
 			if [ -f $(1)/"$$$$r"/"$$$$r".7 ]; then \
 				$$(call try_err,\
 				  $(INSTALL_TOUCH) $(man_prefix)/$(man_dir)/man7/"$$$$r".7 );\




More information about the sr-dev mailing list