亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1494 | 回復: 0
打印 上一主題 下一主題

Solaris上的makefile [復制鏈接]

論壇徽章:
0
跳轉到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2006-12-30 10:10 |只看該作者 |倒序瀏覽
(歡迎轉載,轉載請注明出處--chley)
Solaris上的make與其它Unix或GNU make都有所不同,特別是在定義和使用Macro時。
make(1S)
target: something to create or update
dependency: something that a target depends on.
rule: a list of commands, can be explicit or implicit(supplied by make)
調用make命令,無參數(shù)時,make會檢查makefile中每個target的dependency,如果某個target
file不存在或者比dependency舊,則rebuild it。
如果一個target在makefile中沒有entry,或者它的entry沒有rule,make會試圖使用下述方法尋找一個合適的rule:
1)模式匹配規(guī)則
2)implicit
rule:可以是用戶提供的makefile定義的,也可以是標準的潛規(guī)則(/usr/share/lib/make/make.rules)。
3)SCCS retrieval
4)  rule from .DEFAULT entry.
target format:
target [:|::] [dependency] ... [;command] ...
          [command]
          ...
注:1)target可以是一個name,也可以是一列空格分開的name
       2)dependency可以是一個,也可以是多個
       3)dependency可以用;結束,后跟一個Bourn shell command.
       4)在rule中的command都必須以tab開始,并且必須是Bourn shell command. 可以用 \
轉義跨越多行,但是每一行的開始都必須是TAB
%:模式匹配通配符,與shell中的*類似。
Macro:
基本格式
macro=value
=  定義一個macro
$() ${}  引用一個macro
+=   appends a string to a macro definition(兩邊必須有空格)
:=    條件賦值
:sh =   Define the value of a macro to be the output of  a  command
macro中的替代:
$(name:string1=string2)  $name中的string1會被string2代替。
$(name:op%os=np%ns) $name中的所有匹配op%os的字符串會被np%ns代替,例如
PROGRAM=fabricate
DEBUG= $(PROGRAM:%=tmp/%-g)  --
$(PROGRAM)中的所有字符串會被tmp/fabricate-g代替,從而DEBUG得到的就是tmp/fabricate-g
Dynamic Macros:
$*   basename of the current target
$<   name  of  a  dependency  file
$@  name of the current target
$?    The list of dependencies that are  newer  than  the target.  
$%   name of the  library  member  being  processed
Conditional Macro Definitions:
target-list := macro = value
表示在處理target
list中的target及其dependency時,macro使用這里給出的value,而不是其它地方可能已經(jīng)定義的value。
target-list := macro += value
使用這種格式時,表示在處理target-list中的target時,暫時把valueappend到macro中。
Rules:
+   make總會執(zhí)行這條命令,即使在命令行使用了 -n
@  在執(zhí)行之前,不打印這條命令
Pattern Matching Rule:
tp%ts:dp%ds
       rule
tp is a target  prefix,ts  is a target suffix. dp is a dependency
prefix, and ds is a dependency suffix(any of which  can  be  null).
Suffix Rules:
DsTs: rule
Ts is the suffix of the target, Ds is  the  suffix  of the  dependency
file.
To refer to a shell variable, use a double-dollar-sign ($$).
命令替換:
MACRO:sh =command -- MACRO的value是command的輸出,如 POUND_SIGN:sh=  echo \\043
$(MACRO:sh) -- 在sh中執(zhí)行MACRO,并捕獲輸出,如:REAL_CC=  $(CW_CC_CMD:sh)
               
               
               
               
               

本文來自ChinaUnix博客,如果查看原文請點:http://blog.chinaunix.net/u/24393/showart_223506.html
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復

  

北京盛拓優(yōu)訊信息技術有限公司. 版權所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關心和支持過ChinaUnix的朋友們 轉載本站內容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP