Re: [RFC PATCH v4 05/19] Makefile: use "generate-perl.sh" to massage Perl library

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 11, 2024 at 09:18:35AM -0500, Paul Smith wrote:
> On Mon, 2024-11-11 at 15:13 +0100, Patrick Steinhardt wrote:
> > > case "$OUTPUT" in
> > > *.pm)
> > >   dir="$(dirname $OUTPUT)"
> > >   if ! test -d "$dir"
> > >   then
> > >   mkdir -p "$dir"
> > >   fi
> > >      ;;
> > > esac
> 
> This seems kind of complicated to me.  Why not just simply:
> 
>   case "$OUTPUT" in
>     (*.pm) mkdir -p "$(dirname $OUTPUT)" ;;
>   esac
> 
> There's no point in testing for existence of the directory before
> invoking mkdir -p IMO.
> 
> Maybe the git environment has some rules about this?

I won't use either of these. Our Makefile already knows to create the
parent directory anyway:

    perl/build/lib/%.pm: perl/%.pm generate-perl.sh GIT-BUILD-OPTIONS GIT-PERL-DEFINES
        $(call mkdir_p_parent_template)
        $(QUIET_GEN)$(SHELL_PATH) generate-perl.sh ./GIT-BUILD-OPTIONS $(GIT_VERSION) GIT-PERL-HEADER "$<" "$@"

The issue is rather that CMake didn't know to do the same, so I'm
solving this in CMake rather than in the script.

Patrick




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux