cost 217 ms
在 Makefile 中,我应该如何将 header 个文件放入先决条件列表中? (头文件包括函数内部的执行代码行)

[英]In Makefile, how should I put header files in prerequisite list? (header file includes execution code lines for inside a function)

有时我们必须处理 header 文件,其中包含使用宏或先前包含文件中定义的变量的内联代码片段。 我在尝试使 C object 文件依赖于包含的 header 文件时遇到了这样的问题。 所以我在 stackoverflow 上查找并发现了这个,但是张贴者的问题不必要地复杂,所以他似乎没有得到预期的答 ...

2022-11-15 08:46:42   1   33    c / makefile  
Makefile 除非在同一配方中定义,否则不将环境变量导出到 submake

[英]Makefile not exporting env var to submake unless defined in the same recipe

请看下面的Makefile : install配方只有在我手动export配方中的环境变量VIRTUAL_ENV时才有效; 将它链接到下一个命令。 换句话说, install配方的第一行目前正在“做一些特别的事情”,我无法理解。 这个export被要求两次,这是怎么回事? ...

将 object 文件链接到 Makefile 中的 C 文件时出现问题

[英]Troubles linking an object file to a C file in a Makefile

我得到了一个 object 文件set.o*以及 header 文件set.h 。 我需要对我创建的文件main.c中的函数运行测试。 我写了以下内容Makefile 这个Makefile一直给我错误: 如果有人知道我哪里出错了,将不胜感激:) ...

2022-11-14 17:05:04   1   30    c / makefile  
如何确认库是静态链接的?

[英]How to confirm a library is linked statically?

我编辑了我的 CMake 脚本,将 libcurl 与我在 Linux 上的 C++ 应用程序链接起来。 除了将 libcurl 添加到我的目标链接库之外,我还设置了 libcurl 标志DCURL_STATICLIB 。 检查此静态链接而不是动态链接的最终方法是什么? ...

“进行安装”错误。 make (e=2) 系统找不到指定的文件

[英]"make install" error. make (e=2) The system can not find the file specified

我已经找了几个小时了,仍然找不到解决方案,感到非常沮丧。 我已经用巧克力和 docker 安装了 make 工具,我正在尝试构建 linuxkit 工具https://github.com/linuxkit/linuxkit然后使用它为 Docker 构建 linux VM 映像来自自述文件: “L ...

Output 的 printf '\x41\n' | Makefile 中的猫不同于 shell 中的 output

[英]Output of printf '\x41\n' | cat in Makefile is different than the output in shell

我在 Linux 上使用 GNU Make。这是我的 Makefile。 这是 output: 使用的 shell 是 Dash: 为什么当我通过cat pipe 时 output 变得不同? 奇怪的是,当我直接在其上执行命令时, dash本身具有不同的行为。 这里发生了什么? 为什么Makefi ...

错误:C 编译器“C:/Program Files...”无法编译简单的测试程序

[英]Error: C compiler "C:/Program Files..." is not able to compile a simple test program

我正在努力从源代码安装 Carla 并且已经安装了虚幻引擎。 当我尝试使用make Python API命令构建 CARLA 时,出现如下错误 C 编译器“C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/M ...

gnumake 模式替换

[英]gnumake pattern subsituation

在使用 GNUMAKE $(subst)时遇到一些问题我无法解释我的目标是将“SRC_DIR”目录转换为“OBJ_DIR”在一种情况下有效,另一种情况下无效 - 我不明白为什么。 我认为,下面的两个“HERE{1|2}”结构应该是相同的,但似乎并非如此。 我不认为这是一个“延迟执行”问题,因为我使用 ...

ld.exe: 找不到 src: 权限被拒绝

[英]ld.exe: cannot find src: Permission denied

基本上我正在尝试使用 OpenGl 和 SDL 构建游戏引擎。 我使用 makefile 来编译它,但出现错误。 在我重新组织文件夹结构并将 src 文件夹包含到包含路径后,错误开始出现,因此我可以使用绝对路径访问它们。 例如Renderer/Camera.h而不是../Renderer/Camer ...

在 makefile 中完成 Bash

[英]Bash-completion in makefile

我有一个makefile,想问下具体targets编译的文件名。 当我将make写到 bash 并按下选项卡时,它会提示 makefile 中的目标。但是,当我取消注释下面注释的行时,它不会提示。 您能解释一下为什么会发生以及解决方案吗? 我既要解决又要理解 make 语法(和规则)。 据我所知, ...

有没有办法获取正在运行 makefile 目标的信息

[英]Is there a way to get the info from which makefile target is being running

我有庞大的代码库,其中包含大量的 makefile。 我试图了解流程。 为此,我正在运行带有调试标志 ( --debug=basic ) 的 make 命令,以获取诸如执行目标的顺序之类的信息。 构建命令:- make --debug=basic release 这是调试信息:- 我可以看到被触发的 ...

在 shell function 中访问导出的变量

[英]Accessing exported variables in a shell function

有没有办法在shell function 中使用导出变量而不需要子 make? 以下面的例子为例。 如果我像这样运行fizz目标,我会得到以下 output。$ make fizz fizz make fizz make[1]: Entering directory '/home/jshbrntt/ ...

如何使 Makefile 变量在命令之间保持不变

[英]How to make Makefile Variables persist between commands

这是一个示例 makefile,它演示了我要完成的工作: 这是终端 output:user:~/Project/maketest$ make debug-android set PLATFORM to android debug wrongName 当调用目标make debug-android时 ...

如何使用 `make` 命令将环境变量传递给 docker 容器?

[英]How to pass environment variable to docker container using `make` command?

我有一个 docker 容器正在运行,我想执行命令make target-branch branch="branch_name"以便在容器内部我将TARGET环境变量设置为"branch_name" 。 我尝试在Makefile中编写以下内容 它没有用,进入容器并执行printenv后没有这样的环 ...

不使用 IDE 时如何设置包含路径,这样就不麻烦了

[英]How do I set include paths when not using an IDE so it isn't cumbersome

我一直在尝试在没有 IDE 的情况下工作。现在我正在设置一个我在 stm32cubeIDE 上完成的项目。 我已经到了将标题等添加到 main.c 文件的地步。 在 IDE 中,我能够告诉 IDE 在哪里查找标头,例如驱动程序文件夹或我调用它的 w/e。 没有 IDE,我不得不 go 并更改 #in ...

makefile 带索引的变量自动赋值

[英]makefile variable automatically assignment with index

我对 makefile 中的变量赋值有疑问。给定 2 个大小相同的列表,如下所示:(两个列表之间没有任何字符或字符串匹配) 我需要一些索引来激活,例如 1 和 3 在 shell 中键入“make all”后,我应该如何分配 $(act_obj) 以获取 output 作为“act_obj = on ...

2022-10-04 10:57:50   2   114    makefile  
Makefile 用于不同的程序变体

[英]Makefile for different variants of program

我有一个程序,为实验目的而设置,可以构建不同的变体,由预处理器开关控制。 目前,我的 makefile 已设置为生成二进制文件build/[flags] ,其中flags是要构建的不同变体的字母编码。 我用二次扩展来解决这一切,ip,解码标志字符串,把它变成命令行开关给编译器。 这有点难以维护,我想 ...

2022-10-03 19:27:42   2   105    makefile  
makefile、gcc、arm-cortex collect2.exe:错误:ld 返回 1 退出状态

[英]makefile, gcc, arm-cortex collect2.exe: error: ld returned 1 exit status

这个 makefile 是由 STM32CubeMX 自动生成的。 我在使用 arm-gnu-toolchain 版本 > 9.2.1 时收到此 linker 错误。 我需要解决这个问题。 我无法使用 make 运行良好的版本,因为 openocd 调试器与 arm-gnu-toolchain ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM