Makefile 重複定義 target - Linux
By Olga
at 2010-06-03T16:03
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
--
~/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
Related Posts
請問ubuntu10.04的security源
By Annie
at 2010-06-03T13:00
at 2010-06-03T13:00
Invalid Magic Number (Ubuntu 10.04)
By Dinah
at 2010-06-03T12:23
at 2010-06-03T12:23
關於wget
By Ophelia
at 2010-06-03T11:37
at 2010-06-03T11:37
mount未finalize燒錄光碟
By Susan
at 2010-06-03T11:28
at 2010-06-03T11:28
ubuntu遠傳行動寬頻3.5G網卡上網問題
By Valerie
at 2010-06-03T11:25
at 2010-06-03T11:25