]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: create parent directory for $(PATHFILES)
authorMichael Marineau <michael.marineau@coreos.com>
Wed, 3 Sep 2014 03:39:28 +0000 (20:39 -0700)
committerKarel Zak <kzak@redhat.com>
Wed, 3 Sep 2014 07:50:24 +0000 (09:50 +0200)
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

Makefile.am

index 79b5aea782bf412609e4187b50001d471c13665a..08269e2482c4eb7fc054edd6de01496d4212a654 100644 (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