2023-07-04 15:32:46 +03:00
|
|
|
% let obj = args.project;
|
|
|
|
|
% let projectName = `${obj.name}_${obj.board}_${obj.cpu}_${obj.os}_${obj.cgt}`;
|
|
|
|
|
% let projectPath = `${obj.relpath}/${obj.board}/${obj.cpu}_${obj.os}/${obj.cgt}`;
|
|
|
|
|
################################################################################
|
|
|
|
|
# Automatically-generated file. Do not edit!
|
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
|
|
SHELL = cmd.exe
|
2023-12-21 18:16:12 +03:00
|
|
|
export `args.sdkPath`?=$(abspath `args.relPath`)
|
2023-07-04 15:32:46 +03:00
|
|
|
CCS_PATH?=$(CCS_INSTALL_DIR)/ccs_base/pru/include
|
|
|
|
|
CG_TOOL_ROOT := C:/ti/ti-cgt-pru_2.3.3
|
|
|
|
|
SYSCFG_DIR := $(CCS_PROJECT_DEBUG)/syscfg
|
|
|
|
|
|
|
|
|
|
GEN_OPTS__FLAG :=
|
|
|
|
|
GEN_CMDS__FLAG :=
|
|
|
|
|
|
|
|
|
|
% // review these include files
|
|
|
|
|
-include ../makefile.init
|
|
|
|
|
|
|
|
|
|
RM := DEL /F
|
|
|
|
|
RMDIR := RMDIR /S/Q
|
|
|
|
|
|
|
|
|
|
# Add inputs and outputs from these tool invocations to the build variables
|
|
|
|
|
CMD_SRCS += \
|
2023-12-21 18:16:12 +03:00
|
|
|
`obj.pru_linker_file`.cmd \
|
2023-07-04 15:32:46 +03:00
|
|
|
|
|
|
|
|
ASM_SRCS += \
|
2023-12-21 18:16:12 +03:00
|
|
|
`obj.pru_main_file`.asm
|
2023-07-04 15:32:46 +03:00
|
|
|
|
|
|
|
|
OBJS += \
|
2023-12-21 18:16:12 +03:00
|
|
|
`obj.pru_main_file`.obj
|
2023-07-04 15:32:46 +03:00
|
|
|
|
|
|
|
|
ASM_DEPS += \
|
2023-12-21 18:16:12 +03:00
|
|
|
`obj.pru_main_file`.d
|
2023-07-04 15:32:46 +03:00
|
|
|
|
2023-12-21 18:16:12 +03:00
|
|
|
OBJDIR := .
|
|
|
|
|
|
|
|
|
|
% for (prop in obj.filedirs) {
|
|
|
|
|
% if ( obj.filedirs.hasOwnProperty(prop) && Array.isArray(obj.filedirs[prop]) ) {
|
|
|
|
|
FILES_PATH_`prop` = \
|
|
|
|
|
% for(let val of obj.filedirs[prop]) {
|
|
|
|
|
`val` \
|
|
|
|
|
% }
|
|
|
|
|
% }
|
|
|
|
|
% }
|
2023-07-04 15:32:46 +03:00
|
|
|
|
2023-12-21 18:16:12 +03:00
|
|
|
FILES_PATH := $(FILES_PATH_common)
|
2023-07-04 15:32:46 +03:00
|
|
|
|
2023-12-21 18:16:12 +03:00
|
|
|
vpath %.asm $(FILES_PATH)
|
|
|
|
|
vpath %.obj $(OBJDIR)
|
|
|
|
|
vpath %.cmd $(FILES_PATH)
|
2023-07-04 15:32:46 +03:00
|
|
|
|
|
|
|
|
% let commandString = "";
|
|
|
|
|
% let cflags = obj.cflags;
|
|
|
|
|
% for (let prop in cflags) {
|
|
|
|
|
% if ( cflags.hasOwnProperty(prop) && Array.isArray(cflags[prop]) && prop == 'common') {
|
|
|
|
|
% for(let val of cflags[prop]) {
|
|
|
|
|
% commandString += `${val} `;
|
|
|
|
|
% }
|
|
|
|
|
% }
|
|
|
|
|
% }
|
|
|
|
|
% let defines = obj.defines;
|
|
|
|
|
% for (let prop in defines) {
|
|
|
|
|
% if ( defines.hasOwnProperty(prop) && Array.isArray(defines[prop]) && prop == 'common') {
|
|
|
|
|
% for(let val of defines[prop]) {
|
|
|
|
|
% commandString += `--define=${val} `;
|
|
|
|
|
% }
|
|
|
|
|
% }
|
|
|
|
|
% }
|
|
|
|
|
% let cmdSubStr = commandString;
|
|
|
|
|
% commandString += `--include_path="$(CCS_PATH)" `;
|
|
|
|
|
% if ("postBuildSteps" in obj || obj["defaultPruPostBuildSteps"]) {
|
|
|
|
|
% commandString += `--include_path="$(SYSCFG_DIR)" `;
|
|
|
|
|
% }
|
|
|
|
|
% let includes = obj.includes;
|
|
|
|
|
% for (let prop in includes) {
|
|
|
|
|
% if ( includes.hasOwnProperty(prop) && Array.isArray(includes[prop]) && prop == 'common') {
|
|
|
|
|
% for(let val of includes[prop]) {
|
|
|
|
|
% commandString += `--include_path="${val}" `;
|
|
|
|
|
% }
|
|
|
|
|
% }
|
|
|
|
|
% }
|
|
|
|
|
# Each subdirectory must supply rules for building sources it contributes
|
2023-12-21 18:16:12 +03:00
|
|
|
$(OBJDIR)/$(OBJS): $(ASM_SRCS)
|
2023-07-04 15:32:46 +03:00
|
|
|
@echo 'Building file: "$<"'
|
|
|
|
|
@echo 'Invoking: PRU Compiler'
|
|
|
|
|
"$(CG_TOOL_ROOT)/bin/clpru" `commandString` --define=_DEBUG_=1 -g --diag_warning=225 --diag_wrap=off --display_error_number --endian=little --preproc_with_compile --preproc_dependency="$(basename $(<F)).d_raw" $(GEN_OPTS__FLAG) "$<"
|
|
|
|
|
@echo 'Finished building: "$<"'
|
|
|
|
|
@echo ' '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-include ../makefile.defs
|
|
|
|
|
|
|
|
|
|
# Add inputs and outputs from these tool invocations to the build variables
|
|
|
|
|
EXE_OUTPUTS += \
|
|
|
|
|
`projectName`.out \
|
|
|
|
|
|
|
|
|
|
EXE_OUTPUTS__QUOTED += \
|
|
|
|
|
"`projectName`.out" \
|
|
|
|
|
|
|
|
|
|
BIN_OUTPUTS += \
|
|
|
|
|
`projectName`.hex \
|
|
|
|
|
|
|
|
|
|
BIN_OUTPUTS__QUOTED += \
|
|
|
|
|
"`projectName`.hex" \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# All Target
|
2023-12-21 18:16:12 +03:00
|
|
|
all: $(OBJS) $(CMD_SRCS)
|
2023-07-04 15:32:46 +03:00
|
|
|
@$(MAKE) --no-print-directory -Onone "`projectName`.out"
|
|
|
|
|
|
|
|
|
|
# Tool invocations
|
|
|
|
|
% // # TODO: ti-cgt specific settings
|
2023-12-21 18:16:12 +03:00
|
|
|
`projectName`.out: $(OBJS) $(CMD_SRCS)
|
2023-07-04 15:32:46 +03:00
|
|
|
@echo 'Building target: "$@"'
|
|
|
|
|
@echo 'Invoking: PRU Linker'
|
2023-12-21 18:16:12 +03:00
|
|
|
"$(CG_TOOL_ROOT)/bin/clpru" `cmdSubStr` --define=_DEBUG_=1 -g --diag_warning=225 --diag_wrap=off --display_error_number --endian=little -z -m"`projectName`.map" --disable_auto_rts --diag_wrap=off --display_error_number --warn_sections --xml_link_info="`projectName`_linkInfo.xml" --rom_model -o "`projectName`.out" $^
|
2023-07-04 15:32:46 +03:00
|
|
|
@echo 'Finished building target: "$@"'
|
|
|
|
|
@echo ' '
|
|
|
|
|
@$(MAKE) --no-print-directory post-build
|
|
|
|
|
|
|
|
|
|
`projectName`.hex: $(EXE_OUTPUTS)
|
|
|
|
|
@echo 'Building secondary target: "$@"'
|
|
|
|
|
@echo 'Invoking: PRU Hex Utility'
|
|
|
|
|
"$(CG_TOOL_ROOT)/bin/hexpru" -o "`projectName`.hex" $(EXE_OUTPUTS__QUOTED)
|
|
|
|
|
@echo 'Finished building secondary target: "$@"'
|
|
|
|
|
@echo ' '
|
|
|
|
|
@$(MAKE) --no-print-directory post-build
|
|
|
|
|
|
|
|
|
|
# Other Targets
|
|
|
|
|
clean:
|
|
|
|
|
-$(RM) $(BIN_OUTPUTS__QUOTED)$(EXE_OUTPUTS__QUOTED)
|
|
|
|
|
-$(RM) "`obj.pru_main_file`.obj"
|
|
|
|
|
-$(RM) "`obj.pru_main_file`.d"
|
|
|
|
|
-@echo 'Finished clean'
|
|
|
|
|
-@echo ' '
|
|
|
|
|
|
|
|
|
|
% if("postBuildSteps" in obj) {
|
|
|
|
|
post-build:
|
|
|
|
|
% steps = obj.postBuildSteps;
|
|
|
|
|
% for (let step of steps) {
|
2023-12-21 18:16:12 +03:00
|
|
|
%let commands = step.split(";");
|
|
|
|
|
%for(let command of commands){
|
|
|
|
|
%if(command.length !== 0){
|
|
|
|
|
-`command`
|
|
|
|
|
%}
|
|
|
|
|
%}
|
2023-07-04 15:32:46 +03:00
|
|
|
% }
|
|
|
|
|
-@echo ' '
|
|
|
|
|
% }
|
|
|
|
|
% if(obj["defaultPruPostBuildSteps"]) {
|
|
|
|
|
post-build:
|
2023-12-21 18:16:12 +03:00
|
|
|
-$(CG_TOOL_ROOT)/bin/hexpru.exe --diag_wrap=off --array --array:name_prefix=PRUFirmware -o pru_load_bin.h `projectName`.out
|
2023-07-04 15:32:46 +03:00
|
|
|
-@echo ' '
|
|
|
|
|
% }
|
|
|
|
|
|
|
|
|
|
.PHONY: all clean dependents
|
|
|
|
|
.SECONDARY:
|
|
|
|
|
|
|
|
|
|
-include ../makefile.targets
|