<commit_before># -----------------------------------------------------------------------------
#
# (c) 2009 The University of Glasgow
#
# This file is part of the GHC build system.
#
# To understand how the build system works and how to modify it, see
#      http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
#      http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
#
# -----------------------------------------------------------------------------


# Build docbook docs

define docbook
# $1 = dir
# $2 = docname

$(call clean-target,$1,docbook,$1/$2 $1/$2.pdf $1/$2.ps)

ifeq "$$(BUILD_DOCBOOK_HTML)" "YES"
$(call all-target,$1,html_$1)

.PHONY: html_$1
html_$1 : $1/$2/index.html

$1/$2/index.html: $$($1_DOCBOOK_SOURCES)
	$$(RM) -r $$(dir $$@)
	$$(XSLTPROC) --stringparam base.dir $$(dir $$@) \
	             --stringparam use.id.as.filename 1 \
	             --stringparam html.stylesheet fptools.css \
	             $$(XSLTPROC_LABEL_OPTS) $$(XSLTPROC_OPTS) \
	             $$(DIR_DOCBOOK_XSL)/html/chunk.xsl $1/$2.xml
	cp mk/fptools.css $$(dir $$@)
endif

ifeq "$$(BUILD_DOCBOOK_PS)" "YES"
$(call all-target,$1,ps_$1)

.PHONY: ps_$1
ps_$1 : $1/$2.ps

$1/$2.ps: $$($1_DOCBOOK_SOURCES)
	$$(DBLATEX) $$(DBLATEX_OPTS) $1/$2.xml --ps -o $$@
endif

ifeq "$$(BUILD_DOCBOOK_PDF)" "YES"
$(call all-target,$1,pdf_$1)
<commit_msg>fix it so that 'make' on its own works even if we're not building docs<commit_after># -----------------------------------------------------------------------------
#
# (c) 2009 The University of Glasgow
#
# This file is part of the GHC build system.
#
# To understand how the build system works and how to modify it, see
#      http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
#      http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
#
# -----------------------------------------------------------------------------


# Build docbook docs

define docbook
# $1 = dir
# $2 = docname

$(call clean-target,$1,docbook,$1/$2 $1/$2.pdf $1/$2.ps)

# empty "all_$1" target just in case we're not building docs at all
$(call all-target,$1,)

ifeq "$$(BUILD_DOCBOOK_HTML)" "YES"
$(call all-target,$1,html_$1)

.PHONY: html_$1
html_$1 : $1/$2/index.html

$1/$2/index.html: $$($1_DOCBOOK_SOURCES)
	$$(RM) -r $$(dir $$@)
	$$(XSLTPROC) --stringparam base.dir $$(dir $$@) \
	             --stringparam use.id.as.filename 1 \
	             --stringparam html.stylesheet fptools.css \
	             $$(XSLTPROC_LABEL_OPTS) $$(XSLTPROC_OPTS) \
	             $$(DIR_DOCBOOK_XSL)/html/chunk.xsl $1/$2.xml
	cp mk/fptools.css $$(dir $$@)
endif

ifeq "$$(BUILD_DOCBOOK_PS)" "YES"
$(call all-target,$1,ps_$1)

.PHONY: ps_$1
ps_$1 : $1/$2.ps

$1/$2.ps: $$($1_DOCBOOK_SOURCES)
	$$(DBLATEX) $$(DBLATEX_OPTS) $1/$2.xml --ps -o $$@
endif

ifeq "$$(BUILD_DOCBOOK_PDF)" "YES"
$(call all-target,$1,pdf_$1)

{'fraction_non_alphanumeric': 0.28014059753954307, 'fraction_numerical': 0.02741652021089631, 'mean_word_length': 2.197752808988764, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2435783', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1069, 'n_words': 224}