diff options
author | Richard Braun <rbraun@sceen.net> | 2017-09-24 00:31:48 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-09-24 00:36:25 +0200 |
commit | 9c6bfa68716ba802b12c0c8898f8b8dee7c57e99 (patch) | |
tree | 381b2d0ba1d195f58785e91b2a58c15913f7949f | |
parent | cf79bad4b192d4a22833032b189e6e14df5cbbb2 (diff) |
Rework cleaning and installation targets
-rw-r--r-- | Makefile | 27 | ||||
-rw-r--r-- | doc/Makefile | 34 |
2 files changed, 42 insertions, 19 deletions
@@ -159,10 +159,17 @@ help: @printf ' all - Build all targets marked with [*]\n' @printf '* x15 - Build the kernel ELF image\n' @printf '\n' + @printf 'Documentation targets:\n' + @printf '* docs - Build all documentation\n' $(DOC_HELP) + @printf '\n' @printf 'Installation targets:\n' @printf ' install - Install the kernel and documentation\n' @printf ' install-strip - Same as install but also strip the kernel\n' + @printf ' install-x15 - Install the kernel only\n' + @printf ' install-strip-x15 - Same as install-x15 but also strip the kernel\n' + @printf ' install-docs - Install documentation files\n' + $(DOC_INSTALL_HELP) @printf '\n' @printf 'Architecture specific targets ($(ARCH)):\n' @$(if $(BOARDS), \ @@ -316,18 +323,26 @@ x15_DEPS := $(x15_LDS) .x15.sorted_init_ops x15: $(x15_OBJECTS) $(x15_DEPS) $(call xbuild_link,$(x15_OBJECTS)) -.PHONY: install install-strip -install: docs_install +.PHONY: install-x15 +install-x15: install -D -m 644 x15 $(DESTDIR)/boot/x15 -install-strip: docs_install +.PHONY: install-strip-x15 +install-strip-x15: install -s -D -m 644 x15 $(DESTDIR)/boot/x15 -.PHONY: clean distclean -clean: docs_clean +.PHONY: install +install: install-x15 install-docs + +.PHONY: install-strip +install-strip: install-strip-x15 install-docs + +.PHONY: clean +clean: clean-docs $(Q)$(MAKE) -f $(SRCDIR)/$(KCONFIG_PATH)/Makefile $@ $(call xbuild_clean) -distclean: clean docs_distclean +.PHONY: distclean +distclean: clean distclean-docs $(Q)$(MAKE) -f $(SRCDIR)/$(KCONFIG_PATH)/Makefile $@ $(call xbuild_distclean) diff --git a/doc/Makefile b/doc/Makefile index 2d49dd1f..843cbee8 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -14,11 +14,13 @@ ASCIIDOC_MANDOCS := $(patsubst %.9.txt,%.9,$(ASCIIDOC_SOURCES)) ASCIIDOC_HTMLDOCS := $(patsubst %.9.txt,%.9.html,$(ASCIIDOC_SOURCES)) define DOC_HELP - @printf 'Documentation targets:\n' - @printf ' docs - Build all documentation\n' - @printf ' mandocs - Build man pages\n' - @printf ' htmldocs - Build HTML man pages\n' - @printf '\n' + @printf '* mandocs - Build man pages\n' + @printf '* htmldocs - Build HTML man pages\n' +endef + +define DOC_INSTALL_HELP + @printf ' install-mandocs - Install man pages\n' + @printf ' install-htmldocs - Install HTML man pages\n' endef # Expose intermediate DocBook files for correct parallel builds. @@ -50,6 +52,12 @@ endef %_man_install: doc/% install -D -m 644 $< $(DESTDIR)$(PREFIX)/$(DATAROOTDIR)/man/man9/$* +.PHONY: install-mandocs +install-mandocs: $(mandocs_install_targets) + +.PHONY: install-htmldocs +install-htmldocs: $(htmldocs_install_targets) + define htmldocs_install_targets $(foreach htmlpage,$(notdir $(ASCIIDOC_HTMLDOCS)),$(htmlpage)_html_install) endef @@ -57,17 +65,17 @@ endef %_html_install: doc/% install -D -m 644 $< $(DESTDIR)$(PREFIX)/$(DATAROOTDIR)/doc/x15/$* -.PHONY: docs_install -docs_install: $(mandocs_install_targets) $(htmldocs_install_targets) +.PHONY: install-docs +install-docs: install-mandocs install-htmldocs -define docs_clean +define clean_docs $(Q)rm -f $(ASCIIDOC_MANDOCS) \ $(ASCIIDOC_HTMLDOCS) endef -.PHONY: docs_clean -docs_clean: - $(call docs_clean) +.PHONY: clean-docs +clean-docs: + $(call clean_docs) -.PHONY: docs_distclean -docs_distclean: +.PHONY: distclean-docs +distclean-docs: clean-docs |