歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> make Nothing to be done for all

make Nothing to be done for all

日期:2017/3/2 9:49:22   编辑:關於Linux

剛開始寫Makefile,有好多東西都不太懂,這些也是我初學中的一些不解吧,找到答案了,希望能給像我一樣的初學者一些幫助。

make Nothing to be done for 'all'

這句提示是說明你已經這句提示是說明你已經編譯好了,而且沒有對代碼進行任何改動。編譯好了,而且沒有對代碼進行任何改動。

makefile 實例

[root@localhost b]# make
for i in temp1 temp2;do make -C $i||exit main.o;done
make[1]: Entering directory `/home/b/temp1'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/b/temp1'
make[1]: Entering directory `/home/b/temp2'
gcc -c -o printhello21.o printhello21.c
gcc -c -o printhello22.o printhello22.c
ar -r temp2.o printhello21.o printhello22.o
make[1]: Leaving directory `/home/b/temp2'
gcc -o b main.o temp1/temp1.o temp2/temp2.o
[root@localhost b]# ls
b main.c main.o Makefile temp1 temp2
[root@localhost b]# ./b (執行生成的可執行程序 )
hello_11
hello_12
hello_21
hello_22

Copyright © Linux教程網 All Rights Reserved