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