Makefile 重複定義 target - Linux

Olga avatar
By Olga
at 2010-06-03T16:03

Table of Contents

如果我有兩個 Makefile
~/test/Makefile
~/test/subdir/Makefile

在 ~/test/Makefile 定義了 hello 這個 target,
而 ~/test/subdir/Makefile 裡有 include ~/test/Makefile

我希望能在 ~/test/subdir/ 底下 make hello 能在原本內容指令之前和之後,
多作一個指令,但是不能修改 ~/test/Makefile 的內容,
又不把上層的指令整個複製過來,~/test/subdir/Makefile 該怎寫呢?

範例:
~/test/Makefile 內容如下:
hello:
@echo "hello here"

~/test/subdir/Makefile 內容如下:
include ../Makefile

hello:
這邊該怎寫?


要怎寫才能在 ~/test/subdir/ 底下 make hello 能秀出:
say hello
hello here
bye bye




--
Tags: Linux

All Comments

請問ubuntu10.04的security源

Annie avatar
By Annie
at 2010-06-03T13:00
每次ubuntu更新只要有用到security.ubuntu.com的包,都非常非常的慢 像是更新內核之類的...可能光是下載個40幾mb的東西就可以載到5、6個 小時之久= = 想請問可不可以換掉ubuntu的security源,因為我更換套件庫來源只能換 其他一般的軟件包的,不能換掉securit ...

Invalid Magic Number (Ubuntu 10.04)

Dinah avatar
By Dinah
at 2010-06-03T12:23
小弟用的是wubi裝的ubuntu9.10 之前成功升級到了Ubuntu10.04 用了大概三天 但是今天早上更新了2.6.32-22 kernel的一些lib 我記不是很清楚 隱約記得有什麼2.6.32-22-image之類的 結果現在進入GRUB的開機選單選了kernel之後 會出現 error: ...

關於wget

Ophelia avatar
By Ophelia
at 2010-06-03T11:37
請問要如何設定才能and#34;完全and#34;下載目錄下的東西呢? 我用-m的指令 還是只能下載表面的 例如說 我想下載http://abc.edf/11/22/下的東西 http://abc.edf/11/22/的目錄下有 1.rar 2.rar 3.rar 但網頁給的連結只有 1.ra ...

mount未finalize燒錄光碟

Susan avatar
By Susan
at 2010-06-03T11:28
mount 未finalize的 燒錄光碟, 出現下列 訊息,好像是識別為空白光碟。 mount: block device /dev/sr0 is write-protected, mounting read-only mount: wrong fs type, bad option, bad superb ...

ubuntu遠傳行動寬頻3.5G網卡上網問題

Valerie avatar
By Valerie
at 2010-06-03T11:25
我是使用ubuntu 10.4 也設定好了行動寬頻上網 現在只要插上行動網卡就可以自動播接上網 但是一但ubuntu一抓到網卡上的隨身碟就離線了 退出或是安全移除裝置都沒找不到行動寬頻的上網了 請問要如何解決,謝謝 - ...