motor-control-sdk/.project/templates/makefile_pru.xdt

161 lines
4.6 KiB
Plaintext
Raw Normal View History

% 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
export `args.sdkPath`?=$(abspath `args.relPath`)
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 += \
`obj.pru_linker_file`.cmd \
ASM_SRCS += \
`obj.pru_main_file`.asm
OBJS += \
`obj.pru_main_file`.obj
ASM_DEPS += \
`obj.pru_main_file`.d
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` \
% }
% }
% }
FILES_PATH := $(FILES_PATH_common)
vpath %.asm $(FILES_PATH)
vpath %.obj $(OBJDIR)
vpath %.cmd $(FILES_PATH)
% 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
$(OBJDIR)/$(OBJS): $(ASM_SRCS)
@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
all: $(OBJS) $(CMD_SRCS)
@$(MAKE) --no-print-directory -Onone "`projectName`.out"
# Tool invocations
% // # TODO: ti-cgt specific settings
`projectName`.out: $(OBJS) $(CMD_SRCS)
@echo 'Building target: "$@"'
@echo 'Invoking: PRU Linker'
"$(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" $^
@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) {
%let commands = step.split(";");
%for(let command of commands){
%if(command.length !== 0){
-`command`
%}
%}
% }
-@echo ' '
% }
% if(obj["defaultPruPostBuildSteps"]) {
post-build:
-$(CG_TOOL_ROOT)/bin/hexpru.exe --diag_wrap=off --array --array:name_prefix=PRUFirmware -o pru_load_bin.h `projectName`.out
-@echo ' '
% }
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets