Fix build reproducibility in Make 3.82
[buildroot-gz.git] / docs / manual / manual.mk
blobbcbedad572f970c314b36abb01eee49eb149b41b
1 manual-update-lists:
2 $(Q)$(call MESSAGE,"Updating the manual lists...")
3 $(Q)BR2_DEFCONFIG="" TOPDIR=$(TOPDIR) O=$(O)/docs/manual/.build \
4 $(TOPDIR)/support/scripts/gen-manual-lists.py
6 ################################################################################
7 # GENDOC -- generates the make targets needed to build a specific type of
8 # asciidoc documentation.
10 # argument 1 is the name of the document and must be a subdirectory of docs/;
11 # the top-level asciidoc file must have the same name
12 # argument 2 is the type of document to generate (-f argument of a2x)
13 # argument 3 is the document type as used in the make target
14 # argument 4 is the output file extension for the document type
15 # argument 5 is the human text for the document type
16 # argument 6 (optional) are extra arguments for a2x
18 # The variable <DOCUMENT_NAME>_SOURCES defines the dependencies.
19 ################################################################################
20 define GENDOC_INNER
21 $(1): $(1)-$(3)
22 .PHONY: $(1)-$(3)
23 $(1)-$(3): $$(O)/docs/$(1)/$(1).$(4)
25 $$(O)/docs/$(1)/$(1).$(4): docs/$(1)/$(1).txt \
26 $$($(call UPPERCASE,$(1))_SOURCES) \
27 manual-update-lists
28 $(Q)$(call MESSAGE,"Generating $(5) $(1)...")
29 $(Q)mkdir -p $$(@D)/.build
30 $(Q)rsync -au docs/$(1)/*.txt $$(@D)/.build
31 $(Q)a2x $(6) -f $(2) -d book -L -r $(TOPDIR)/docs/images \
32 -D $$(@D) $$(@D)/.build/$(1).txt
33 -$(Q)rm -rf $$(@D)/.build
34 endef
36 ################################################################################
37 # GENDOC -- generates the make targets needed to build asciidoc documentation.
39 # argument 1 is the name of the document and must be a subdirectory of docs/;
40 # the top-level asciidoc file must have the same name
42 # The variable <DOCUMENT_NAME>_SOURCES defines the dependencies.
43 ################################################################################
44 define GENDOC
45 $(call GENDOC_INNER,$(1),xhtml,html,html,HTML,--xsltproc-opts "--stringparam toc.section.depth 4")
46 $(call GENDOC_INNER,$(1),chunked,split-html,chunked,Split HTML,--xsltproc-opts "--stringparam toc.section.depth 4")
47 $(call GENDOC_INNER,$(1),pdf,pdf,pdf,PDF,--dblatex-opts "-P latex.output.revhistory=0")
48 $(call GENDOC_INNER,$(1),text,txt,text,Text)
49 $(call GENDOC_INNER,$(1),epub,epub,epub,EPUB)
50 clean: $(1)-clean
51 $(1)-clean:
52 $(Q)$(RM) -rf $(O)/docs/$(1)
53 .PHONY: $(1) $(1)-clean manual-update-lists
54 endef
56 MANUAL_SOURCES = $(sort $(wildcard docs/manual/*.txt) $(wildcard docs/images/*))
57 $(eval $(call GENDOC,manual))