Skip to Content
C语言核心技术(原书第2版)
book

C语言核心技术(原书第2版)

by Peter Prinz, Tony Crawford
August 2017
Intermediate to advanced
798 pages
17h 44m
Chinese
China Machine Press
Content preview from C语言核心技术(原书第2版)
712
|
第
20
章
$
^
依赖条件列表,排除了重复的元素。
$?
比目标新的依赖条件列表。
$+
依赖条件的完整列表,包括重复的元素。
$%
如果目标是一个链接库成员,变量
$%
会生成成员名称,不带有链接库文件名。而
$@
生成链接库文件名。
上述最后一个自动变量引出了一种特殊目标的情况。因为大多数程序不仅依赖源代码,
还依赖链接库模块,对于目标是链接库成员的情况而言,
make
为这类目标提供一个特殊
的表示法:
archive_name
(
member_name
): [
prerequisites
]
[
command_script
]
链接库成员名称(
member name
)被放在圆括号内,而圆括号紧跟着放在链接库文件名
(
archive name
)后面,下面是一个示例:
AR = ar -rv
libcircularmath.a(circulararea.o): circulararea.o
$(AR) $@ $%
上述这条规则将执行下面的命令,加上或替换该链接库中的对象文件:
ar -rv libcircularmath.a circulararea.o
在其他
make
版本中,这些特殊变量通常也有以点作为起始的长名称,例如
$(.TARGET)
是
$@
的同义词。还有某些
make
程序使用
$>
符号表示所有依赖条件,而不是
GNU
make
的
$
^
。
当自动变量被展开成一个列表,例如一个文件名列表,元素之前以空格作分隔。
为了把文件名从目录中分隔出来,列表中的每个自动变量都有两个另外的版本,它们以
D
和
F
作为后缀。因为结果变量名是两个字符,不是一个,所以需要使用括号。例如,任 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

算法精讲视频课程:24篇系列讲座

算法精讲视频课程:24篇系列讲座

罗伯特·塞奇威克, 凯文·韦恩(Kevin Wayne)

Publisher Resources

ISBN: 9787111562207