gio/tests: fix race when generating code
authorRoss Burton <ross.burton@intel.com>
Tue, 4 Feb 2014 13:15:08 +0000 (13:15 +0000)
committerRoss Burton <ross.burton@intel.com>
Mon, 17 Feb 2014 10:21:31 +0000 (10:21 +0000)
commit299ca6dc1e54797e6fc5264c7b19b08bd726ca83
tree8d28b99df842e2474efeb85879122ccd3ed3ac4b
parented017994c9396f10c87646b5fa3639e1ca1925b8
gio/tests: fix race when generating code

There is a race condition in the makefile that can result in build failures like this in parallel builds:

| ./gdbus-test-codegen-generated.h:7:0: error: unterminated #ifndef
|  #ifndef __GDBUS_TEST_CODEGEN_GENERATED_H__

This is because a rule like this:

x.c x.h: prerequisites
@commands

doesn't consider x.c and x.h together. Instead, it expands to two rules, one to
generate x.c and one to generate x.h, which happen to run the same commands.  In
the worst case they execute in parallel, overwriting each other's output.

Signed-off-by: Ross Burton <ross.burton@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=723616
gio/tests/Makefile.am