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

  1. #
  2. # build.make
  3. #
  4. # Rules for building the product.
  5. #
  6. # PUBLIC TARGETS
  7. #    build: copies public and private header files to their
  8. #        final destination
  9. #
  10. # IMPORTED VARIABLES
  11. #    BEFORE_BUILD_RECURSION: targets to make before building subprojects
  12. #    BEFORE_BUILD: targets to make before a build, but after subprojects
  13. #    AFTER_BUILD: targets to make after a build
  14. #
  15. # EXPORTED VARIABLES
  16. #
  17.  
  18. .PHONY: build announce-build local-build recursive-build
  19. .PHONY: copy-local-resources copy-global-resources build-products
  20.  
  21. #
  22. # Variable definitions
  23. #
  24.  
  25. BEFORE_BUILD_RECURSION += $(GENERATED_SRCFILES)
  26. ifneq "$(DISABLE_PRECOMPS)" "YES"
  27. BEFORE_BUILD += $(PRECOMPILED_HEADERS:.h=.p) $(subst %.h, $(PUBLIC_HDR_DIR)$(PUBLIC_HEADER_DIR_SUFFIX)/%.p, $(PRECOMPILED_PUBLIC_HEADERS))
  28. endif
  29. ACTUAL_BUILD = build-directories copy-local-resources copy-global-resources build-products
  30.  
  31. #
  32. # First we recurse, then we do local build
  33. #
  34.  
  35. ifneq "YES" "$(SUPPRESS_BUILD)"
  36. build: announce-build before-build-recursion recursive-build local-build
  37. recursive-build: $(ALL_SUBPROJECTS:%=build@%) announce-build before-build-recursion
  38. local-build: recursive-build $(ALL_SUBPROJECTS:%=build@%) announce-build before-build-recursion
  39. $(ALL_SUBPROJECTS:%=build@%): announce-build before-build-recursion
  40. before-build-recursion: announce-build $(BEFORE_BUILD_RECURSION)
  41. endif
  42.  
  43. #
  44. # Local build
  45. #
  46.  
  47. local-build:  $(BEFORE_BUILD) $(ACTUAL_BUILD) $(AFTER_BUILD)
  48. $(AFTER_BUILD): $(BEFORE_BUILD) $(ACTUAL_BUILD)
  49. $(ACTUAL_BUILD): $(BEFORE_BUILD)
  50.  
  51. #
  52. # before we do anything we announce our intentions
  53. #
  54.  
  55. announce-build:
  56. ifndef RECURSING
  57.     $(SILENT) $(ECHO) Building...
  58. else
  59.     $(SILENT) $(ECHO) $(RECURSIVE_ELLIPSIS)in $(NAME)
  60. endif
  61.  
  62. #
  63. # Ensure that important directories exist
  64. #
  65.  
  66. build-directories: $(OFILE_DIR) $(SFILE_DIR) $(PRODUCT_DIR)
  67.  
  68. #
  69. # Copying local resources
  70. #
  71.  
  72. ifneq "" "$(LOCAL_RESOURCES)"
  73. copy-local-resources: $(LOCAL_RESOURCE_DIR) $(LOCAL_RESOURCES)
  74. ifneq "" "$(LOCAL_RESOURCE_DIR)"
  75.     $(SILENT) $(FASTCP) $(LOCAL_RESOURCES) $(LOCAL_RESOURCE_DIR)
  76. else
  77.     $(SILENT) $(ECHO) Error:  only wrapper-style projects can have resources
  78.     $(SILENT) exit 2
  79. endif
  80. endif
  81.  
  82. #
  83. # Copying global resources
  84. #
  85.  
  86. ifneq " " "$(GLOBAL_RESOURCES) $(OTHER_RESOURCES)"
  87. copy-global-resources: $(GLOBAL_RESOURCE_DIR) $(GLOBAL_RESOURCES) $(OTHER_RESOURCES)
  88. ifneq "" "$(GLOBAL_RESOURCE_DIR)"
  89.     $(SILENT) $(FASTCP) $(GLOBAL_RESOURCES) $(OTHER_RESOURCES) $(GLOBAL_RESOURCE_DIR)
  90. else
  91.     $(SILENT) $(ECHO) Error:  only wrapper-style projects can have resources
  92.     $(SILENT) exit 2
  93. endif
  94. endif
  95.  
  96. #
  97. # Building products
  98. #
  99.  
  100. ifeq "YES" "$(BUILD_OFILES_LIST_ONLY)"
  101. build-products: $(DEPENDENCIES)
  102. else
  103. build-products: $(PRODUCTS)
  104. endif
  105.  
  106. #
  107. # Rules for creating directories
  108. #
  109.  
  110. $(OFILE_DIR) $(SFILE_DIR) $(PRODUCT_DIR) $(LOCAL_RESOURCE_DIR) $(GLOBAL_RESOURCE_DIR):
  111.     $(SILENT) $(MKDIRS) $@
  112.  
  113.