develooper Front page | perl.perl5.porters | Postings from January 2009

Re: merging make_ext and make_ext_cross

Thread Previous | Thread Next
From:
demerphq
Date:
January 11, 2009 09:21
Subject:
Re: merging make_ext and make_ext_cross
Message ID:
9b18b3110901110921p31ee13desf440f8873f2d807f@mail.gmail.com
2009/1/10 Nicholas Clark <nick@ccl4.org>:
> There seems to be one possible "problem" with converting it from shell,
> the part of the change
>
> http://perl5.git.perl.org/perl.git/commit/75f926282bd78abe2f394977be7dd4dc52cb21ba
>
> that deals with
>
> ext/util/make_ext
>        Explicitly use #!/bin/sh to start it up.  This is useful
>    for testing make_ext.
>        Improve & simplify Nested::Extension::Processing.
>        More robust handling of `make clean'.
>
>
> http://perl5.git.perl.org/perl.git/blobdiff/420218e7eb4fa5ceefe298e6d9121548b8d806d6..75f926282bd78abe2f394977be7dd4dc52cb21ba:/ext/util/make_ext
>
> which added this:
>
> *clean) # If Makefile has been moved to Makefile.old by a make clean
>            # then use Makefile.old for realclean rather than rebuild it
>            if test ! -f $makefile -a -f Makefile.old; then
>                makefile=Makefile.old
>                makeopts="-f $makefile"
>                echo "Note: Using Makefile.old"
>            fi
>            ;;
>
>
>
> If I understand the workings correctly, the purpose of this is that if you run
> 'make clean', then in order, Makefile causes
>
> ...
>
> 3:    make_ext to visit every build extension in ext/ running make clean
> 3.1:  which deletes all the build time files
> 3.14: and renames Makefile to Makefile.old
>
> ...
>
> 42:   delete all the object files and miniperl
>
>
>
> Then if you want to run 'make distclean', the Makefile wants to cause
>
> 3:    make_ext to visit every build extension in ext/ running make clean
>
> which would be tricky, as there isn't a Makefile there any more, and you need
> miniperl to build one, which has also already been deleted.
>
> So the trick is to save the Makefile as Makefile.old and use that for
> distclean.
>
>
>
> This, of course, all works fine if make_ext is a shell script, as it doesn't
> rely on anything we built to run make distclean. But if we simply change
> make_ext to rely on miniperl, we have a problem if we run make clean;
> make distclean, as it has already gone.
>
>
> Not certain what to do, but it strikes me that as make_ext runs it could
> write out the shell* instructions to run distclean into a shell "script" at
> top level, and we could change realclean (and distclean) to use that, rather
> than recurse into ext/ via make_ext.

It looks like cleaning extensions  in distclean is implemented using
win32/buildext.pl and win32/FindExt.pm on win32.

Also worth noting is that git clean -fXd does pretty much the same
thing, but much faster.

cheers,
Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About