Browse code

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)

Andrei Pelinescu-Onciul authored on 21/09/2010 15:34:40
Showing 1 changed files
... ...
@@ -616,7 +616,7 @@ $(1): modules.lst
616 616
 .PHONY: $(1)-doc
617 617
 $(1)-doc: modules.lst
618 618
 	+@for r in $($(1)) "" ; do \
619
-		if [ -n "$$$$r" ]; then \
619
+		if [ -n "$$$$r" -a -r "$$$$r/Makefile" ]; then \
620 620
 			$(call oecho, "" ;) \
621 621
 			$(call oecho, "" ;) \
622 622
 			$(MAKE) -C $$$$r/doc $(doc_format) $$(mk_params); \
... ...
@@ -627,7 +627,7 @@ $(1)-doc: modules.lst
627 627
 
628 628
 $(1)-readme: modules.lst
629 629
 	-+@for r in $($(1)) "" ; do \
630
-		if [ -n "$$$$r" ]; then \
630
+		if [ -n "$$$$r" -a -r "$$$$r/Makefile" ]; then \
631 631
 			$(call oecho, "" ;) \
632 632
 			$(call oecho, "" ;) \
633 633
 			if  $(MAKE) -C $$$$r $$(mk_params) README || [ ${err_fail} != 1 ];\
... ...
@@ -641,11 +641,13 @@ $(1)-readme: modules.lst
641 641
 
642 642
 .PHONY: $(1)-man
643 643
 $(1)-man: modules.lst
644
-	-+@for r in $($(1)) "" ; do \
645
-		if [ -n "$$$$r" ]; then \
644
+	-+@for r in $($(1)_basenames) "" ; do \
645
+		if [ -n "$$$$r" -a -r $(1)/"$$$$r/Makefile" -a \
646
+			 -r $(1)/"$$$$r/$$$$r.xml" ]; then \
646 647
 			$(call oecho, "" ;) \
647 648
 			$(call oecho, "" ;) \
648
-			if  $(MAKE) -C $$$$r $$(mk_params) man || [ ${err_fail} != 1 ] ;\
649
+			if  $(MAKE) -C $(1)/"$$$$r" $$(mk_params) man || \
650
+				[ ${err_fail} != 1 ] ;\
649 651
 			then \
650 652
 				:; \
651 653
 			else \
... ...
@@ -675,7 +677,7 @@ install-$(1): modules.lst $$($(1)_dst)
675 675
 
676 676
 install-$(1)-doc: modules.lst $(doc_prefix)/$(doc_dir)$(1)
677 677
 	@for r in $($(1)_basenames) "" ; do \
678
-		if [ -n "$$$$r" ]; then \
678
+		if [ -n "$$$$r" -a -r $(1)/"$$$$r/Makefile" ]; then \
679 679
 			if [ -f $(1)/"$$$$r"/README ]; then \
680 680
 				$$(call try_err,\
681 681
 					$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)$(1)/README ); \
... ...
@@ -693,7 +695,7 @@ install-$(1)-doc: modules.lst $(doc_prefix)/$(doc_dir)$(1)
693 693
 
694 694
 install-$(1)-man: $(1)-man $(man_prefix)/$(man_dir)/man7
695 695
 	@for r in $($(1)_basenames) "" ; do \
696
-		if [ -n "$$$$r" ]; then \
696
+		if [ -n "$$$$r" -a -r $(1)/"$$$$r/Makefile" ]; then \
697 697
 			if [ -f $(1)/"$$$$r"/"$$$$r".7 ]; then \
698 698
 				$$(call try_err,\
699 699
 				  $(INSTALL_TOUCH) $(man_prefix)/$(man_dir)/man7/"$$$$r".7 );\