c - 让 Scons 意识到我的链接描述文件已经改变

标签 c ld scons

我正在使用 Scons 构建我的 C 项目。我有一个使用 -Xlinker 标志指定给 ld 的外部链接器文件。我的问题是,每当我更改 -Xlinker 指向的链接描述文件时,Scons 都不会考虑更改:

scons: done reading SConscript files.
scons: Building targets ...
scons: `.' is up to date.
scons: done building targets.

我如何强制 Scons 监听我的链接描述文件的变化,并在该链接描述文件发生变化时重新编译项目?

最佳答案

env = Environment()
env['LINKFLAGS']+=' -T linkerscript.lds '
Depends(program, 'linkerscript.lds')

Reference

同样对于显式依赖,check here

关于c - 让 Scons 意识到我的链接描述文件已经改变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9789899/

相关文章:

c - 在 C 中初始化 struct 中的 int 数组

c++ - 找不到版本 GLIBCXX_3.4.11(buildW.mexglx 需要)

python - 司康斯 : src and include dirs

scons - 如何防止 scons 清理父目录和同级目录?

c - 为什么这个程序给我一个 SIGFPE?

c++ - C/C++ 构建通用栈帧来调用不同的回调函数

linux - glui/usr/bin/ld : cannot find -lXmu

gcc - 搜索和链接库目录的顺序

scons - 强制 scons 使用 Sconstruct 文件作为全局依赖项

c - LD_PRELOAD-ed open() + __xstat() + syslog() 结果存入 EBADF