diff options
author | Daniel Dragan <bulk88@hotmail.com> | 2015-08-15 05:24:06 -0400 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2015-09-07 11:23:38 +1000 |
commit | d89ea36076afa0a17a3faa7cb33a1c9c215a26eb (patch) | |
tree | dac12dde1541a47d941e178fa09ea5215178bb17 /win32 | |
parent | 3bdc51af3f9be1ab22a176fefca16c329755b094 (diff) | |
download | perl-d89ea36076afa0a17a3faa7cb33a1c9c215a26eb.tar.gz |
add parallel support 4 Win32 dmake-COREDIR parallelism part 2
-defer the mass copy of headers to COREDIR until XS build time
and dont use COREDIR for building miniperl interp or perl interp, more
thing to do in parallel this way and 1 less path to search by the CC
-config_h.PL requires config.h to be in COREDIR, this XCOPY in CONFIGPM
targ is where COREDIR is created if it doesnt exist already
-remove a bunch of XCOPY'es, copy the headers in 1 place only, and dont
copy them unless they change based on timestamps
-the DYNALOADER dep already contains
"..\make_ext.pl ..\lib\buildcustomize.pl $(CONFIGPM) $(HAVE_COREDIR)" dont
specify them again in Extensions and Extensions_reonly, this probably
reduces the size of dep graph in dmake, since dmake explodes the graph and
checks the outline of the graph/tree very inefficiently in parallel mode
(architectural problem with dmake)
-delete pdb files in root, otherwise switching VC version will make the
next cl.exe error out that it can't write to the pdb file due to version
numbers in the pdb file
-reorder core .c files in a blend of VC and GCC time order, this reduces
a 1:08 mins time to do "dmake -P9 ../perl522.dll" to 0:54 mins on 8 core
with GCC, see details in #123867
Diffstat (limited to 'win32')
-rw-r--r-- | win32/makefile.mk | 71 |
1 files changed, 39 insertions, 32 deletions
diff --git a/win32/makefile.mk b/win32/makefile.mk index a0d55e4b4a..9feb8e2ab5 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -472,7 +472,7 @@ a = .a # Options # -INCLUDES = -I.\include -I. -I.. -I$(COREDIR) +INCLUDES = -I.\include -I. -I.. DEFINES = -DWIN32 .IF "$(WIN64)" == "define" DEFINES += -DWIN64 -DCONSERVATIVE @@ -560,7 +560,7 @@ RSC = rc # Options # -INCLUDES = -I$(COREDIR) -I.\include -I. -I.. +INCLUDES = -I.\include -I. -I.. #PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT LOCDEFS = -DPERLDLL -DPERL_CORE @@ -863,45 +863,47 @@ XCOPY = xcopy /f /r /i /d /y RCOPY = xcopy /f /r /i /e /d /y NOOP = @rem +#first ones are arrange in compile time order for faster parallel building +#see #123867 for details MICROCORE_SRC = \ + ..\toke.c \ + ..\regcomp.c \ + ..\regexec.c \ + ..\op.c \ + ..\sv.c \ + ..\pp.c \ + ..\pp_ctl.c \ + ..\pp_sys.c \ + ..\pp_pack.c \ + ..\pp_hot.c \ + ..\gv.c \ + ..\perl.c \ + ..\utf8.c \ + ..\dump.c \ + ..\hv.c \ ..\av.c \ ..\caretx.c \ ..\deb.c \ ..\doio.c \ ..\doop.c \ ..\dquote.c \ - ..\dump.c \ ..\globals.c \ - ..\gv.c \ ..\mro_core.c \ - ..\hv.c \ ..\locale.c \ ..\keywords.c \ ..\mathoms.c \ ..\mg.c \ ..\numeric.c \ - ..\op.c \ ..\pad.c \ - ..\perl.c \ ..\perlapi.c \ ..\perly.c \ - ..\pp.c \ - ..\pp_ctl.c \ - ..\pp_hot.c \ - ..\pp_pack.c \ ..\pp_sort.c \ - ..\pp_sys.c \ ..\reentr.c \ - ..\regcomp.c \ - ..\regexec.c \ ..\run.c \ ..\scope.c \ - ..\sv.c \ ..\taint.c \ ..\time64.c \ - ..\toke.c \ ..\universal.c \ - ..\utf8.c \ ..\util.c EXTRACORE_SRC += perllib.c @@ -966,6 +968,10 @@ UUDMAP_H = ..\uudmap.h BITCOUNT_H = ..\bitcount.h MG_DATA_H = ..\mg_data.h GENERATED_HEADERS = $(UUDMAP_H) $(BITCOUNT_H) $(MG_DATA_H) +#a stub ppport.h must be generated so building XS modules, .c->.obj wise, will +#work, so this target also represents creating the COREDIR and filling it +HAVE_COREDIR = $(COREDIR)\ppport.h + MICROCORE_OBJ = $(MICROCORE_SRC:db:+$(o)) CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:db:+$(o)) @@ -1103,9 +1109,7 @@ regen_config_h: $(CONFIGPM): ..\config.sh config_h.PL $(MINIPERL) -I..\lib ..\configpm --chdir=.. - $(XCOPY) ..\*.h $(COREDIR)\*.* - $(XCOPY) *.h $(COREDIR)\*.* - $(RCOPY) include $(COREDIR)\*.* + $(XCOPY) config.h $(COREDIR)\*.* $(MINIPERL) -I..\lib config_h.PL "ARCHPREFIX=$(ARCHPREFIX)" \ || $(PLMAKE) $(MAKEMACROS) $(CONFIGPM) $(MAKEFILE) @@ -1381,7 +1385,7 @@ $(PERLSTATICLIB): $(PERLDLL_OBJ) Extensions_static $(LIB32) $(LIB_FLAGS) -out:$@ @Extensions_static \ @$(mktmp $(PERLDLL_OBJ)) .ENDIF - $(XCOPY) $(PERLSTATICLIB) $(COREDIR) + $(XCOPY) $(PERLSTATICLIB) $(COREDIR)\$(NULL) $(PERLEXE_RES): perlexe.rc $(PERLEXE_MANIFEST) $(PERLEXE_ICO) @@ -1392,6 +1396,13 @@ $(UUDMAP_H) $(MG_DATA_H) : $(BITCOUNT_H) $(BITCOUNT_H) : $(GENUUDMAP) $(GENUUDMAP) $(GENERATED_HEADERS) +#This generates a stub ppport.h & creates & fills /lib/CORE to allow for XS +#building .c->.obj wise (linking is a different thing). This taget is AKA +#$(HAVE_COREDIR). +$(COREDIR)\ppport.h : $(CORE_H) + $(XCOPY) *.h $(COREDIR)\*.* && $(RCOPY) include $(COREDIR)\*.* && $(XCOPY) ..\*.h $(COREDIR)\*.* + rem. > $@ + $(GENUUDMAP_OBJ) : ..\mg_raw.h $(GENUUDMAP) : $(GENUUDMAP_OBJ) @@ -1440,18 +1451,15 @@ $(PERLEXESTATIC): $(PERLSTATICLIB) $(CONFIGPM) $(PERLEXEST_OBJ) $(PERLEXE_RES) #------------------------------------------------------------------------------- # There's no direct way to mark a dependency on # DynaLoader.pm, so this will have to do -Extensions : ..\make_ext.pl ..\lib\buildcustomize.pl $(PERLDEP) $(CONFIGPM) $(DYNALOADER) - $(XCOPY) ..\*.h $(COREDIR)\*.* - if not exist $(COREDIR)\ppport.h rem. > $(COREDIR)\ppport.h + +#most of deps of this target are in DYNALOADER and therefore omitted here +Extensions : $(PERLDEP) $(DYNALOADER) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic -Extensions_reonly : ..\make_ext.pl ..\lib\buildcustomize.pl $(PERLDEP) $(CONFIGPM) $(DYNALOADER) - $(XCOPY) ..\*.h $(COREDIR)\*.* +Extensions_reonly : $(PERLDEP) $(DYNALOADER) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +re -Extensions_static : ..\make_ext.pl ..\lib\buildcustomize.pl list_static_libs.pl $(CONFIGPM) - $(XCOPY) ..\*.h $(COREDIR)\*.* - if not exist $(COREDIR)\ppport.h rem. > $(COREDIR)\ppport.h +Extensions_static : ..\make_ext.pl ..\lib\buildcustomize.pl list_static_libs.pl $(CONFIGPM) $(HAVE_COREDIR) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static $(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static @@ -1459,8 +1467,7 @@ Extensions_nonxs : ..\make_ext.pl ..\lib\buildcustomize.pl $(CONFIGPM) ..\pod\pe $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --nonxs !libs #lib must be built, it can't be buildcustomize.pl-ed, and is required for XS building -$(DYNALOADER) : ..\make_ext.pl ..\lib\buildcustomize.pl $(CONFIGPM) - $(XCOPY) ..\*.h $(COREDIR)\*.* +$(DYNALOADER) : ..\make_ext.pl ..\lib\buildcustomize.pl $(CONFIGPM) $(HAVE_COREDIR) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(EXTDIR) --dir=$(DISTDIR) --dynaloader lib Extensions_clean : @@ -1761,7 +1768,7 @@ _clean : -@erase ..\*$(o) ..\*$(a) ..\*.exp *$(o) *$(a) *.exp *.res -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat -@erase *.ilk - -@erase *.pdb + -@erase *.pdb ..\*.pdb -@erase Extensions_static |