# This Makefile is for the ExIT issue tracking system.
# For more information about ExIT, see 
# http://www.w3.org/2003/12/exit/

# The value of the URI variable is the URI to the
# primary XML file containing your issues.
# You MUST provide a value
# Example:
#  URI=http://www.w3.org/2001/tag/issues.xml
URI=http://www.example.com/issues/

# The value of the XSL_ENGINE variable is the command
# to process the XSLT 1.0 files of ExIT. Note that
# you MAY have to change the order of the parameters
# in the rules below if you change the value of
# XSL_ENGINE
# For more information about xsltproc, see
#  http://xmlsoft.org/XSLT/xsltproc2.html
XSL_ENGINE=xsltproc

## Normally, you should not have to change anything
## else below this line

# The value of the EXITPATH XSLT files If you wish to generate OFILES
# from other copies of the ExIT files (XSLT, CSS, and ECMASCRIPT); set
# EXITXSLPATH appropriately. Unless you are developing ExIT, you should
# not change the value of this variable.
EXITXSLPATH=http://dev.w3.org/cvsweb/~checkout~/2004/issues/xsl/

# You should normally not modify the rest of the file, except
# if you are using a different XSL_ENGINE.
OFILES=issues.html 

#The rest of these would normally go in OFILES, but
#are commented out here for the purposes of the demo.

#graph_states.svg graph_types.svg concerning.html\
# actions.html actions_owner.html originators.html\
# ack_sort.html state_sort.html type_sort.html

.SUFFIXES: .iss .xml

# Each individual file is xi:include'd. Note that
# the order is important: issues.xml must 
# be at the end of IFILES
IFILES=i1.xml i2.xml i3.xml issues.xml 
ISSUES=issues.xml 

MAINFILE=$(EXITXSLPATH)main.xsl

all: $(IFILES) $(OFILES)

#### NOTE
# The namespace URI of XInclude is likely to change.
# When it does, it will be necessary to update it in the
# issues.xml head

.iss.xml:
	$(XSL_ENGINE) \
	"$(EXITXSLPATH)xinclude.xsl" $< |\
	$(XSL_ENGINE) \
	"$(EXITXSLPATH)abbr2full.xsl" - > $@

issues.html: $(IFILES)
	$(XSL_ENGINE) \
         --stringparam exitxslpath "$(EXITXSLPATH)" \
         --stringparam uri-to-issues-xml "$(URI)" \
         "$(MAINFILE)" $(ISSUES) > $@

ack_sort.html: $(IFILES)
	$(XSL_ENGINE) \
         --stringparam exitxslpath "$(EXITXSLPATH)" \
         --stringparam sort-key ack \
         --stringparam uri-to-issues-xml "$(URI)" \
         "$(MAINFILE)" $(ISSUES) > $@

type_sort.html: $(IFILES)
	$(XSL_ENGINE) \
         --stringparam exitxslpath "$(EXITXSLPATH)" \
         --stringparam sort-key type \
         --stringparam uri-to-issues-xml "$(URI)" \
         "$(MAINFILE)" $(ISSUES) > $@

state_sort.html: $(IFILES)
	$(XSL_ENGINE) \
         --stringparam exitxslpath "$(EXITXSLPATH)" \
         --stringparam sort-key state \
         --stringparam uri-to-issues-xml "$(URI)" \
         "$(MAINFILE)" $(ISSUES) > $@

graph_states.svg: $(IFILES)
	$(XSL_ENGINE) \
         --stringparam exitxslpath "$(EXITXSLPATH)" \
	"$(EXITXSLPATH)graph_state.xsl" $(ISSUES) > $@

graph_types.svg: $(IFILES)
	$(XSL_ENGINE) \
         --stringparam exitxslpath "$(EXITXSLPATH)" \
	"$(EXITXSLPATH)graph_types.xsl" $(ISSUES) > $@

concerning.html: $(IFILES)
	$(XSL_ENGINE) \
         --stringparam exitxslpath "$(EXITXSLPATH)" \
	"$(EXITXSLPATH)concerning.xsl" $(ISSUES) > $@

actions.html: $(IFILES)
	$(XSL_ENGINE) \
         --stringparam exitxslpath "$(EXITXSLPATH)" \
	"$(EXITXSLPATH)actions.xsl" $(ISSUES) > $@

actions_owner.html: $(IFILES)
	$(XSL_ENGINE) \
         --stringparam exitxslpath "$(EXITXSLPATH)" \
	"$(EXITXSLPATH)actions_owner.xsl" $(ISSUES) > $@

originators.html: $(IFILES)
	$(XSL_ENGINE) \
         --stringparam exitxslpath "$(EXITXSLPATH)" \
	"$(EXITXSLPATH)originators.xsl" $(ISSUES) > $@

clean:
	rm -f $(IFILES) $(OFILES)
