#
# This file was generated based on the configuration script:
#     C:\git\phoenix_hello\C6674_EvmPlat\EVM_C6674_configuration.cfg
#
# This makefile may be included in other makefiles that need to build
# the libraries containing the compiled source files generated as
# part of the configuration step.

#
# ======== GEN_SRC_DIR =========
# The path to the sources generated during configuration
#
# This path must be either absolute or relative to the build directory.
#
# The absolute path to the generated source directory (at the time the
# sources were generated) is:
#    C:\git\phoenix_hello\C6674_EvmPlat\src
#
GEN_SRC_DIR ?= ../src

ifeq (,$(wildcard $(GEN_SRC_DIR)))
$(error "ERROR: GEN_SRC_DIR must be set to the directory containing the generated sources")
endif

#
# ======== .force ========
# The .force goal is used to force the build of any goal that names it as
# a prerequisite
#
.PHONY: .force
      
#
# ======== library macros ========
#
ipc_SRC = $(GEN_SRC_DIR)/ipc
ipc_LIB = $(GEN_SRC_DIR)/ipc.ae66
sysbios_SRC = $(GEN_SRC_DIR)/sysbios
sysbios_LIB = $(GEN_SRC_DIR)/sysbios/sysbios.ae66
utils_SRC = $(GEN_SRC_DIR)/utils
utils_LIB = $(GEN_SRC_DIR)/utils.ae66

#
# ======== dependencies ========
#
all: $(ipc_LIB) $(sysbios_LIB) $(utils_LIB)
clean: .ipc_clean .sysbios_clean .utils_clean


# ======== convenient build goals ========
.PHONY: ipc
ipc: $(GEN_SRC_DIR)/ipc.ae66
.PHONY: sysbios
sysbios: $(GEN_SRC_DIR)/sysbios/sysbios.ae66
.PHONY: utils
utils: $(GEN_SRC_DIR)/utils.ae66

# CDT managed make executables depend on $(OBJS)
OBJS += $(ipc_LIB) $(sysbios_LIB) $(utils_LIB)

#
# ======== rules ========
#
$(ipc_LIB): .force 
	@echo making $@ ...
	@$(MAKE) -C $(ipc_SRC)

.ipc_clean:
	@echo cleaning $(ipc_SRC) ...
	-@$(MAKE) --no-print-directory -C $(ipc_SRC) clean

$(sysbios_LIB): .force 
	@echo making $@ ...
	@$(MAKE) -C $(sysbios_SRC)

.sysbios_clean:
	@echo cleaning $(sysbios_SRC) ...
	-@$(MAKE) --no-print-directory -C $(sysbios_SRC) clean

$(utils_LIB): .force 
	@echo making $@ ...
	@$(MAKE) -C $(utils_SRC)

.utils_clean:
	@echo cleaning $(utils_SRC) ...
	-@$(MAKE) --no-print-directory -C $(utils_SRC) clean

