这在 make 中起什么作用?

问题描述 投票:0回答:1

我一直在阅读 make 手册,试图破译现有的

Makefile
。 我被困在这一行的
filter-out
上:

KERNEL_ELF_DEPS = $(filter-out %: ,$(file < $(KERNEL_ELF).d)) $(KERNEL_MANIFEST) $(LAST_BUILD_CONFIG)

地点:

KERNEL_ELF = target/aarch64-unknown-none-softfloat/release/kernel

制作

filter-out
部分:

$(filter-out %: ,$(file < target/aarch64-unknown-none-softfloat/release/kernel.d))

根据我的阅读,我认为这应该读入文件

target/aarch64-unknown-none-softfloat/release/kernel.d
并过滤掉以
: 
结尾的任何字符串。

该文件包含

/Users/simgar/projects/rust-raspberrypi-OS-tutorials/01_wait_forever/target/aarch64-unknown-none-softfloat/release/kernel: /Users/simgar/projects/rust-raspberrypi-OS-tutorials/01_wait_forever/build.rs /Users/simgar/projects/rust-raspberrypi-OS-tutorials/01_wait_forever/src/_arch/aarch64/cpu/boot.rs /Users/simgar/projects/rust-raspberrypi-OS-tutorials/01_wait_forever/src/_arch/aarch64/cpu/boot.s /Users/simgar/projects/rust-raspberrypi-OS-tutorials/01_wait_forever/src/bsp/raspberrypi/kernel.ld /Users/simgar/projects/rust-raspberrypi-OS-tutorials/01_wait_forever/src/bsp/raspberrypi.rs /Users/simgar/projects/rust-raspberrypi-OS-tutorials/01_wait_forever/src/bsp.rs /Users/simgar/projects/rust-raspberrypi-OS-tutorials/01_wait_forever/src/cpu/boot.rs /Users/simgar/projects/rust-raspberrypi-OS-tutorials/01_wait_forever/src/cpu.rs /Users/simgar/projects/rust-raspberrypi-OS-tutorials/01_wait_forever/src/main.rs /Users/simgar/projects/rust-raspberrypi-OS-tutorials/01_wait_forever/src/panic_wait.rs

所以我期望获得除第一个路径之外的所有路径,但我什么也没得到。 我应该期待什么? 我的推理哪里出了问题?

更新

make --版本是3.81

makefile gnu-make
1个回答
0
投票

GNU Make 3.81 发布已近 19 年前(2006 年 4 月)。

GNU Make 4.2 中添加了

file
函数读取文件的功能,该版本在大约 9 年前(2016 年 5 月)发布:请参阅 https://git.savannah.gnu.org/cgit/make.git /树/新闻?h=4.4.1#n366

您必须升级 GNU Make 才能运行此 makefile。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.