gpt4 book ai didi

makefile - 获取 Makefile 规则的文件扩展名

转载 作者:行者123 更新时间:2023-12-05 01:47:16 24 4
gpt4 key购买 nike

如果我有以下规则

myfile.ext:
...
# `extname $@` or something

如何从规则主体中引用扩展(在本例中为 ext)?

最佳答案

$(suffix)函数做你想做的事。

$(suffix names…)

Extracts the suffix of each file name in names. If the file name contains a period, the suffix is everything starting with the last period. Otherwise, the suffix is the empty string. This frequently means that the result will be empty when names is not, and if names contains multiple file names, the result may contain fewer file names.

For example,

$(suffix src/foo.c src-1.0/bar.c hacks)

produces the result ‘.c .c’.

关于makefile - 获取 Makefile 规则的文件扩展名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28749778/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com