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 $@