This is a bad change.  Make should be managing dependencies.  It's bad
form to force a call to mkdir for every iteration, when it only needs
to be called once (especially on msys/cygwin, where that extra call is
non-trivial.)  The correct way to do it is to set the destination
directory as a dependency, to make a rule for that, and then go ahead
with the normal rules.  Something like this:

$(directoryname):
    $(MKDIR_P) $@

%.def: $(directoryname)

%.def: %.def.in
    ...as before


You could probably even combine those two rules:

%def: %.def.in $(directoryname)
    ...as before

since the rule uses $^ to grab the first prerequisite, which should be
the def.in file.

Also, presumably the directory name here is already handled by
automake (I'm assuming it's just $(libdir)).  Which would simplify
things even further.  But, I can't get to the code right now to see or
prove that.  In any case, this is a much cleaner approach.




On Sat, Nov 14, 2015 at 11:22 PM, JonY <[email protected]> wrote:
> Patch OK?
>
> diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
> index a137750..48bdfd3 100644
> --- a/mingw-w64-crt/Makefile.am
> +++ b/mingw-w64-crt/Makefile.am
> @@ -1416,7 +1416,7 @@ endif
>  # ##########
>
>  %.def: %.def.in
> -       $(CPP) -x c $< -Wp,-w -I$(top_srcdir)/def-include | $(SED) 's/^#/;/' 
> >$@
> +       $(MKDIR_P) $(@D) && $(CPP) -x c $< -Wp,-w -I$(top_srcdir)/def-include 
> | $(SED) 's/^#/;/' > $@
>
>  # Don't compile these, but install as is:
>  #
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Mingw-w64-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>

------------------------------------------------------------------------------
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to