我試圖設置一個nmake makefile來將我們的balsamiq樣機文件自動導出到png文件,但是恐怕我無法制定一個通用規則的正面和反面。爲此,沒有明確列出我想要導出的所有文件。在makefile中使用帶有通配符的nmake
This page詳細介紹了用於導出文件的命令行語法,this page包含一個看起來像包含.obj文件到.exe文件的通用規則的示例。
到目前爲止,我已經嘗試了生成文件看起來是這樣的:
.bmml.png:
"C:\Program Files\Balsamiq Mockups\Balsamiq Mockups.exe" export $< [email protected]
但是,這是行不通的。
如果我只需運行NMAKE(有一些過時的PNG文件),執行nmake只是做這個:
[C:\Temp] :nmake
Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
[C:\Temp] :
如果我問它來建立一個特定的文件,它這樣做:
[C:\Temp] :nmake "TestFile.png"
Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
NMAKE : fatal error U1073: don't know how to make '"TestFile.png"'
Stop.
[C:\Temp] :
任何能夠讓我直立的nmake大師?
一個例子生成文件簡單地通過複製它們,進行實驗,使從.txt文件.dat文件,如下所示:
.txt.dat:
copy $< [email protected]
這個什麼都不做一樣,所以顯然我不理解如何這種通用規則起作用。我是否需要指定一個上面列出我想要的文件的目標?
編輯:爲了應對新的答案:
這個Makefile:
{}.txt{}.dat:
copy $** [email protected]
與此文件(TEST.DAT)
1
2
3
和下面的命令:
NMAKE test.txt
生成此錯誤消息:
[C:\] :nmake test.txt
Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
NMAKE : fatal error U1073: don't know how to make 'test.txt'
Stop.
這是非常好的。唯一的一點是,即使目標是最新的,我也會發現它每次都會重建。如果目標比源更新,那麼如何讓它跳過? – CashCow 2011-12-29 17:54:18