This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CCStudio 10.3可为 GCC 生成损坏的 makefile?

Guru**** 2589280 points
Other Parts Discussed in Thread: CCSTUDIO

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/994601/ccstudio-10-3-generates-broken-makefiles-for-gcc

主题中讨论的其他器件:CCStudioMSP432P401R

您好!

我正在使用 GCC 来构建我的 MSP432项目。 我在构建期间收到以下错误消息

   gmake:***没有规则使目标'./common.h ./data.h'成为'main.o'所需的目标。

还有其他几条类似的错误消息、它们具有不同的头文件和目标文件名。 看起来 CCStudio 生成的 makefile 已损坏。 在 Debug_GNU/main.d 中、有一行:

   ./common.h\./data.h

如果我删除头文件名之间的反斜杠、则可以编译 main.c。 但是、一旦编译 main.c、main.d 就会被损坏的代码覆盖。

此外、如果我清理整个项目和编译、一切都很好。 但是、修改一些文件然后在不进行清理的情况下进行构建不起作用。

我记得 CCStudio 10.2没有问题。 这是回归吗?

环境:

*编译器:GCC 7.2.1 (Linaro)

*器件:MSP432P401R

* IDE:CCStudio 10.3.0.00007

*操作系统:arch linux

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [引用 userid="451963" URL"~/support/tools/ccs/f/code-composer-studio-forum/994601/ccstudio-10-3-generates-broken-makefiles-for-gcc "]

    我正在使用 GCC 来构建我的 MSP432项目。 我在构建期间收到以下错误消息

       gmake:***没有规则使目标'./common.h ./data.h'成为'main.o'所需的目标。

    [/报价]

    已创建附加项目、 并使用  Ubuntu 18.04.5 LTS 下的 GCC 7.2.1 (Linaro)在10.3.0.00007中重复了该问题。

    其中 、CCS 创建的 Debug/main.d 包含:

    main.o: ../main.c \
     /home/mr_halfword/ti/ccs1030/ccs/ccs_base/arm/include/msp.h \
     /home/mr_halfword/ti/ccs1030/ccs/ccs_base/arm/include/msp432p401r.h \
     /home/mr_halfword/ti/ccs1030/ccs/ccs_base/arm/include/msp_compatibility.h \
     /home/mr_halfword/ti/ccs1030/ccs/ccs_base/arm/include/msp432p401r_classic.h \
     /home/mr_halfword/ti/ccs1030/ccs/ccs_base/arm/include/CMSIS/core_cm4.h \
     /home/mr_halfword/ti/ccs1030/ccs/ccs_base/arm/include/CMSIS/cmsis_compiler.h \
     /home/mr_halfword/ti/ccs1030/ccs/ccs_base/arm/include/CMSIS/cmsis_gcc.h \
     /home/mr_halfword/ti/ccs1030/ccs/ccs_base/arm/include/system_msp432p401r.h \
     ../common.h\ ../data.h
    

    我发现如果执行"Rebuild Project"、即使在 Makefile 依赖项中的头文件名之间存在反斜杠、编译也会成功:

    **** Clean-only build of configuration Debug for project MSP432P401R_gnu_hello ****
    
    /home/mr_halfword/ti/ccs1030/ccs/utils/bin/gmake -k -j 12 clean -O 
     
    rm -rf  "MSP432P401R_gnu_hello.hex"  "MSP432P401R_gnu_hello.out" 
    rm -rf "main.o" "startup_msp432p401r_gcc.o" "system_msp432p401r.o" 
    rm -rf "main.d" "startup_msp432p401r_gcc.d" "system_msp432p401r.d" 
    Finished clean
     
    
    **** Build Finished ****
    
    **** Build of configuration Debug for project MSP432P401R_gnu_hello ****
    
    /home/mr_halfword/ti/ccs1030/ccs/utils/bin/gmake -k -j 12 all -O 
     
    Building file: "../startup_msp432p401r_gcc.c"
    Invoking: GNU Compiler
    "/home/mr_halfword/ti/ccs1030/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc-7.2.1" -c -mcpu=cortex-m4 -march=armv7e-m -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -D__MSP432P401R__ -Dgcc -I"/home/mr_halfword/ti/ccs1030/ccs/ccs_base/arm/include" -I"/home/mr_halfword/ti/ccs1030/ccs/ccs_base/arm/include/CMSIS" -I"/home/mr_halfword/workspace_v10/MSP432P401R_gnu_hello" -I"/home/mr_halfword/ti/ccs1030/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF"startup_msp432p401r_gcc.d_raw" -MT"startup_msp432p401r_gcc.o"   -o"startup_msp432p401r_gcc.o" "../startup_msp432p401r_gcc.c"
    Finished building: "../startup_msp432p401r_gcc.c"
     
    Building file: "../main.c"
    Invoking: GNU Compiler
    "/home/mr_halfword/ti/ccs1030/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc-7.2.1" -c -mcpu=cortex-m4 -march=armv7e-m -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -D__MSP432P401R__ -Dgcc -I"/home/mr_halfword/ti/ccs1030/ccs/ccs_base/arm/include" -I"/home/mr_halfword/ti/ccs1030/ccs/ccs_base/arm/include/CMSIS" -I"/home/mr_halfword/workspace_v10/MSP432P401R_gnu_hello" -I"/home/mr_halfword/ti/ccs1030/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF"main.d_raw" -MT"main.o"   -o"main.o" "../main.c"
    Finished building: "../main.c"
     
    Building file: "../system_msp432p401r.c"
    Invoking: GNU Compiler
    "/home/mr_halfword/ti/ccs1030/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc-7.2.1" -c -mcpu=cortex-m4 -march=armv7e-m -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -D__MSP432P401R__ -Dgcc -I"/home/mr_halfword/ti/ccs1030/ccs/ccs_base/arm/include" -I"/home/mr_halfword/ti/ccs1030/ccs/ccs_base/arm/include/CMSIS" -I"/home/mr_halfword/workspace_v10/MSP432P401R_gnu_hello" -I"/home/mr_halfword/ti/ccs1030/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF"system_msp432p401r.d_raw" -MT"system_msp432p401r.o"   -o"system_msp432p401r.o" "../system_msp432p401r.c"
    Finished building: "../system_msp432p401r.c"
     
    Building target: "MSP432P401R_gnu_hello.out"
    Invoking: GNU Linker
    "/home/mr_halfword/ti/ccs1030/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc-7.2.1" -D__MSP432P401R__ -Dgcc -Og -g -gdwarf-3 -gstrict-dwarf -Wall -march=armv7e-m -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,-Map,"MSP432P401R_gnu_hello.map" -mthumb -g -gstrict-dwarf -Wall -o"MSP432P401R_gnu_hello.out" "./main.o" "./startup_msp432p401r_gcc.o" "./system_msp432p401r.o" -Wl,-T"../msp432p401r.lds"  -Wl,--start-group -lgcc -lnosys -lc -Wl,--end-group 
    Finished building target: "MSP432P401R_gnu_hello.out"
     
    
    **** Build Finished ****
    

    而如果只重建 main.o、例如通过编辑 main.c 并执行"构建项目"、则编译会失败、原因如下:

    **** Build of configuration Debug for project MSP432P401R_gnu_hello ****
    
    /home/mr_halfword/ti/ccs1030/ccs/utils/bin/gmake -k -j 12 all -O 
     
    gmake: *** No rule to make target '../common.h ../data.h', needed by 'main.o'.
    gmake: Target 'all' not remade because of errors.
    
    **** Build Finished ****
    

    我还确认 CCS 10.2.0不会出现问题

    e2e.ti.com/.../MSP432P401R_5F00_gnu_5F00_hello.zip

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    非常感谢您的确认和一个小示例!

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Gillion:

    感谢您回答问题、

    伊斯天