怎樣才能通過修改Makefile,實現distcc編譯

编译打包和其他
回复
peng6662001
帖子: 15
注册时间: 2008-08-19 9:25

怎樣才能通過修改Makefile,實現distcc編譯

#1

帖子 peng6662001 » 2013-10-11 18:02

我使用make -j4 CC=distcc進行編譯.
distccmon-text可以檢測到distcc運行.但我在Makefile里直接設置CC = distcc,使用make -j4卻沒有效果,不會使用distcc編譯.
另外,-j4 這個功能可以通過修改Makefile做到嗎?
我想實現只用make進行編譯,就包含-j4和CC=distcc的功能.

還有
編譯過程中打印如下信息.
gcc -g -O2 -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -Wdeclaration-after-
statement -fno-common -fPIC -o dbus-cleanup-sockets dbus-cleanup-sockets.o

我知道編譯選項是怎麼來的
CFLAGS = -g -O2 -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -Wdeclaration-after-statement -fno-common -fPIC

但怎樣做到gcc前加distcc.使編譯命令形如:
distcc gcc -g -O2 -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -Wdeclaration-after-
statement -fno-common -fPIC -o dbus-cleanup-sockets dbus-cleanup-sockets.o

這樣應該就不用再make時加CC=distcc了.
头像
lhw828
帖子: 2797
注册时间: 2007-03-15 16:58
来自: 湖北武汉
联系:

Re: 怎樣才能通過修改Makefile,實現distcc編譯

#2

帖子 lhw828 » 2013-10-19 14:19

:em06 太高端了
回复