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