[Dnsmasq-discuss] [PATCH] Fix race condition issue in makefile.

Yousong Zhou yszhou4tech at gmail.com
Sun Jan 4 10:58:24 GMT 2015


When doing rebuild with `make -j32' or the like, a race condition is
likely to occur and the following error be emitted when doing parallel
build.

	make[1]: Entering directory `/home/yousong/git-repo/dnsmasq/src'
	cc  -o dnsmasq cache.o rfc1035.o util.o option.o forward.o network.o dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o dhcp-common.o outpacket.o radv.o slaac.o auth.o ipset.o domain.o dnssec.o blockdata.o tables.o loop.o inotify.o
	cc: error: cache.o: No such file or directory
	cc: error: rfc1035.o: No such file or directory
	cc: error: util.o: No such file or directory
	...

Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
---
 Makefile |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 5675f60..bcbd557 100644
--- a/Makefile
+++ b/Makefile
@@ -148,10 +148,12 @@ $(copts_conf): $(hdrs)
 $(objs:.o=.c) $(hdrs):
 	ln -s $(top)/$(SRC)/$@ .
 
+$(objs): $(copts_conf) $(hdrs)
+
 .c.o:
 	$(CC) $(CFLAGS) $(COPTS) $(i18n) $(build_cflags) $(RPM_OPT_FLAGS) -c $<	
 
-dnsmasq : $(copts_conf) $(hdrs) $(objs)
+dnsmasq : $(objs)
 	$(CC) $(LDFLAGS) -o $@ $(objs) $(build_libs) $(LIBS) 
 
 dnsmasq.pot : $(objs:.o=.c) $(hdrs)
-- 
1.7.10.4




More information about the Dnsmasq-discuss mailing list