msxbuild/lib/make/सिस्टमₚᵣₐᵧToੴ/mb_make_xml.mk
Willem Cazander 01345cb5ff
All checks were successful
Run test asserts / Test-Asserts (push) Successful in 3s
Added some machines and fixed c: drive boot disk support.
2024-07-19 02:12:39 +02:00

63 lines
2.6 KiB
Makefile
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

MB_MAKE_XML_LT := <
$(call mb-make-call,mb-doc-variable-rock,MB_MAKE_XML_LT,Expanded special char; lesser than.)
MB_MAKE_XML_GT := >
$(call mb-make-call,mb-doc-variable-rock,MB_MAKE_XML_GT,Expanded special char; greater than.)
MB_MAKE_XML_CDATA_START := <![CDATA[
$(call mb-make-call,mb-doc-variable-rock,MB_MAKE_XML_CDATA_START,Expanded special char; XML cdata start.)
MB_MAKE_XML_CDATA_END := ]]>
$(call mb-make-call,mb-doc-variable-rock,MB_MAKE_XML_CDATA_END,Expanded special char; XML cdata end.)
define mb-make-xml-prolog
$(MB_   )$(MB_MAKE_XML_LT)$\
$(MB_    )?xml version$(MB_MAKE_EQUALS)"1.0" ?$\
$(MB_   )$(MB_MAKE_XML_GT)
endef
$(call mb-make-call,mb-doc-function-deep,mb-make-xml-prolog,Print xml document prolog.)
define mb-make-xml-escape-attr-value
$(MB_   )$(subst ',&apos;,$(subst ",&quote;,$(subst &,&amp;,$(subst <,&lt;,$(subst >,&gt;,$(subst $(MB_MAKE_XML_CDATA_START),,$(subst $(MB_MAKE_XML_CDATA_END),,$(1))))))))
endef
$(call mb-make-call,mb-doc-function-deep,mb-make-xml-escape-attr-value,Prints escaped XML attribute value.,<value>)
define mb-make-xml-escape-tag-body
$(MB_   )$(subst $(MB_MAKE_XML_CDATA_START),,$(subst $(MB_MAKE_XML_CDATA_END),,$(1)))
endef
$(call mb-make-call,mb-doc-function-deep,mb-make-xml-escape-tag-body,Prints escaped XML element/tag body value.,<value>)
define mb-make-xml-open
$(MB_   )$(MB_MAKE_XML_LT)$(1)$\
$(MB_    )$(if $(2), $(2)$(MB_MAKE_EQUALS)"$(call mb-make-call,mb-make-xml-escape-attr-value,$(3))")$\
$(MB_    )$(if $(4), $(4)$(MB_MAKE_EQUALS)"$(call mb-make-call,mb-make-xml-escape-attr-value,$(5))")$\
$(MB_   )$(MB_MAKE_XML_GT)
endef
$(call mb-make-call,mb-doc-function-deep,mb-make-xml-open,Print xml open tag.,<tag> [attr1-name] [attr1-value] [attr2-name] [attr2-value])
define mb-make-xml-close
$(MB_   )$(MB_MAKE_XML_LT)/$(1)$(MB_MAKE_XML_GT)
endef
$(call mb-make-call,mb-doc-function-deep,mb-make-xml-close,Print xml close tag.,<tag>)
define mb-make-xml-value
$(MB_   )$(MB_MAKE_XML_CDATA_START)$\
$(MB_    )$(call mb-make-call,mb-make-xml-escape-tag-body,$(1))$\
$(MB_   )$(MB_MAKE_XML_CDATA_END)
endef
$(call mb-make-call,mb-doc-function-deep,mb-make-xml-value,Print xml value in cdata wrapper.,<value>)
define mb-make-xml-tag-value
$(MB_   )$(if $(2),$(call mb-make-call,mb-make-xml-open,$(1))$(call mb-make-call,mb-make-xml-value,$(2))$(call mb-make-call,mb-make-xml-close,$(1)))
endef
$(call mb-make-call,mb-doc-function-deep,mb-make-xml-tag-value,Print xml tag with value inside.,<tag> [value])