AnsweredAssumed Answered

Problem with pre-build script in CW 10.6

Question asked by Alex Stefan on Dec 23, 2014



I have a bareboard project in CW 10.6 and running a pre-build command to get the current Git tag in order to use it for versioning. Anyway, problem is that I get this error "mingw32-make: [pre-build] Error 1 (ignored)"  and, when enabling the "Print size" option from the project's tool settings, the whole build fails.


"C:/Freescale/CW MCU v10.6/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-size"  --format=berkeley -t proj.elf

      0      0      0      0      0 (TOTALS)

makefile:120: warning: overriding recipe for target `proj.elf'

makefile:84: warning: ignoring old recipe for target `proj.elf'

C:/Users/lenovo/workspace/me/projects/my_proj/scripts/ line 11: return: can only `return' from a function or sourced script

mingw32-make: [pre-build] Error 1 (ignored)

C:/Freescale/CW MCU v10.6/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-size: 'proj.elf': No such file

mingw32-make: *** [proj.siz] Error 1


This is the makefile generated:

# Tool invocations

proj.elf: $(OBJS) $(USER_OBJS) ../Project_Settings/Linker_Files/ProcessorExpert.ld | pre-build

  @echo 'Building target: $@'

  @echo 'Executing target #73 $@'

  @echo 'Invoking: ARM Ltd Windows GCC C Linker'

  "$(ARMSourceryDirEnv)/arm-none-eabi-gcc"  $(USER_OBJS_QUOTED) $(LIBS_QUOTED) @"proj.args" -o"proj.elf"

  @echo 'Finished building target: $@'

  @echo ' '



proj.siz: proj.elf | pre-build

  @echo 'Executing target #74 $@'

  @echo 'Invoking: ARM Ltd Windows GNU Print Size'

  "$(ARMSourceryDirEnv)/arm-none-eabi-size"  --format=berkeley -t proj.elf

  @echo 'Finished building: $@'

  @echo ' '



# Other Targets


  -$(RM) $(S_DEPS_QUOTED) "./*/*.o" "./*/*/*.o"  $(S_UPPER_DEPS_QUOTED) $(ASM_DEPS_QUOTED) $(SECONDARY_SIZE_QUOTED) $(ASM_UPPER_DEPS_QUOTED) $(SX_DEPS_QUOTED) $(EXECUTABLES_QUOTED) "./*/*.d" "./*/*/*.d"  $(ProjDirPath)/FLASH/proj.elf

  -@echo ' '




  -cmd.exe /c ""C:\Program Files (x86)\Git\bin\sh.exe" --login -i -- C:/Users/lenovo/workspace/me/ecus/me-ecu-core/firmware/ME-S-Core/scripts/"

  -@echo ' '



secondary-outputs: $(SECONDARY_SIZE)

.PHONY: all clean dependents explicit-dependencies warning-messages




-include ../makefile.targets



explicit-dependencies: ../Project_Settings/Linker_Files/ProcessorExpert.ld proj.elf

# Additional tool dependencies as separate targets to avoid errors while using parallel builds when pre-build steps are generating those dependencies.









This is the command that I use to start by pre-build script:

cmd.exe /c ""C:\Program Files (x86)\Git\bin\sh.exe" --login -i -- ${ProjDirPath}/scripts/"



Cheers for helping!