当前位置:网站首页>8. get directory function / get file function -dir / -notdir

8. get directory function / get file function -dir / -notdir

2022-06-21 18:39:00 Qimu king · Prince

1. Take the directory function —dir.

$(dir <names...>)

1.1 Introduce

$(dir <names...>)
 name : Take the directory function ——dir.
 function : From the file name sequence <names> Take out the table of contents . The directory section refers to the last backslash (“/”) Before 
 Part of . If there is no backslash , Then the return “./”.
 return : Return the file name sequence <names> The table of Contents section of .

1.2 Example

 Insert picture description here

all:
	$(dir dir/dir_test.c filename)
# dir/ ./

 Insert picture description here

2. Take file function —notdir

2.1 Introduce

$(notdir <names...>)
 name : Take file function ——notdir.
 function : From the file name sequence <names> Take out the non directory part of . The non directory part refers to the last backslash (“ /”)
 The next part .
 return : Return the file name sequence <names> The non catalog part of .

2.2 Example

 Insert picture description here

$(notdir dir/dir_test.c filename)
# The return value is “dir_test.c filename”

 Insert picture description here

原网站

版权声明
本文为[Qimu king · Prince]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/172/202206211701299447.html