On Sat, Dec 27, 2008 at 06:41:57PM +0100, demerphq wrote:
> 2008/12/27 Nicholas Clark <nick@ccl4.org>:
> > I'm still not convinced that I like this (new) section of the Makefile as-is
> > yet:
> >
> > .PHONY: all translators utilities make_patchnum
> >
> > make_patchnum:
> > sh $(shellflags) make_patchnum.sh
> >
> > .patchnum: make_patchnum
> >
> > perl$(OBJ_EXT): .patchnum
> >
> >
> >
> > because it seems to have the side effect that make always considers that
> > .patchnum is out of date, so always regenerates it, so perl.o is always
> > recompiled, so miniperl is always relinked, so lib/unicore/mktables is
> > always re-run, and all the extensions Makefiles checked. Which is quite a bit
> > of work each time.
>
> It will always run the program that checks if it should be
> regenerated, but it does not regenerate it each time. Read the code
> for make_patchnum.sh and youll see what happens. This is exactly what
> we want.
>
> And it does not cause perl.c to be recompiled every time.
Agree on Linux. Agree on OS X. (Which are both GNU make)
> At least for me. Please let me know if you have actually witnessed it> rebuilding perl.obj twice if you do: make; makeTurns out that I was assuming that it was everywhere. On FreeBSD I'm getting
this:
$ make perl
sh make_patchnum.sh
Reusing .patchnum and .sha1
`sh cflags "optimize='-g'" perl.o` perl.c
CCCMD = ccache gcc -DPERL_CORE -c -DPERL_GIT_SHA1=e21c97b9063f1fc4ea77e8bcfbdaddeaa8edc398 -DPERL_PATCHNUM=GitLive-blead-115-ge21c97b-with-uncommitted-changes -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DNO_MATHOMS -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -g -Wall -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat
ccache gcc -pthread -Wl,-E -fstack-protector -L/usr/local/lib -o miniperl `echo gv.o toke.o perly.o op.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro.o hv.o av.o perl.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o xsutils.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o | sed 's/ op.o / /'` miniperlmain.o opmini.o -lm -lcrypt
./miniperl -w -Ilib -MExporter -e '<?>' || make minitest
./miniperl -Ilib configpm
written lib/Config.pod
./miniperl -Ilib lib/lib_pm.PL
Extracting lib.pm (with variable substitutions)
AutoSplitting perl library
./miniperl -Ilib -MAutoSplit -MFile::Find -e 'find ({no_chdir=>1, wanted => sub {autosplit_lib_modules($_) if /\.pm$/}}, "lib")'
make lib/re.pm
`lib/re.pm' is up to date.
Making DynaLoader (static)
rm -f libperl.a
/usr/bin/ar rcu libperl.a gv.o toke.o perly.o op.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro.o hv.o av.o perl.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o xsutils.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o DynaLoader.o
ccache gcc -o perl -pthread -Wl,-E -fstack-protector -L/usr/local/lib perlmain.o libperl.a `cat ext.libs` -lm -lcrypt
$ make perl
sh make_patchnum.sh
Reusing .patchnum and .sha1
`sh cflags "optimize='-g'" perl.o` perl.c
CCCMD = ccache gcc -DPERL_CORE -c -DPERL_GIT_SHA1=e21c97b9063f1fc4ea77e8bcfbdaddeaa8edc398 -DPERL_PATCHNUM=GitLive-blead-115-ge21c97b-with-uncommitted-changes -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DNO_MATHOMS -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -g -Wall -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat
ccache gcc -pthread -Wl,-E -fstack-protector -L/usr/local/lib -o miniperl `echo gv.o toke.o perly.o op.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro.o hv.o av.o perl.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o xsutils.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o | sed 's/ op.o / /'` miniperlmain.o opmini.o -lm -lcrypt
./miniperl -w -Ilib -MExporter -e '<?>' || make minitest
./miniperl -Ilib configpm
written lib/Config.pod
./miniperl -Ilib lib/lib_pm.PL
Extracting lib.pm (with variable substitutions)
AutoSplitting perl library
./miniperl -Ilib -MAutoSplit -MFile::Find -e 'find ({no_chdir=>1, wanted => sub {autosplit_lib_modules($_) if /\.pm$/}}, "lib")'
make lib/re.pm
`lib/re.pm' is up to date.
Making DynaLoader (static)
rm -f libperl.a
/usr/bin/ar rcu libperl.a gv.o toke.o perly.o op.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro.o hv.o av.o perl.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o xsutils.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o DynaLoader.o
ccache gcc -o perl -pthread -Wl,-E -fstack-protector -L/usr/local/lib perlmain.o libperl.a `cat ext.libs` -lm -lcrypt
(Seems I can repeat this as many times as I like)
Nicholas Clark