From: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx> Modify the Documentation Makefile to only rebuild the man pages when their source has been modified. Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx> --- Documentation/Makefile | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index 21bcd5e..ede2930 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -11,7 +11,7 @@ MAN3_TXT= \ MAN_TXT = $(MAN3_TXT) _MAN_XML=$(patsubst %.txt,%.xml,$(MAN_TXT)) _MAN_HTML=$(patsubst %.txt,%.html,$(MAN_TXT)) -_DOC_MAN3=$(patsubst %.txt,%.3,$(MAN3_TXT)) +_DOC_MAN3=$(patsubst %.txt,%.m,$(MAN3_TXT)) MAN_XML=$(addprefix $(OUTPUT),$(_MAN_XML)) MAN_HTML=$(addprefix $(OUTPUT),$(_MAN_HTML)) @@ -154,17 +154,22 @@ ifdef missing_tools $(error "You need to install $(missing_tools) for man pages") endif -do-install-man: man +install-%.3: $(OUTPUT)%.3 $(call QUIET_INSTALL, Documentation-man) \ $(INSTALL) -d -m 755 $(DESTDIR)$(man3dir); \ - $(INSTALL) -m 644 $(OUTPUT)*.3 $(DESTDIR)$(man3dir); + $(INSTALL) -m 644 $< $(DESTDIR)$(man3dir); -install-man: check-man-tools man do-install-man +do-install-man: man $(addprefix install-,$(wildcard $(OUTPUT)*.3)) -do-install-html: html +install-man: check-man-tools man + $(Q)$(MAKE) -C . do-install-man + +install-%.txt: $(OUTPUT)%.html $(call QUIET_INSTALL, Documentation-html) \ $(INSTALL) -d -m 755 $(DESTDIR)$(htmldir); \ - $(INSTALL) -m 644 $(OUTPUT)*.html $(DESTDIR)$(htmldir); + $(INSTALL) -m 644 $< $(DESTDIR)$(htmldir); + +do-install-html: html $(addprefix install-,$(wildcard *.txt)) install-html: check-man-tools html do-install-html @@ -187,7 +192,7 @@ endif CLEAN_FILES = \ $(MAN_XML) $(addsuffix +,$(MAN_XML)) \ $(MAN_HTML) $(addsuffix +,$(MAN_HTML)) \ - $(DOC_MAN3) *.3 + $(DOC_MAN3) *.3 *.m clean: $(call QUIET_CLEAN, Documentation) $(RM) $(CLEAN_FILES) @@ -200,9 +205,10 @@ $(OUTPUT)%.3 : $(OUTPUT)%.txt mv $@+ $@ endif -$(OUTPUT)%.3 : $(OUTPUT)%.xml +$(OUTPUT)%.m : $(OUTPUT)%.xml $(QUIET_XMLTO)$(RM) $@ && \ - $(XMLTO) -o $(OUTPUT). -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< + $(XMLTO) -o $(OUTPUT). -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<; \ + touch $@ $(OUTPUT)%.xml : %.txt $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ -- 2.29.2