build-sys: create parent directory for $(PATHFILES)

When building outside the source tree there is nothing to guarantee the
target directory exists before writing to it. Most of the time this just
happens to work because something else creates the directory but not
always. For example:

    $ mkdir build
    $ cd build
    $ ../configure --disable-dependency-tracking
    $ make libuuid/uuid.pc
      GEN      libuuid/uuid.pc
    /bin/sh: line 2: libuuid/uuid.pc.tmp: No such file or directory
    make: *** [libuuid/uuid.pc] Error 1
This commit is contained in:
Michael Marineau 2014-09-02 20:39:28 -07:00 committed by Karel Zak
parent 7b83dcc8a8
commit cb52ac9847
1 changed files with 1 additions and 0 deletions

View File

@ -128,6 +128,7 @@ EXTRA_DIST += $(PATHFILES:=.in)
$(PATHFILES): Makefile
@ rm -f $@ $@.tmp
$(AM_V_at) test -d $(dir $@) || mkdir -p $(dir $@)
$(AM_V_GEN) srcdir=''; \
test -f ./$@.in || srcdir=$(srcdir)/; \
$(edit_cmd) $${srcdir}$@.in >$@.tmp