home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / DEV.Z / prebuild.make < prev    next >
Encoding:
Text File  |  1996-09-08  |  3.3 KB  |  113 lines

  1. #
  2. # prebuild.make
  3. #
  4. # Rules for preparing for a build.  This preparation includes exporting
  5. # any public, private, or project header files and ensuring that the
  6. # object and generated-source directories exist.
  7. #
  8. # PUBLIC TARGETS
  9. #    prebuild: copies public and private header files to their
  10. #        final destination and refreshes precomps
  11. #
  12. # IMPORTED VARIABLES
  13. #    BEFORE_PREBUILD: targets to build before installing headers for a subproject
  14. #    AFTER_PREBUILD: targets to build after installing headers for a subproject
  15. #
  16. # EXPORTED VARIABLES
  17. #
  18.  
  19. .PHONY: prebuild announce-prebuild local-prebuild recursive-prebuild
  20. .PHONY: export-project-headers export-public-headers export-private-headers refresh-precomps
  21.  
  22. #
  23. # Variable definitions
  24. #
  25.  
  26. ACTUAL_PREBUILD = prebuild-directories export-project-headers export-public-headers export-private-headers 
  27.  
  28. #
  29. # First we do local prebuild, then we recurse, then we refresh precomps
  30. #
  31.  
  32. ifneq "YES" "$(SUPPRESS_BUILD)"
  33. prebuild: local-prebuild recursive-prebuild refresh-precomps
  34. recursive-prebuild: $(ALL_SUBPROJECTS:%=prebuild@%) local-prebuild
  35. $(ALL_SUBPROJECTS:%=prebuild@%): local-prebuild
  36. endif
  37.  
  38. #
  39. # Local prebuild
  40. #
  41.  
  42. local-prebuild: announce-prebuild $(BEFORE_PREBUILD) $(ACTUAL_PREBUILD) $(AFTER_PREBUILD)
  43. $(AFTER_PREBUILD): announce-prebuild $(BEFORE_PREBUILD) $(ACTUAL_PREBUILD)
  44. $(ACTUAL_PREBUILD): announce-prebuild $(BEFORE_PREBUILD)
  45. $(BEFORE_PREBUILD): announce-prebuild
  46.  
  47. #
  48. # before we do anything we announce our intentions
  49. #
  50.  
  51. announce-prebuild:
  52. ifndef RECURSING
  53.     $(SILENT) $(ECHO) Pre-build setup...
  54. else
  55.     $(SILENT) $(ECHO) $(RECURSIVE_ELLIPSIS)in $(NAME)
  56. endif
  57.  
  58. #
  59. # Ensure that important directories exist
  60. #
  61.  
  62. prebuild-directories: $(OFILE_DIR) $(SFILE_DIR) $(PRODUCT_DIR)
  63.  
  64. #
  65. # if there are any project headers we must export them
  66. #
  67.  
  68. ifneq "" "$(PROJECT_HEADERS)$(OTHER_PROJECT_HEADERS)"
  69. export-project-headers: $(PROJECT_HDR_DIR)$(PROJECT_HEADER_DIR_SUFFIX) $(PROJECT_HEADERS) $(OTHER_PROJECT_HEADERS)
  70.     $(SILENT) $(CLONEHDRS) $(PROJECT_HEADERS) $(OTHER_PROJECT_HEADERS) $(PROJECT_HDR_DIR)$(PROJECT_HEADER_DIR_SUFFIX)
  71. endif
  72.  
  73. #
  74. # if there are any public headers we must export them
  75. #
  76.  
  77. ifneq "" "$(PUBLIC_HEADERS)$(OTHER_PUBLIC_HEADERS)"
  78. ifneq "" "$(PUBLIC_HDR_DIR)"
  79. export-public-headers: $(PUBLIC_HDR_DIR)$(PUBLIC_HEADER_DIR_SUFFIX) $(PUBLIC_HEADERS) $(OTHER_PUBLIC_HEADERS)
  80.     $(SILENT) $(CLONEHDRS) $(PUBLIC_HEADERS) $(OTHER_PUBLIC_HEADERS) $(PUBLIC_HDR_DIR)$(PUBLIC_HEADER_DIR_SUFFIX)
  81. endif
  82. endif
  83.  
  84. #
  85. # if there are any private headers we must export them
  86. #
  87.  
  88. ifneq "" "$(PRIVATE_HEADERS)$(OTHER_PRIVATE_HEADERS)"
  89. ifneq "" "$(PRIVATE_HDR_DIR)"
  90. export-private-headers: $(PRIVATE_HDR_DIR)$(PRIVATE_HEADER_DIR_SUFFIX) $(PRIVATE_HEADERS) $(OTHER_PRIVATE_HEADERS)
  91.     $(SILENT) $(CLONEHDRS) $(PRIVATE_HEADERS)  $(OTHER_PRIVATE_HEADERS) $(PRIVATE_HDR_DIR)$(PRIVATE_HEADER_DIR_SUFFIX)
  92. endif
  93. endif
  94.  
  95. #
  96. # Existing precomps must be kept up to date in case a contributing header file changes.
  97. #
  98.  
  99. refresh-precomps:
  100. ifeq "$(PLATFORM_OS)" "nextstep"
  101. ifneq "" "$(ALL_PRECOMPS)"
  102.     $(SILENT) $(FIXPRECOMPS) -precomps $(ALL_PRECOMPS) -update $(ALL_PRECOMPFLAGS)
  103. endif
  104. endif
  105.  
  106.  
  107. #
  108. # rule for making various directories
  109. #
  110.  
  111. $(OFILE_DIR) $(SFILE_DIR) $(PRODUCT_DIR) $(PROJECT_HDR_DIR)$(PROJECT_HEADER_DIR_SUFFIX) $(PUBLIC_HDR_DIR)$(PUBLIC_HEADER_DIR_SUFFIX) $(PRIVATE_HDR_DIR)$(PRIVAT_HEADER_DIR_SUFFIX):
  112.     $(SILENT) $(MKDIRS) $@
  113.