Newer
Older
Handbook / makefile-templates / Makefile.document
nstanger on 1 Dec 2010 3 KB - The Mother of All Commits!
  1. ################################################################################
  2. #
  3. # File: $Id$
  4. #
  5. # Template makefile for building a particular document within a section of
  6. # the handbook (e.g., Tutorials 5). Place a copy of this file in the
  7. # directory for each document, and modify as appropriate. The default
  8. # makefile checks (and rebuilds if necessary) all of the content files for
  9. # the current document, using recursive make calls to each content file.
  10. # Most of the work is done by the include files, and should cater for
  11. # almost all cases. However, if custom rules are needed for a section,
  12. # they can be appended to the end of the document's makefile.
  13. #
  14. ################################################################################
  15.  
  16.  
  17. SHELL=/bin/sh
  18.  
  19.  
  20. ################################################################################
  21. #
  22. # Required Environment Variables
  23. #
  24. # TEACHING_SHARED
  25. # This variable specifies the path to the top level of the teaching
  26. # shared directory hierarchy (e.g., /path/to/Teaching/Shared).
  27. #
  28. 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))
  29. #
  30. # ALL_PAPERS_ROOT
  31. # This variable specifies the path to the top level directory for all
  32. # papers taught, i.e., the directory that contains the individual paper
  33. # directory hierarchies. For example, /path/to/Teaching/2005.
  34. #
  35. ALL_PAPERS_ROOT?=$(error The required environment variable ALL_PAPERS_ROOT has not been defined. It should point to the root level of the current teaching directory hierarchy (e.g., /path/to/Teaching/2005))
  36. #
  37. # HANDBOOK_INSTALL_ROOT
  38. # This variable specifies the path to the top level directory on the web
  39. # server, under which the files for this paper will be installed (that is,
  40. # the directory that contains the individual paper directory hierarchies).
  41. # For example, \\INFO-NTS-12\DBCourses$ (this may require munging).
  42. #
  43. HANDBOOK_INSTALL_ROOT?=$(error The required environment variable HANDBOOK_INSTALL_ROOT has not been defined. It should point to the root level of the directory hierarchy on the web server (e.g., \\INFO-NTS-12\DBCourses$))
  44.  
  45.  
  46. ################################################################################
  47. #
  48. # Set up paths to makefile include directories.
  49. #
  50. # GLOBAL_HANDBOOK_INCLUDE is the global include directory in the "Shared"
  51. # hierarchy, and is defined relative to the root of that hierarchy.
  52. #
  53. # LOCAL_HANDBOOK_INCLUDE is the local include directory for this
  54. # particular paper, and is defined relative to the current execution
  55. # directory. We are assuming a fixed directory structure here! We can't
  56. # really do this as an environment variable because the full path will be
  57. # different for each paper, and we can't use the variables from
  58. # paper_variables.make to set the path, because that file is in the
  59. # include directory! <head spins> We will, however, allow for the
  60. # possibility of someone wanting to define this as an environment variable
  61. # by making it a conditional assignment.
  62. #
  63. GLOBAL_HANDBOOK_INCLUDE?=$(TEACHING_SHARED)/Authoring/Handbook/make-includes
  64.  
  65. export LOCAL_HANDBOOK_INCLUDE?=$(shell cd ../../..; pwd)/make-includes
  66.  
  67.  
  68. ################################################################################
  69. #
  70. # Include local system-specific configuration.
  71. #
  72. include $(GLOBAL_HANDBOOK_INCLUDE)/local_configuration.make
  73.  
  74.  
  75. ################################################################################
  76. #
  77. # Include standard variables and rules for building a document.
  78. #
  79. include $(GLOBAL_HANDBOOK_INCLUDE)/build_document_rules.make
  80.  
  81.  
  82. ################################################################################
  83. #
  84. # Add custom rules below here, as necessary. Add files to be deleted to the
  85. # variables below, as appropriate.
  86. #
  87. # WEB_CLEAN_FILES+=
  88. # PRINT_CLEAN_FILES+=
  89. # ALL_CLEAN_FILES+=