# ----------------------------------------------------------------------------
# Copyright (c) 2009 Solis. All rights reserved.
#
# Author: Ely Edison Matos
#
# This file is part of the Miolo Framework project.
# ----------------------------------------------------------------------------

DITA_DIR=c:\dita

DITAC=$(DITA_DIR)\ditac\bin\ditac.bat
 
#XEP=-xep E:\opt\xep413\xep.bat
FOP=-fop c:\dita\fop\fop
#XFC=-xfc E:\src\xfc\java\bin\fo2rtf.bat
#JHI=-jhindexer E:\opt\javahelp\javahelp\bin\jhindexer.bat
HHC=-hhc "C:\dita\winhelp\hhc.exe"

DOC_DIR=e:\miolo\miolo25\html\docs\helloworld

COMMON_OPTIONS= -ignoreoptionsfile -p number all -p use-note-icon yes

SCREEN_OPTIONS=-filter screen.ditaval -images images -p xsl-resources-directory resources \
	-p default-table-width "100%" -p mark-external-links yes  $(COMMON_OPTIONS)

PRINT_OPTIONS=-filter print.ditaval $(COMMON_OPTIONS)

OFFICE_OPTIONS=-filter screen.ditaval $(COMMON_OPTIONS)

# ----------------------------------------------------------------------------
all: clean xhtml htmlhelp pdf

xhtml: 
	$(DITAC) $(SCREEN_OPTIONS) -p chain-pages both -p chain-topics yes $(DOC_DIR)\_.html helloworld.ditamap 

javahelp:
	$(DITAC) $(JHI) $(SCREEN_OPTIONS) \
		$(DOC_DIR)/manual.jar helloworld.ditamap

htmlhelp:
	$(DITAC) $(HHC) $(SCREEN_OPTIONS) $(DOC_DIR)/helloworld.chm helloworld.ditamap

pdf:
	$(DITAC) $(FOP) $(PRINT_OPTIONS) -p justified yes -p hyphenate yes $(DOC_DIR)/helloworld.pdf helloworld.ditamap

pdf-fop:
	$(DITAC) $(FOP) $(PRINT_OPTIONS) \
		$(DOC_DIR)/manual-fop.pdf helloworld.ditamap

rtf: 
	$(DITAC) $(XFC) $(OFFICE_OPTIONS) \
		$(DOC_DIR)/manual.rtf helloworld.ditamap

wml:
	$(DITAC) $(XFC) $(OFFICE_OPTIONS) \
		$(DOC_DIR)/manual.word.xml helloworld.ditamap
	mv $(DOC_DIR)/manual.xml $(DOC_DIR)/manual.word.xml

docx:
	$(DITAC) $(XFC) $(OFFICE_OPTIONS) \
		$(DOC_DIR)/manual.docx helloworld.ditamap

odt:
	$(DITAC) $(XFC) $(OFFICE_OPTIONS) \
		$(DOC_DIR)/manual.odt helloworld.ditamap

# ----------------------------------------------------------------------------
clean:
	$(DITA_DIR)\clean e:\miolo\miolo25\html\docs\helloworld