当前位置:网站首页>10. Writing rules - Document Search
10. Writing rules - Document Search
2022-07-29 02:47:00 【Qimu king · Prince】
Writing rules - Document search
1. VPATH
In some big projects , There are a lot of source files , Our usual practice is to classify these many source files , And stored in different directories . therefore , When make When you need to find the dependency of a file , You can put a path in front of the file , But the best way is to give a path to make, Give Way make It's automatically looking for .
Makefile Special variables in the file “VPATH” That's how it works , If this variable is not specified ,make Only look for dependent and target files in the current directory . If you define this variable , that ,make When the current directory cannot be found , Found the specified directory .
VPATH = src:../headers
The above definition specifies two directories ,“src” and “…/headers”,make Search in this order . The catalogue is made up of “ The colon :” Separate .( Of course , The current directory is always the highest priority search place )
2. vpath
Another way to set the file search path is to use make Of “vpath” keyword ( Be careful , It's all lowercase ), This is not a variable , This is a make Key words of , This and the one mentioned above VPATH Variables are very similar , But it's more flexible . It can specify different files in different search directories . It's a very flexible feature . It can be used in three ways :
1 . Specify the search directory for files that match the pattern .
vpath <pattern> <directories>
2 . Clear the search directory for files that match the pattern .
vpath <pattern>
3 . Clear all file search directories that have been set up .
vpath
vapth The use method needs to include “%” character .“%” It means to match zero or several characters , for example ,“%.h” All in the form of “.h” Final document . Specifies the file set to search for , And then specify the search directory of the file set . for example :
vpath %.h ../headers
This statement means , requirement make stay “…/headers” Search the directory for all of the “.h” Final document .( If a file is not found in the current directory )
3. vpath Different search strategies
We can use it continuously vpath sentence , To specify different search strategies .
If it's continuous vpath The same occurs in the statement , Or repeated , that ,make According to vpath Execute the search in the order of statements . Such as :
vpath %.c foo
vpath % blish
vpath %.c bar
It said “.c” Final document , First in “foo” Catalog , And then there was “blish”, And finally “bar” Catalog .
vpath %.c foo:bar
vpath % blish
The above statement means “.c” Final document , First in “foo” Catalog , And then there was “bar” Catalog , The last is “blish” Catalog .
边栏推荐
- 区区区间---线段树lazy标记板子题
- C语言:判断字母
- 第六天笔记
- VR safety training of mine mining virtual reality improves employees' vigilance and protection awareness
- HTTP cache
- Cuda-npp image and video processing
- Read the recent trends of okaleido tiger and tap the value and potential behind it
- Youxuan software appoints Huang Zhijun as the general manager of the company
- 践踏---离散化+树状数组+差分
- Small program source code for campus stray cat information recording and sharing / wechat cloud development medium big cat spectrum small program source code
猜你喜欢

全新UI四方聚合支付系统源码/新增USDT提现/最新更新安全升级修复XSS漏洞补单漏洞

ES6 detailed quick start!

MySQL basic operation and comprehensive instance project based on MySQL basic operation

FPGA skimming memory (Verilog implementation of ram and FIFO)

自动分账系统哪家好?

6 years of testing experience, teaching you how to test ~ how to control the project

Qt编写物联网管理平台48-特色功能设计

Read the recent trends of okaleido tiger and tap the value and potential behind it

Redis master-slave mode, sentinel cluster, fragment cluster

多重继承与派生类成员标识
随机推荐
XSS range (II) xss.haozi
Only when you are far away will you miss
并发模式之生产者消费者模式
qt QStringList用法
Production scheme and advantages of online 3D digital exhibition hall
Really time NTP service startup command
平凡的快乐
【报错】node:internal/modules/cjs/loader:936 【解决方法】
第七天笔记
6-21 vulnerability exploitation MySQL weak password cracking
主从复制及其原理
12.书写规则-静态模式
Others' happiness
Multimodal unsupervised image to image translation
FTP协议详解
Rust list (VEC) replication
多重继承与派生类成员标识
idea替换所有文件中的内容
Redis主从模式、哨兵集群、分片集群
白马过隙的时光