home *** CD-ROM | disk | FTP | other *** search
- #
- # build.make
- #
- # Rules for building the product.
- #
- # PUBLIC TARGETS
- # build: copies public and private header files to their
- # final destination
- #
- # IMPORTED VARIABLES
- # BEFORE_BUILD_RECURSION: targets to make before building subprojects
- # BEFORE_BUILD: targets to make before a build, but after subprojects
- # AFTER_BUILD: targets to make after a build
- #
- # EXPORTED VARIABLES
- #
-
- .PHONY: build announce-build local-build recursive-build
- .PHONY: copy-local-resources copy-global-resources build-products
-
- #
- # Variable definitions
- #
-
- BEFORE_BUILD_RECURSION += $(GENERATED_SRCFILES)
- ifneq "$(DISABLE_PRECOMPS)" "YES"
- BEFORE_BUILD += $(PRECOMPILED_HEADERS:.h=.p) $(subst %.h, $(PUBLIC_HDR_DIR)$(PUBLIC_HEADER_DIR_SUFFIX)/%.p, $(PRECOMPILED_PUBLIC_HEADERS))
- endif
- ACTUAL_BUILD = build-directories copy-local-resources copy-global-resources build-products
-
- #
- # First we recurse, then we do local build
- #
-
- ifneq "YES" "$(SUPPRESS_BUILD)"
- build: announce-build before-build-recursion recursive-build local-build
- recursive-build: $(ALL_SUBPROJECTS:%=build@%) announce-build before-build-recursion
- local-build: recursive-build $(ALL_SUBPROJECTS:%=build@%) announce-build before-build-recursion
- $(ALL_SUBPROJECTS:%=build@%): announce-build before-build-recursion
- before-build-recursion: announce-build $(BEFORE_BUILD_RECURSION)
- endif
-
- #
- # Local build
- #
-
- local-build: $(BEFORE_BUILD) $(ACTUAL_BUILD) $(AFTER_BUILD)
- $(AFTER_BUILD): $(BEFORE_BUILD) $(ACTUAL_BUILD)
- $(ACTUAL_BUILD): $(BEFORE_BUILD)
-
- #
- # before we do anything we announce our intentions
- #
-
- announce-build:
- ifndef RECURSING
- $(SILENT) $(ECHO) Building...
- else
- $(SILENT) $(ECHO) $(RECURSIVE_ELLIPSIS)in $(NAME)
- endif
-
- #
- # Ensure that important directories exist
- #
-
- build-directories: $(OFILE_DIR) $(SFILE_DIR) $(PRODUCT_DIR)
-
- #
- # Copying local resources
- #
-
- ifneq "" "$(LOCAL_RESOURCES)"
- copy-local-resources: $(LOCAL_RESOURCE_DIR) $(LOCAL_RESOURCES)
- ifneq "" "$(LOCAL_RESOURCE_DIR)"
- $(SILENT) $(FASTCP) $(LOCAL_RESOURCES) $(LOCAL_RESOURCE_DIR)
- else
- $(SILENT) $(ECHO) Error: only wrapper-style projects can have resources
- $(SILENT) exit 2
- endif
- endif
-
- #
- # Copying global resources
- #
-
- ifneq " " "$(GLOBAL_RESOURCES) $(OTHER_RESOURCES)"
- copy-global-resources: $(GLOBAL_RESOURCE_DIR) $(GLOBAL_RESOURCES) $(OTHER_RESOURCES)
- ifneq "" "$(GLOBAL_RESOURCE_DIR)"
- $(SILENT) $(FASTCP) $(GLOBAL_RESOURCES) $(OTHER_RESOURCES) $(GLOBAL_RESOURCE_DIR)
- else
- $(SILENT) $(ECHO) Error: only wrapper-style projects can have resources
- $(SILENT) exit 2
- endif
- endif
-
- #
- # Building products
- #
-
- ifeq "YES" "$(BUILD_OFILES_LIST_ONLY)"
- build-products: $(DEPENDENCIES)
- else
- build-products: $(PRODUCTS)
- endif
-
- #
- # Rules for creating directories
- #
-
- $(OFILE_DIR) $(SFILE_DIR) $(PRODUCT_DIR) $(LOCAL_RESOURCE_DIR) $(GLOBAL_RESOURCE_DIR):
- $(SILENT) $(MKDIRS) $@
-
-