Makefile:已忽略模式规则
Makefile: ignored pattern rule
我有一个C++项目需要头文件。我用python脚本从一些文件(.srv)构建了一些头文件。如果头丢失或srv文件发生了更改,我希望我的Makefile运行我的脚本。我在我的makefile中添加了这一行:
include/services/%.h : include/srv/%.srv
python headersFromSRV.py $<
当我试图构建我的项目时,我收到错误消息:
fatal error: 'include/services/robot_device_list.h' file not found
#include "include/services/robot_device_list.h"
这是逻辑,因为文件还不存在,但它不会调用规则来创建它。我的规则出了什么问题?
规则本身是可以的,但您的问题可能是makefile不知道它是一个需求。我猜错误消息来自您的C/C++编译器,该编译器正在构建其他目标。您可能需要添加robot_device_list.h作为该目标的依赖项,因此makefile知道他需要首先构建它。例如
foo.exe: foo.o
(your link statement)
foo.o: foo.c include/services/robot_device_list.h
(your compile statement)
相关文章:
- 具有奇怪重复模板模式的派生类中的成员变量已损坏
- 此代码是否违反一个定义规则
- 为什么在保护模式下继承升级不起作用
- 如何在全屏模式下(在OpenGL中)使背景透明
- 生成文件不对文件使用隐式规则
- 生成文件匹配规则和配方中的模式
- 需要帮助了解Makefile模式规则%:%.o
- 生成文件:子目录的模式规则
- NMake 模式规则
- 将Javascript正则表达式模式转换为C++std::regex的规则
- 错误:"混合的隐式和静态模式规则"在我的生成文件中
- Makefile:已忽略模式规则
- 具有混合依赖项的生成文件模式规则
- 如何在makefile中扩展模式规则
- 如何编写模式规则来分隔对象文件和源文件的位置
- 是否存在用于在子类的数据上实施规则的设计模式
- 生成文件模式规则:循环生成文件.o < - 删除生成文件依赖项
- 生成文件模式规则差异
- 使用stack,编写一个程序,该程序使用以下规则确定字符模式是否有效:a ^N B^N
- 如何使用std::string的值作为Flex规则的模式