# Makefile for 'infodoc.info' and 'infodoc.html'
# Invoke using 'gmake'
# Mahlon R. Smith
# Tools: gmake    (any modern version)
#        makeinfo (version 6.1 or higher)
# 
# 30-Jun-2020
# 
# 1) Builds the document in both '.info' format and '.html' format.
#    'infodoc.info' is the reference document
#    'infodoc.html' is the test document (default style formatting only)
#
# 2) The styled HTML, 'infodoc_css.html' is done using the 'idpp' Infodoc Post 
#    Processor utility. Instructions for applying the CSS style definition can 
#    be found in the 'info' document:
#             info -f infodoc.info -n 'Testing Overview', 
#    in the section 'Rebuilding the info and HTML documents'
# 
# 3) Automatic inclusion of the CSS style definitions during the build is 
#    possible (see below), but some manual adjustment will still be necessary. 
#    See full documentation for details.
# 

infodoc.info: infodoc_00_menu.texi \
              infodoc_01_overview.texi \
              infodoc_02_cssstyle.texi \
              infodoc_03_postproc.texi \
              infodoc_04_makeinfo.texi \
              infodoc_05_idpp.texi \
              infodoc_06_support.texi \
              texi_macros.texi \
              same_author.texi
	makeinfo --fill-column=78 --no-split infodoc_00_menu.texi
	makeinfo --fill-column=78 --html --no-split infodoc_00_menu.texi

	
.PHONY: clean
clean:
	rm -f infodoc.info infodoc.html infodoc_css.html 1>/dev/null 2>/dev/null


	
# The following is for testing of customization variables ONLY.
# This option IS NOT for production builds.
# invocation: gmake custvar CV='DOCTYPE=\<!DOCTYPE\ html\>'
#             (with the following as the switch line)
#	-c $ ${CV} \
.PHONY: custvar
custvar:
	makeinfo --output=infovar.html --fill-column=78 --html --no-split \
	-c $ ${CV} \
	infodoc_00_menu.texi


# This option builds the HTML output with the 'infodoc-styles.css' file 
# embedded directly into the build. This is done for testing purposes only.
# We are not big fans of automagical manipulation of our software, and in our 
# opinion, this is just too messy and dangerous to be useful.
.PHONY: includecss
includecss:
	makeinfo --output=infodoc_css_included.html --fill-column=78 --html \
   --no-split --css-include=infodoc-styles.css infodoc_00_menu.texi

