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