Avoid race condition when using multiple make jobs
authorDiego 'Flameeyes' Pettenò <flameeyes@gentoo.org>
Thu, 23 Nov 2006 14:15:30 +0000 (15:15 +0100)
committerJosh Triplett <josh@freedesktop.org>
Thu, 23 Nov 2006 15:32:18 +0000 (07:32 -0800)
Avoid race condition when symlinking XML files.
When declaring a rule with many files as target, the rule is called
when any of them is requested, resulting in multiple for loops happening
during a make process using more than one job.
Also, use '$(LN_S) -f' rather than removing and recreating a file,
that one should be as supported as 'rm -f' and requires one less command.

src/Makefile.am

index fdbd6b4..b02caf3 100644 (file)
@@ -220,7 +220,4 @@ SUFFIXES = .xml
                    -o $@ $(srcdir)/c-client.xsl $< 
 
 $(EXTENSION_XML):
-       for i in $(EXTENSION_XML) ; do \
-           rm -f $$i ; \
-           $(LN_S) $(XCBPROTO_XCBINCLUDEDIR)/$$i $$i ; \
-        done
+       $(LN_S) -f $(XCBPROTO_XCBINCLUDEDIR)/$@ $@