Makefile的gcc加入-I沒做用 - Linux

Table of Contents

我在bash下指令

gcc hello.c -I./myinclude 是可以成功compile出a.out的

但是改在Makefile如下,打make,就會出現找不到.h檔 No Such File 的問題

main: hello.o
gcc -Wall -o $@ $^ -I./myinclude

該如何改?

--

All Comments

Doris avatarDoris2008-12-16
用$PWD怎麼樣? (廢物推文不足以轉信orz||)
Margaret avatarMargaret2008-12-20
-I先放在前面勒
Enid avatarEnid2008-12-24
-I 放前面也是沒有做用
Iris avatarIris2008-12-24
如果你的Makefile只有那兩行的話是正常的