Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 软件时空 > 软件相关 > Make Study 1
【标  题】:Make Study 1
【关键字】:Make,Study
【来  源】:http://blog.chinaunix.net/article.php?articleId=48747&blogId=10296

Make Study 1

Your Ad Here

Abstract: Some Make topic

An option of c compiler to produce dependency

cc -M main.c

The result is main.o: main.c defs.h

For Sun forte 6, -xM -xM1

Some of automatic variable

$@   the file names of the target of the rule

$% the target menber name, when the target is an archive member

$< the names of the first dependency

$? the names of all the dependencies that are newer than the target,with space between them

$^ the names of all the dependencies, whith spaces between them

Command Execution

The command is excuted by makeing a new subshell for eachline.

One line is One command

If you want to excute more than one commands in same shell, use ; to separate the commands in online.

For example, cd /usr/bin; ls

Or use \ to split shell command to multiple lines

For example,

cd /usr/bin; \

ls

Use - before the command to ignore errors, or "-i" option when run make

clean:
        -rm -f *.o

Canned Command Sequences

The canned commands is actually a variable, so the name must not confilict with other variable names.

define run-yacc
yacc $(firstword $ˆ)
mv y.tab.c $@
endef

The define directive does not expand.

To use the command sequences, substitute the vaiable into the commands of a rule.

foo.c : foo.y
        $(run-yacc)

Substitution References

It has the form ‘$(var:a=b)’ (or ‘$’)
and its meaning is to take the value of the variable var, replace every a
at the end of a word with b in that value, and substitute the resulting
string.

foo := a.o b.o c.o
bar := $(foo:.o=.c)
sets ‘bar’ to ‘a.c b.c c.c’

QA&STE Frequently-Asked-Questions Part II:【上一篇】
Imake study 1:【下一篇】
【相关文章】
  • CMake 跨平台安装工具
  • makefile 大全
  • GNU make和makefile非常简介
  • Makefile 一步步学习
  • Make使用方法
  • Makefile(GNU)
  • make a searchplugin for firefox
  • the study of microsoft cluster
  • CVS, Automake与Autoconf简介
  • Make packages in Solaris
  • 【随机文章】
  • FC5下启动tftp服务
  • ADO and Python (10-11)
  • 黑盒、白盒与ALAC测试
  • 晕倒,原来Java 1.5中有了可变参数和新的for each的语法了,今天才知道!
  • 这是一个色子代码,制作精美,带源码
  • iSCSI技术背景介绍
  • Struts+hibernate+Spring 的结构介绍
  • CISCO 技术大集合(2)
  • 存储过程实例(一)
  • 计算机等级考试高分策略
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.