c++ - 如何让“make”知道其他目录的变化?
问题描述
在make
Cython 测试代码中创建文件时,我需要make
注意存储在其他目录中的 C++ 头文件中所做的更改。所以我想出了以下make
文件
CC=python3
compile: setup.py test.pyx test.pxd test.cpp ../source/test_source.cpp ../headers/test_header.h
$(CC) setup.py build_ext --inplace
目录结构如下
/cython
Makefile
test.pyx
test.pxd
test.cpp
setup.py
/headers
test_header.h
/source
test_source.cpp
在这里,Cython 文件test.pxd
直接包含 ,../source/test_source.cpp
其中还包含 header /header/test_header.h
。
makefile 第一次运行并编译。不幸的是,在我对 进行更改后../header/test_header.h
,似乎make
根本没有注意到这些更改。(但是,所做的更改../source/test_source.cpp
被 . 注意到了make
。)我知道这很可能是一个依赖问题。但是,在阅读了一些在线教程之后,我仍然不太明白如何正确设置这个依赖链。
解决方案
好吧,这个问题与 Cython 文件更相关,setup.py
并已在此处得到解答
推荐阅读
- vector - 如何检查结构集合是否在字段中具有重复值?
- django - 我正在尝试将客户连接到用户,但收到此错误:/user/'User' 对象的 AttributeError 没有属性'Customer
- python - 如何将'df'命令的shell输出转换为字典?
- azure - 由于可能的 MARS 代理 DLL 问题,Azure 备份失败
- node.js - NodeJS tls.connect() getPeerCertificate() 返回错误(多)但浏览器显示正常
- python - 为什么 nltk 停用词输出与 nltk word_tokenize 输出不匹配
- java - java selenium if else如何使用
- java - 比较字符串(用户输入任意数量的字符串),然后使用 for 循环判断哪个是第一个(基于哪个第一个字母先出现)
- python - 我可以关闭显示整个脚本的 matplotlib plt 图吗?
- flutter - 如何在flutter上为firestore写超时?