Newer
Older
Handbook / makefile-templates / Makefile.content
  1. ################################################################################
  2. #
  3. # Template makefile for building a particular content file for a document.
  4. # Place a copy of this file in the directory containing the content file,
  5. # and modify as appropriate. The makefile should be called with the name
  6. # of a specific content file as target. It will then check whether there
  7. # are any prerequisites to that file that may have changed, and rebuild
  8. # them if necessary. Most of the work is done by the include files, and
  9. # should cater for almost all cases. However, if custom rules are needed
  10. # for a section, they can be appended to the end of the document's
  11. # makefile.
  12. #
  13. # Note that the ONLY mode of operation for this makefile is to be called
  14. # from the makefile for a particular document, with the name of a specific
  15. # content file as the target. This makefile cannot be easily executed
  16. # standalone! This is because the content directory can exist at a
  17. # relatively arbitrary location within the paper's directory hierarchy. We
  18. # therefore don't know where to look, relative to the current directory,
  19. # to find the local include directory, and thus cannot provide a
  20. # meaningful value for the variable LOCAL_HANDBOOK_INCLUDE. The value of
  21. # LOCAL_HANDBOOK_INCLUDE must therefore be passed in from the calling
  22. # environment.
  23. #
  24. ################################################################################
  25.  
  26.  
  27. SHELL=/bin/sh
  28.  
  29.  
  30. ################################################################################
  31. #
  32. # Required Environment Variables
  33. #
  34. # TEACHING_SHARED
  35. # This variable specifies the path to the top level of the teaching
  36. # shared directory hierarchy (e.g., /path/to/Teaching/Shared).
  37. #
  38. 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))
  39.  
  40.  
  41. ################################################################################
  42. #
  43. # Set up paths to makefile include directories.
  44. #
  45. # GLOBAL_HANDBOOK_INCLUDE is the global include directory in the "Shared"
  46. # hierarchy, and is defined relative to the root of that hierarchy.
  47. #
  48. # LOCAL_HANDBOOK_INCLUDE is the local include directory for this
  49. # particular paper, and is defined relative to the current execution
  50. # directory. Since we don't know our current location in the paper's
  51. # directory hierarchy, this has to be defined by the makefile's calling
  52. # environment. It's an error not to define this variable.
  53. #
  54. GLOBAL_HANDBOOK_INCLUDE?=$(TEACHING_SHARED)/Authoring/Handbook/make-includes
  55.  
  56. LOCAL_HANDBOOK_INCLUDE?=$(error The environment variable LOCAL_HANDBOOK_INCLUDE has not been defined)
  57.  
  58.  
  59. ################################################################################
  60. #
  61. # Include local system-specific configuration.
  62. #
  63. include $(GLOBAL_HANDBOOK_INCLUDE)/local_configuration.make
  64.  
  65.  
  66. ################################################################################
  67. #
  68. # Include standard variables and rules for building content files. (Mainly
  69. # oriented towards graphics generation.)
  70. #
  71. include $(GLOBAL_HANDBOOK_INCLUDE)/build_content_rules.make
  72.  
  73.  
  74. ################################################################################
  75. #
  76. # Add custom rules below here, as necessary. Rules should ensure that they
  77. # at least touch their targets.
  78. #