Makefile: "make EXPOSEMODE=yes" feature

Signed-off-by: Osamu Aoki <osamu@debian.org>
This commit is contained in:
Osamu Aoki 2024-02-01 21:48:42 +09:00
parent 3f91223aa3
commit b0098b9b89

View file

@ -51,6 +51,17 @@ BUILD_DIR := $(CURDIR)/build
#DRAFTMODE := yes
DRAFTMODE := maybe
export DRAFTMODE
# define EXPOSEMODE to yes to expose program listings to make entity
EXPOSEMODE ?= no
ifeq "$(EXPOSEMODE)" "yes"
XML_COMMENT_START=
XML_COMMENT_END=
else
XML_COMMENT_START= <!--
XML_COMMENT_END= -->
endif
# Prevent external environment vriables to impact build result
TZ := "0"
export TZ
@ -427,7 +438,11 @@ $(MANUAL).en.xml: $(DRAW)/$(MANUAL).rawxml $(DRAW)/header.rawxml
$(XPNO) $(DXSL)/table.xsl $(DRAW)/$(MANUAL).rawxml |\
$(DBIN)/colspec.py |\
sed -e '/<!DOCTYPE /d' -e "1r $(DRAW)/header.rawxml" |\
sed -e 's/@-@amp@-@/\&/g' -e 's/@-@\([^@]\+\)@-@/\&\1;/g' > $@
sed -e 's/@-@amp@-@/\&/g' \
-e 's/@-@XML_COMMENT_START@-@/$(XML_COMMENT_START)/g' \
-e 's/@-@XML_COMMENT_END@-@/$(XML_COMMENT_END)/g' \
-e 's/@-@\([^@]\+\)@-@/\&\1;/g' \
> $@
# Replace table contents with dummy text and
# fix URL references and table ID as the template for translation.
@ -439,7 +454,11 @@ $(MANUAL).en.xmlt: $(DRAW)/$(MANUAL).rawxml $(DRAW)/header.rawxml
$(XPNO) $(DXSL)/tablet.xsl $(DRAW)/$(MANUAL).rawxml |\
$(DBIN)/colspec.py |\
sed -e '/<!DOCTYPE /d' -e "1r $(DRAW)/header.rawxml" |\
sed -e 's/@-@amp@-@/\&/g' -e 's/@-@\([^@]\+\)@-@/\&\1;/g' > $@
sed -e 's/@-@amp@-@/\&/g' \
-e 's/@-@XML_COMMENT_START@-@/$(XML_COMMENT_START)/g' \
-e 's/@-@XML_COMMENT_END@-@/$(XML_COMMENT_END)/g' \
-e 's/@-@\([^@]\+\)@-@/\&\1;/g' \
> $@
#######################################################################
# Phase 3 build : English XML -> POT/PO/XML non-ENGLISH