home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Makefiles / pb_makefiles / prebuild.make < prev    next >
Text File  |  1996-12-05  |  4KB  |  122 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-java-classes 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. # make sure everyone can see our .java's
  66. #
  67.  
  68. export-java-classes: 
  69. ifeq "$(JAVA_ENABLED)" "YES"
  70.     $(JAVATOOL) $(OTHER_JAVATOOL_FLAGS) $(JAVAC_ARG) -newer -copy -java_src $(JAVA_SRC_DIR) -java_obj $(JAVA_OBJ_DIR) $(JAVA_CLASSES)
  71. endif
  72.  
  73. #
  74. # if there are any project headers we must export them
  75. #
  76.  
  77. ifneq "" "$(PROJECT_HEADERS)$(OTHER_PROJECT_HEADERS)"
  78. export-project-headers: $(PROJECT_HDR_DIR)$(PROJECT_HEADER_DIR_SUFFIX) $(PROJECT_HEADERS) $(OTHER_PROJECT_HEADERS)
  79.     $(SILENT) $(CLONEHDRS) $(PROJECT_HEADERS) $(OTHER_PROJECT_HEADERS) $(PROJECT_HDR_DIR)$(PROJECT_HEADER_DIR_SUFFIX)
  80. endif
  81.  
  82. #
  83. # if there are any public headers we must export them
  84. #
  85.  
  86. ifneq "" "$(PUBLIC_HEADERS)$(OTHER_PUBLIC_HEADERS)"
  87. ifneq "" "$(PUBLIC_HDR_DIR)"
  88. export-public-headers: $(PUBLIC_HDR_DIR)$(PUBLIC_HEADER_DIR_SUFFIX) $(PUBLIC_HEADERS) $(OTHER_PUBLIC_HEADERS)
  89.     $(SILENT) $(CLONEHDRS) $(PUBLIC_HEADERS) $(OTHER_PUBLIC_HEADERS) $(PUBLIC_HDR_DIR)$(PUBLIC_HEADER_DIR_SUFFIX)
  90. endif
  91. endif
  92.  
  93. #
  94. # if there are any private headers we must export them
  95. #
  96.  
  97. ifneq "" "$(PRIVATE_HEADERS)$(OTHER_PRIVATE_HEADERS)"
  98. ifneq "" "$(PRIVATE_HDR_DIR)"
  99. export-private-headers: $(PRIVATE_HDR_DIR)$(PRIVATE_HEADER_DIR_SUFFIX) $(PRIVATE_HEADERS) $(OTHER_PRIVATE_HEADERS)
  100.     $(SILENT) $(CLONEHDRS) $(PRIVATE_HEADERS)  $(OTHER_PRIVATE_HEADERS) $(PRIVATE_HDR_DIR)$(PRIVATE_HEADER_DIR_SUFFIX)
  101. endif
  102. endif
  103.  
  104. #
  105. # Existing precomps must be kept up to date in case a contributing header file changes.
  106. #
  107.  
  108. refresh-precomps:
  109. ifeq "$(PLATFORM_OS)" "nextstep"
  110. ifneq "" "$(ALL_PRECOMPS)"
  111.     $(SILENT) $(FIXPRECOMPS) -precomps $(ALL_PRECOMPS) -update $(ALL_PRECOMPFLAGS)
  112. endif
  113. endif
  114.  
  115.  
  116. #
  117. # rule for making various directories
  118. #
  119.  
  120. $(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):
  121.     $(SILENT) $(MKDIRS) $@
  122.