Browse Source

Makefile: fix parallel `update-mocks` build.

We always rebuild headerversions to examine critical system headers,
however that stomps on parallel builds with:

make[1]: execvp: tools/headerversions: Text file busy

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
pull/2938/head
Rusty Russell 5 years ago
parent
commit
af5b3203b5
  1. 3
      Makefile

3
Makefile

@ -385,8 +385,9 @@ gen_version.h: FORCE
@if cmp $@.new $@ >/dev/null 2>&2; then rm -f $@.new; else mv $@.new $@; echo Version updated; fi
# We force make to relink this every time, to detect version changes.
# Do it atomically, otherwise parallel builds can get upset!
tools/headerversions: FORCE tools/headerversions.o $(CCAN_OBJS)
@$(LINK.o) tools/headerversions.o $(CCAN_OBJS) $(LOADLIBES) $(LDLIBS) -o $@
@trap "rm -f $@.tmp.$$$$" EXIT; $(LINK.o) tools/headerversions.o $(CCAN_OBJS) $(LOADLIBES) $(LDLIBS) -o $@.tmp.$$$$ && mv $@.tmp.$$$$ $@
# That forces this rule to be run every time, too.
gen_header_versions.h: tools/headerversions

Loading…
Cancel
Save