Newer
Older
XML / Makefile
  1. ################################################################################
  2. #
  3. # File: $Id$
  4. #
  5. # Makefile for building the INFO database courses XML formatting stylesheets.
  6. # (We really need a better name :)
  7. #
  8. ################################################################################
  9.  
  10.  
  11. SHELL=/bin/sh
  12.  
  13.  
  14. ################################################################################
  15. #
  16. # Required Environment Variables
  17. #
  18. # TEACHING_SHARED
  19. # This variable specifies the path to the top level of the teaching
  20. # shared directory hierarchy (e.g., /path/to/Teaching/Shared).
  21. #
  22. TEACHING_SHARED?=$(error The required environment variable TEACHING_SHARED has not been defined. It should point to the root level of the shared teaching directory (e.g., /path/to/Teaching/Shared))
  23.  
  24.  
  25. ################################################################################
  26. #
  27. # Set up paths to makefile include directories.
  28. #
  29. # GLOBAL_HANDBOOK_INCLUDE is the global include directory in the "Shared"
  30. # hierarchy, and is defined relative to the root of that hierarchy.
  31. #
  32. GLOBAL_HANDBOOK_INCLUDE?=$(TEACHING_SHARED)/Authoring/Handbook/make-includes
  33.  
  34.  
  35. ################################################################################
  36. #
  37. # Include local system-specific configuration.
  38. #
  39. include $(GLOBAL_HANDBOOK_INCLUDE)/local_configuration.make
  40.  
  41.  
  42. ################################################################################
  43. #
  44. # Include the XSLT processing functions. Note that we are assuming a fixed
  45. # path relative to the current directory!
  46. #
  47. include $(GLOBAL_HANDBOOK_INCLUDE)/xslt_functions.make
  48.  
  49.  
  50. .PHONY: all clean
  51.  
  52.  
  53. MODULES:=$(shell $(FIND) modules -type f -name "*.xml" )
  54.  
  55.  
  56. all: xml2html.xsl xml2xhtml.xsl xml2latex.xsl xml2xelatex.xsl oracle-docs.xsl modules/paper_calendar_dates.xml
  57.  
  58.  
  59. xml2html.xsl xml2latex.xsl xml2xelatex.xsl: format-master.xml $(MODULES) xml2xslt.xsl oracle-docs.xsl Makefile
  60. $(call xslt,$<,xml2xslt.xsl,$(call xslt_parameter,target-format,$(@:xml2%.xsl=%))) > $@
  61.  
  62.  
  63. # Since it seems impossible in XSLT to generate an xmlns attribute for the
  64. # <html> element, we have to add the attribute after the fact :(.
  65. xml2xhtml.xsl: format-master.xml $(MODULES) xml2xslt.xsl oracle-docs.xsl modules/paper_calendar_dates.xml Makefile
  66. $(call xslt,$<,xml2xslt.xsl,$(call xslt_parameter,target-format,$(@:xml2%.xsl=%))) > $@
  67.  
  68.  
  69. format-master.xml: modules/paper_calendar_dates.xml
  70.  
  71.  
  72. modules/paper_calendar_dates.xml: generate_calendar_dates.php
  73. php $< > $@
  74.  
  75.  
  76. oracle-docs.xsl: oracle-docs.perl
  77. perl $< '.*' xslt > $@
  78.  
  79.  
  80. clean:
  81. rm -f xml2html.xsl xml2xhtml.xsl xml2latex.xsl xml2xelatex.xsl oracle-docs.xsl modules/paper_calendar_dates.xml