From 333bcd2ee38519f5bf031574b91034fcd484fb8f Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 9 Sep 2018 14:58:25 +0200 Subject: [PATCH] build: fix support for --disable-dependency-tracking Reported by Juan Manuel Guerrero. https://lists.gnu.org/archive/html/bug-bison/2014-07/msg00000.html. * examples/local.mk (%D%/extracted.stamp): Make sure the output directory exists. * examples/extexi (process): Likewise. --- examples/extexi | 9 +++++++-- examples/local.mk | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/extexi b/examples/extexi index a2b31946..4a9df2af 100755 --- a/examples/extexi +++ b/examples/extexi @@ -47,6 +47,9 @@ use strict; +use File::Basename qw(dirname); +use File::Path qw(make_path); + # Whether we generate synclines. my $synclines = 0; @@ -92,7 +95,9 @@ sub file_wanted ($) undef } - +# process ($in) +# ------------- +# Read input file $in, and generate the outputs. sub process ($) { my ($in) = @_; @@ -152,7 +157,7 @@ sub process ($) # Output the files. for my $file (keys %file) { - # No spurious end of line: use printf. + make_path (dirname ($file)); my $o = new IO::File(">$file") or die "$file: cannot create: $?"; print $o $file{$file}{$_} diff --git a/examples/local.mk b/examples/local.mk index 2518da34..6df8ace7 100644 --- a/examples/local.mk +++ b/examples/local.mk @@ -33,6 +33,7 @@ extracted = CLEANFILES += $(extracted) %D%/extracted.stamp %D%/extracted.stamp: $(doc) $(extexi) $(AM_V_GEN)rm -f $@ $@.tmp + $(AM_V_at)$(MKDIR_P) %D% $(AM_V_at)touch $@.tmp $(AM_V_at)$(extract) $(extracted) $(AM_V_at)mv $@.tmp $@