GNU Make 使用 : 语法

huangapple go评论40阅读模式
英文:

GNU Make using : syntax

问题

$(OUTPUT_DIRECTORY)/nrf52840_xxaa.out: \ LINKER_SCRIPT := Core/PRJ.ld


这两行的编译过程是:
- 第一行表示要生成的输出文件是 `$(OUTPUT_DIRECTORY)/nrf52840_xxaa.out`。
- 第二行使用了链接脚本 `Core/PRJ.ld`。

<details>
<summary>英文:</summary>

Working with this simple code, can someone explain how are the last two lines compiled
```make
PROJECT_NAME     := PRJ
TARGETS          := nrf52840_xxaa
OUTPUT_DIRECTORY := _build

SDK_ROOT := ../nRF5_SDK_17.1.0_ddde560

$(OUTPUT_DIRECTORY)/nrf52840_xxaa.out: \
  LINKER_SCRIPT  := Core/PRJ.ld

答案1

得分: 1

最后两行不指定任何构建规则,而是为目标$(OUTPUT_DIRECTORY)/nrf52840_xxaa.out和变量LINKER_SCRIPT指定了目标特定变量值。构建规则要么在其他地方指定,要么使用默认构建规则。

英文:

The last two lines don't specify any build rule, but instead specify a target-specific variable value for the target $(OUTPUT_DIRECTORY)/nrf52840_xxaa.out and the variable LINKER_SCRIPT. The build rule is either specified elsewhere, or a default build rule is used.

huangapple
  • 本文由 发表于 2023年2月6日 19:05:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/75360503.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定