# ----------------------------------------------------------------------------
# Copyright (c) 2017-2025 XMLmind Software. All rights reserved.
#
# Author: Hussein Shafie
#
# This file is part of the XMLmind Assembly Processor project.
# For conditions of distribution and use, see the accompanying legal.txt file.
# ----------------------------------------------------------------------------

DOC_DIR=../../doc/manual

# ----------------------------------------------------------------------------
all:
	./convert_manual.sh

# ----------------------------------------------------------------------------
# Alternatively, one may use xxeconvert
# ----------------------------------------------------------------------------

COMMON_OPTS=-p highlight.source 1

SCREEN_OPTS=$(COMMON_OPTS) \
	-p chunk.section.depth 0 \
	-p section.autolabel 1 \
	-p section.label.includes.component.label 1 \
	-p use.id.as.filename 1 \
	-p callout.graphics 0

PRINT_OPTS=$(COMMON_OPTS) \
	-p section.autolabel 1 \
	-p section.label.includes.component.label 1 \
	-p variablelist.as.blocks 1 \
	-p ulink.show 0 \
	-p callout.graphics 0 \
	-p shade.verbatim 1

XXECONVERT=../../../11xxe/bin/xxeconvert

html:
	@echo "***Select Output=web to discard back_of_book_index.html"
	$(XXECONVERT) $(SCREEN_OPTS) \
		asm.toHTML manual.xml -u out/manual

pdf:
	@echo "***Select Output= (default:print) to get back_of_book_index.html"
	$(XXECONVERT) -fop $(PRINT_OPTS) \
		asm.toPSFile manual.xml \
		-s pdf -s "|pdf" -u out/manual.pdf

# ----------------------------------------------------------------------------
realize_web:
	../../bin/assembly -check -v -format web manual.xml \
		out/manual_realized_web.xml

# ----------------------------------------------------------------------------
clean:
	rm -rf *~ out/*

distclean: clean

realclean: distclean
	rm -rf $(DOC_DIR)/*
