This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix #123976 Win32 GCC miniperl needs -fno-strict-aliasing
[perl5.git] / win32 / makefile.mk
index f143ef8..34dd7e9 100644 (file)
@@ -32,6 +32,7 @@ INST_TOP      *= $(INST_DRV)\perl
 #
 # Uncomment if you want to build a 32-bit Perl using a 32-bit compiler
 # on a 64-bit version of Windows.
+#
 #WIN64         *= undef
 
 #
@@ -43,7 +44,7 @@ INST_TOP      *= $(INST_DRV)\perl
 # versioned installation can be obtained by setting INST_TOP above to a
 # path that includes an arbitrary version string.
 #
-#INST_VER      *= \5.21.1
+#INST_VER      *= \5.21.11
 
 #
 # Comment this out if you DON'T want your perl installation to have
@@ -86,17 +87,10 @@ USE_ITHREADS        *= define
 USE_IMP_SYS    *= define
 
 #
-# Comment out next assign to disable perl's I/O subsystem and use compiler's 
-# stdio for IO - depending on your compiler vendor and run time library you may 
-# then get a number of fails from make test i.e. bugs - complain to them not us ;-). 
-# You will also be unable to take full advantage of perl5.8's support for multiple 
-# encodings and may see lower IO performance. You have been warned.
-USE_PERLIO     *= define
-
-#
 # Comment this out if you don't want to enable large file support for
 # some reason.  Should normally only be changed to maintain compatibility
 # with an older release of perl.
+#
 USE_LARGE_FILES        *= define
 
 #
@@ -104,9 +98,16 @@ USE_LARGE_FILES     *= define
 # (If you're building a 64-bit perl then you will have 64-bit integers whether
 # or not this is uncommented.)
 # Note: This option is not supported in 32-bit MSVC60 builds.
+#
 #USE_64_BIT_INT        *= define
 
 #
+# Uncomment this if you want to support the use of long doubles in GCC builds.
+# This option is not supported for MSVC builds.
+#
+#USE_LONG_DOUBLE *=define
+
+#
 # uncomment exactly one of the following
 #
 # Visual C++ 6.x (aka Visual C++ 98)
@@ -152,10 +153,27 @@ CCTYPE            *= GCC
 #__ICC         *= define
 
 #
-# uncomment next line if you want debug version of perl (big,slow)
+# Uncomment this if you want to build everything in C++ mode
+#
+#USE_CPLUSPLUS *= define
+
+#
+# uncomment next line if you want debug version of perl (big/slow)
 # If not enabled, we automatically try to use maximum optimization
 # with all compilers that are known to have a working optimizer.
 #
+# You can also set CFG = DebugSymbols for a slightly smaller/faster
+# debug build without the special debugging code in perl which is
+# enabled via -DDEBUGGING;
+#
+# or you can set CFG = DebugFull for an even fuller (bigger/slower)
+# debug build using the debug version of the CRT, and enabling VC++
+# debug features such as extra assertions and invalid parameter warnings
+# in perl and CRT code via -D_DEBUG.  (Note that the invalid parameter
+# handler does get triggered from time to time in this configuration,
+# which causes warnings to be printed on STDERR, which in turn causes a
+# few tests to fail.)  (This configuration is only available for VC++ builds.)
+#
 #CFG           *= Debug
 
 #
@@ -289,9 +307,9 @@ USE_SITECUST        *= undef
 USE_MULTI      *= undef
 USE_ITHREADS   *= undef
 USE_IMP_SYS    *= undef
-USE_PERLIO     *= undef
 USE_LARGE_FILES        *= undef
 USE_64_BIT_INT *= undef
+USE_LONG_DOUBLE        *= undef
 
 .IF "$(USE_IMP_SYS)" == "define"
 PERL_MALLOC    = undef
@@ -358,6 +376,12 @@ CCTYPE             = SDK2003SP1
 USE_64_BIT_INT != undef
 .ENDIF
 
+# Disable the long double option for MSVC builds since that compiler
+# does not support it.
+.IF "$(CCTYPE)" != "GCC"
+USE_LONG_DOUBLE        != undef
+.ENDIF
+
 ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
 .IF "$(ARCHITECTURE)" == "AMD64"
 ARCHITECTURE   = x64
@@ -369,15 +393,7 @@ ARCHITECTURE       = ia64
 .IF "$(USE_MULTI)" == "define"
 ARCHNAME       = MSWin32-$(ARCHITECTURE)-multi
 .ELSE
-.IF "$(USE_PERLIO)" == "define"
 ARCHNAME       = MSWin32-$(ARCHITECTURE)-perlio
-.ELSE
-ARCHNAME       = MSWin32-$(ARCHITECTURE)
-.ENDIF
-.ENDIF
-
-.IF "$(USE_PERLIO)" == "define"
-BUILDOPT       += -DUSE_PERLIO
 .ENDIF
 
 .IF "$(USE_ITHREADS)" == "define"
@@ -390,6 +406,10 @@ ARCHNAME   !:= $(ARCHNAME)-64int
 .ENDIF
 .ENDIF
 
+.IF "$(USE_LONG_DOUBLE)" == "define"
+ARCHNAME       !:= $(ARCHNAME)-ld
+.ENDIF
+
 ARCHDIR                = ..\lib\$(ARCHNAME)
 COREDIR                = ..\lib\CORE
 AUTODIR                = ..\lib\auto
@@ -428,6 +448,11 @@ LIB32              = $(ARCHPREFIX)ar rc
 IMPLIB         = $(ARCHPREFIX)dlltool
 RSC            = $(ARCHPREFIX)windres
 
+.IF "$(USE_LONG_DOUBLE)" == "define"
+BUILDOPT        += -D__USE_MINGW_ANSI_STDIO
+MINIBUILDOPT    += -D__USE_MINGW_ANSI_STDIO
+.ENDIF
+
 GCCWRAPV *= $(shell for /f "delims=. tokens=1,2,3" %i in ('$(CC) -dumpversion') do @if "%i"=="4" (if "%j" geq "3" echo define) else if "%i" geq "5" (echo define))
 
 .IF "$(GCCWRAPV)" == "define"
@@ -467,12 +492,18 @@ LIBFILES  = $(LIBC) \
 .IF  "$(CFG)" == "Debug"
 OPTIMIZE       = -g -O2 -DDEBUGGING
 LINK_DBG       = -g
+.ELIF  "$(CFG)" == "DebugSymbols"
+OPTIMIZE       = -g -O2
+LINK_DBG       = -g
 .ELSE
 OPTIMIZE       = -s -O2
 LINK_DBG       = -s
 .ENDIF
 
 EXTRACFLAGS    =
+.IF "$(USE_CPLUSPLUS)" == "define"
+EXTRACFLAGS    += $(CXX_FLAG)
+.ENDIF
 CFLAGS         = $(EXTRACFLAGS) $(INCLUDES) $(DEFINES) $(LOCDEFS) $(OPTIMIZE)
 LINK_FLAGS     = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)"
 OBJOUT_FLAG    = -o
@@ -480,6 +511,7 @@ EXEOUT_FLAG = -o
 LIBOUT_FLAG    =
 
 BUILDOPT       += -fno-strict-aliasing -mms-bitfields
+MINIBUILDOPT   += -fno-strict-aliasing
 
 .ELSE
 
@@ -529,11 +561,18 @@ LOCDEFS           = -DPERLDLL -DPERL_CORE
 SUBSYS         = console
 CXX_FLAG       = -TP -EHsc
 
-LIBC   = msvcrt.lib
+LIBC           = msvcrt.lib
 
 .IF  "$(CFG)" == "Debug"
 OPTIMIZE       = -Od -MD -Zi -DDEBUGGING
 LINK_DBG       = -debug
+.ELIF  "$(CFG)" == "DebugSymbols"
+OPTIMIZE       = -Od -MD -Zi
+LINK_DBG       = -debug
+.ELIF  "$(CFG)" == "DebugFull"
+LIBC           = msvcrtd.lib
+OPTIMIZE       = -Od -MDd -Zi -D_DEBUG -DDEBUGGING
+LINK_DBG       = -debug
 .ELSE
 # -O1 yields smaller code, which turns out to be faster than -O2 on x86 and x64
 OPTIMIZE       = -O1 -MD -Zi -DNDEBUG
@@ -603,6 +642,12 @@ LIBBASEFILES    += bufferoverflowU.lib
 LIBFILES       = $(LIBBASEFILES) $(LIBC)
 
 EXTRACFLAGS    = -nologo -GF -W3
+.IF "$(__ICC)" == "define"
+EXTRACFLAGS    += -Qstd=c99
+.ENDIF
+.IF "$(USE_CPLUSPLUS)" == "define"
+EXTRACFLAGS    += $(CXX_FLAG)
+.ENDIF
 CFLAGS         = $(EXTRACFLAGS) $(INCLUDES) $(DEFINES) $(LOCDEFS) \
                $(PCHFLAGS) $(OPTIMIZE)
 LINK_FLAGS     = -nologo -nodefaultlib $(LINK_DBG) \
@@ -692,7 +737,6 @@ PERLEXESTATIC       = ..\perl-static.exe
 STATICDIR      = .\static.tmp
 GLOBEXE                = ..\perlglob.exe
 CONFIGPM       = ..\lib\Config.pm ..\lib\Config_heavy.pl
-X2P            = ..\x2p\a2p.exe
 GENUUDMAP      = ..\generate_uudmap.exe
 .IF "$(BUILD_STATIC)" == "define" || "$(ALL_STATIC)" == "define"
 PERLSTATIC     = static
@@ -736,6 +780,7 @@ UTILS               =                       \
                ..\utils\perlivp        \
                ..\utils\libnetcfg      \
                ..\utils\enc2xs         \
+               ..\utils\encguess               \
                ..\utils\piconv         \
                ..\utils\corelist       \
                ..\utils\cpan           \
@@ -749,9 +794,6 @@ UTILS               =                       \
                ..\utils\shasum         \
                ..\utils\instmodsh      \
                ..\utils\json_pp        \
-               ..\x2p\find2perl        \
-               ..\x2p\psed             \
-               ..\x2p\s2p              \
                bin\exetype.pl          \
                bin\runperl.pl          \
                bin\pl2bat.pl           \
@@ -765,14 +807,12 @@ CFGH_TMPL = config_H.gc
 PERLIMPLIB     = ..\libperl521$(a)
 PERLSTATICLIB  = ..\libperl521s$(a)
 INT64          = long long
-INT64f         = ll
 
 .ELSE
 
 CFGSH_TMPL     = config.vc
 CFGH_TMPL      = config_H.vc
 INT64          = __int64
-INT64f         = I64
 
 .ENDIF
 
@@ -795,7 +835,7 @@ MICROCORE_SRC       =               \
                ..\dump.c       \
                ..\globals.c    \
                ..\gv.c         \
-               ..\mro.c        \
+               ..\mro_core.c   \
                ..\hv.c         \
                ..\locale.c     \
                ..\keywords.c   \
@@ -835,23 +875,11 @@ EXTRACORE_SRC     += ..\perlio.c
 
 WIN32_SRC      =               \
                .\win32.c       \
+               .\win32io.c     \
                .\win32sck.c    \
                .\win32thread.c \
                .\fcrypt.c
 
-# We need this for miniperl build unless we override canned 
-# config.h #define building mini\*
-#.IF "$(USE_PERLIO)" == "define"
-WIN32_SRC      += .\win32io.c
-#.ENDIF
-
-X2P_SRC                =               \
-               ..\x2p\a2p.c    \
-               ..\x2p\hash.c   \
-               ..\x2p\str.c    \
-               ..\x2p\util.c   \
-               ..\x2p\walk.c
-
 CORE_NOCFG_H   =               \
                ..\av.h         \
                ..\cop.h        \
@@ -907,7 +935,6 @@ MINICORE_OBJ        = $(MINIDIR)\{$(MICROCORE_OBJ:f) miniperlmain$(o) perlio$(o)}
 MINIWIN32_OBJ  = $(MINIDIR)\{$(WIN32_OBJ:f)}
 MINI_OBJ       = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
 DLL_OBJ                = $(DYNALOADER)
-X2P_OBJ                = $(X2P_SRC:db:+$(o))
 GENUUDMAP_OBJ  = $(GENUUDMAP:db:+$(o))
 
 PERLDLL_OBJ    = $(CORE_OBJ)
@@ -945,6 +972,7 @@ CFG_VARS    =                                       \
                cc=$(CC)                        ~       \
                ld=$(LINK32)                    ~       \
                ccflags=$(EXTRACFLAGS) $(OPTIMIZE) $(DEFINES) $(BUILDOPT)       ~       \
+               usecplusplus=$(USE_CPLUSPLUS)   ~       \
                cf_email=$(EMAIL)               ~       \
                d_mymalloc=$(PERL_MALLOC)       ~       \
                libs=$(LIBFILES:f)              ~       \
@@ -961,8 +989,8 @@ CFG_VARS    =                                       \
                usethreads=$(USE_ITHREADS)      ~       \
                useithreads=$(USE_ITHREADS)     ~       \
                usemultiplicity=$(USE_MULTI)    ~       \
-               useperlio=$(USE_PERLIO)         ~       \
                use64bitint=$(USE_64_BIT_INT)   ~       \
+               uselongdouble=$(USE_LONG_DOUBLE)        ~       \
                uselargefiles=$(USE_LARGE_FILES)        ~       \
                usesitecustomize=$(USE_SITECUST)        ~       \
                LINK_FLAGS=$(LINK_FLAGS)        ~       \
@@ -976,7 +1004,7 @@ CFG_VARS   =                                       \
 
 all : CHECKDMAKE .\config.h ..\git_version.h $(GLOBEXE) $(MINIPERL)    \
        $(CONFIGPM) $(UNIDATAFILES) MakePPPort                          \
-       $(PERLEXE) $(X2P) Extensions Extensions_nonxs $(PERLSTATIC)
+       $(PERLEXE) Extensions Extensions_nonxs $(PERLSTATIC)
 
 regnodes : ..\regnodes.h
 
@@ -986,7 +1014,7 @@ regnodes : ..\regnodes.h
 
 reonly : regnodes .\config.h ..\git_version.h $(GLOBEXE) $(MINIPERL)   \
        $(CONFIGPM) $(UNIDATAFILES) $(PERLEXE)                          \
-       $(X2P) Extensions_reonly
+       Extensions_reonly
 
 static: $(PERLEXESTATIC)
 
@@ -1038,6 +1066,7 @@ config.w32 : $(CFGSH_TMPL)
        @echo #undef HAS_ATOLL>>$@
        @echo #undef HAS_STRTOLL>>$@
        @echo #undef HAS_STRTOULL>>$@
+       @echo #undef Size_t_size>>$@
        @echo #undef IVTYPE>>$@
        @echo #undef UVTYPE>>$@
        @echo #undef IVSIZE>>$@
@@ -1050,7 +1079,26 @@ config.w32 : $(CFGSH_TMPL)
        @echo #undef UVxf>>$@
        @echo #undef UVXf>>$@
        @echo #undef USE_64_BIT_INT>>$@
-       @echo #undef Size_t_size>>$@
+       @echo #undef Gconvert>>$@
+       @echo #undef HAS_FREXPL>>$@
+       @echo #undef HAS_ISNANL>>$@
+       @echo #undef HAS_MODFL>>$@
+       @echo #undef HAS_MODFL_PROTO>>$@
+       @echo #undef HAS_SQRTL>>$@
+       @echo #undef HAS_STRTOLD>>$@
+       @echo #undef PERL_PRIfldbl>>$@
+       @echo #undef PERL_PRIgldbl>>$@
+       @echo #undef PERL_PRIeldbl>>$@
+       @echo #undef PERL_SCNfldbl>>$@
+       @echo #undef NVTYPE>>$@
+       @echo #undef NVSIZE>>$@
+       @echo #undef LONG_DOUBLESIZE>>$@
+       @echo #undef NV_OVERFLOWS_INTEGERS_AT>>$@
+       @echo #undef NVef>>$@
+       @echo #undef NVff>>$@
+       @echo #undef NVgf>>$@
+       @echo #undef USE_LONG_DOUBLE>>$@
+       @echo #undef USE_CPLUSPLUS>>$@
 .IF "$(USE_LARGE_FILES)"=="define"
        @echo #define Off_t $(INT64)>>$@
        @echo #define LSEEKSIZE ^8>>$@
@@ -1080,13 +1128,18 @@ config.w32 : $(CFGSH_TMPL)
        @echo #define UVTYPE unsigned $(INT64)>>$@
        @echo #define IVSIZE ^8>>$@
        @echo #define UVSIZE ^8>>$@
+.IF "$(USE_LONG_DOUBLE)"=="define"
+       @echo #define NV_PRESERVES_UV>>$@
+       @echo #define NV_PRESERVES_UV_BITS 64>>$@
+.ELSE
        @echo #undef NV_PRESERVES_UV>>$@
        @echo #define NV_PRESERVES_UV_BITS 53>>$@
-       @echo #define IVdf "$(INT64f)d">>$@
-       @echo #define UVuf "$(INT64f)u">>$@
-       @echo #define UVof "$(INT64f)o">>$@
-       @echo #define UVxf "$(INT64f)x">>$@
-       @echo #define UVXf "$(INT64f)X">>$@
+.ENDIF
+       @echo #define IVdf "I64d">>$@
+       @echo #define UVuf "I64u">>$@
+       @echo #define UVof "I64o">>$@
+       @echo #define UVxf "I64x">>$@
+       @echo #define UVXf "I64X">>$@
        @echo #define USE_64_BIT_INT>>$@
 .ELSE
        @echo #define IVTYPE long>>$@
@@ -1102,6 +1155,57 @@ config.w32 : $(CFGSH_TMPL)
        @echo #define UVXf "lX">>$@
        @echo #undef USE_64_BIT_INT>>$@
 .ENDIF
+.IF "$(USE_LONG_DOUBLE)"=="define"
+       @echo #define Gconvert(x,n,t,b) sprintf((b),"%.*""Lg",(n),(x))>>$@
+       @echo #define HAS_FREXPL>>$@
+       @echo #define HAS_ISNANL>>$@
+       @echo #define HAS_MODFL>>$@
+       @echo #define HAS_MODFL_PROTO>>$@
+       @echo #define HAS_SQRTL>>$@
+       @echo #define HAS_STRTOLD>>$@
+       @echo #define PERL_PRIfldbl "Lf">>$@
+       @echo #define PERL_PRIgldbl "Lg">>$@
+       @echo #define PERL_PRIeldbl "Le">>$@
+       @echo #define PERL_SCNfldbl "Lf">>$@
+       @echo #define NVTYPE long double>>$@
+.IF "$(WIN64)"=="define"
+       @echo #define NVSIZE ^16>>$@
+       @echo #define LONG_DOUBLESIZE ^16>>$@
+.ELSE
+       @echo #define NVSIZE ^12>>$@
+       @echo #define LONG_DOUBLESIZE ^12>>$@
+.ENDIF
+       @echo #define NV_OVERFLOWS_INTEGERS_AT 256.0*256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0*2.0*2.0*2.0>>$@
+       @echo #define NVef "Le">>$@
+       @echo #define NVff "Lf">>$@
+       @echo #define NVgf "Lg">>$@
+       @echo #define USE_LONG_DOUBLE>>$@
+.ELSE
+       @echo #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))>>$@
+       @echo #undef HAS_FREXPL>>$@
+       @echo #undef HAS_ISNANL>>$@
+       @echo #undef HAS_MODFL>>$@
+       @echo #undef HAS_MODFL_PROTO>>$@
+       @echo #undef HAS_SQRTL>>$@
+       @echo #undef HAS_STRTOLD>>$@
+       @echo #undef PERL_PRIfldbl>>$@
+       @echo #undef PERL_PRIgldbl>>$@
+       @echo #undef PERL_PRIeldbl>>$@
+       @echo #undef PERL_SCNfldbl>>$@
+       @echo #define NVTYPE double>>$@
+       @echo #define NVSIZE ^8>>$@
+       @echo #define LONG_DOUBLESIZE ^8>>$@
+       @echo #define NV_OVERFLOWS_INTEGERS_AT 256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0>>$@
+       @echo #define NVef "e">>$@
+       @echo #define NVff "f">>$@
+       @echo #define NVgf "g">>$@
+       @echo #undef USE_LONG_DOUBLE>>$@
+.ENDIF
+.IF "$(USE_CPLUSPLUS)"=="define"
+       @echo #define USE_CPLUSPLUS>>$@
+.ELSE
+       @echo #undef USE_CPLUSPLUS>>$@
+.ENDIF
        @echo #endif>>$@
 
 ..\git_version.h : $(MINIPERL) ..\make_patchnum.pl
@@ -1116,7 +1220,7 @@ config.w32 : $(CFGSH_TMPL)
 
 # This target is for when changes to the main config.sh happen.
 # Edit config.gc, then make perl using GCC in a minimal configuration (i.e.
-# with MULTI, ITHREADS, IMP_SYS, LARGE_FILES and PERLIO off), then make
+# with MULTI, ITHREADS, IMP_SYS and LARGE_FILES off), then make
 # this target to regenerate config_H.gc.
 regen_config_h:
        $(MINIPERL) -I..\lib config_sh.PL --cfgsh-option-file $(mktmp $(CFG_VARS)) \
@@ -1128,7 +1232,6 @@ regen_config_h:
 
 $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL
        $(MINIPERL) -I..\lib ..\configpm --chdir=..
-       if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
        $(XCOPY) ..\*.h $(COREDIR)\*.*
        $(XCOPY) *.h $(COREDIR)\*.*
        $(RCOPY) include $(COREDIR)\*.*
@@ -1181,8 +1284,6 @@ $(CORE_OBJ)       : $(CORE_H)
 
 $(DLL_OBJ)     : $(CORE_H)
 
-$(X2P_OBJ)     : $(CORE_H)
-
 perldll.def : $(MINIPERL) $(CONFIGPM) ..\embed.fnc ..\makedef.pl create_perllibst_h.pl
        $(MINIPERL) -I..\lib create_perllibst_h.pl
        $(MINIPERL) -I..\lib -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) \
@@ -1229,33 +1330,6 @@ $(PERLSTATICLIB): $(PERLDLL_OBJ) Extensions_static
 
 $(PERLEXE_RES): perlexe.rc $(PERLEXE_MANIFEST) $(PERLEXE_ICO)
 
-..\x2p\a2p$(o) : ..\x2p\a2p.c
-       $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\a2p.c
-
-..\x2p\hash$(o) : ..\x2p\hash.c
-       $(CC) -I..\x2p  $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\hash.c
-
-..\x2p\str$(o) : ..\x2p\str.c
-       $(CC) -I..\x2p  $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\str.c
-
-..\x2p\util$(o) : ..\x2p\util.c
-       $(CC) -I..\x2p  $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\util.c
-
-..\x2p\walk$(o) : ..\x2p\walk.c
-       $(CC) -I..\x2p  $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\walk.c
-
-$(X2P) : $(MINIPERL) $(X2P_OBJ) Extensions
-       $(MINIPERL) -I..\lib ..\x2p\find2perl.PL
-       $(MINIPERL) -I..\lib ..\x2p\s2p.PL
-.IF "$(CCTYPE)" == "GCC"
-       $(LINK32) -v -o $@ $(BLINK_FLAGS) \
-           $(mktmp $(LKPRE) $(X2P_OBJ) $(LIBFILES) $(LKPOST))
-.ELSE
-       $(LINK32) -subsystem:console -out:$@ $(BLINK_FLAGS) \
-           @$(mktmp $(LIBFILES) $(X2P_OBJ))
-       $(EMBED_EXE_MANI)
-.ENDIF
-
 $(MINIDIR)\globals$(o) : $(GENERATED_HEADERS)
 
 $(UUDMAP_H) $(MG_DATA_H) : $(BITCOUNT_H)
@@ -1346,7 +1420,7 @@ Extensions_realclean :
 
 
 doc: $(PERLEXE) ..\pod\perltoc.pod
-       $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=$(HTMLDIR) \
+       $(PERLEXE) ..\installhtml --podroot=.. --htmldir=$(HTMLDIR) \
            --podpath=pod:lib:utils --htmlroot="file://$(INST_HTML:s,:,|,)"\
            --recurse
 
@@ -1355,7 +1429,7 @@ doc: $(PERLEXE) ..\pod\perltoc.pod
 
 # Note that this next section is parsed (and regenerated) by pod/buildtoc
 # so please check that script before making structural changes here
-utils: $(PERLEXE) $(X2P) ..\utils\Makefile
+utils: $(PERLEXE) ..\utils\Makefile
        cd ..\utils && $(MAKE) PERL=$(MINIPERL)
        copy ..\README.aix      ..\pod\perlaix.pod
        copy ..\README.amiga    ..\pod\perlamiga.pod
@@ -1390,7 +1464,7 @@ utils: $(PERLEXE) $(X2P) ..\utils\Makefile
        copy ..\README.tw       ..\pod\perltw.pod
        copy ..\README.vos      ..\pod\perlvos.pod
        copy ..\README.win32    ..\pod\perlwin32.pod
-       copy ..\pod\perldelta.pod ..\pod\perl5210delta.pod
+       copy ..\pod\perldelta.pod ..\pod\perl52111delta.pod
        $(PERLEXE) $(PL2BAT) $(UTILS)
        $(MINIPERL) -I..\lib ..\autodoc.pl ..
        $(MINIPERL) -I..\lib ..\pod\perlmodlib.PL -q ..
@@ -1469,6 +1543,7 @@ distclean: realclean
        -if exist $(LIBDIR)\Pod\Text rmdir /s /q $(LIBDIR)\Pod\Text
        -if exist $(LIBDIR)\Scalar rmdir /s /q $(LIBDIR)\Scalar
        -if exist $(LIBDIR)\Search rmdir /s /q $(LIBDIR)\Search
+       -if exist $(LIBDIR)\Sub rmdir /s /q $(LIBDIR)\Sub
        -if exist $(LIBDIR)\Sys rmdir /s /q $(LIBDIR)\Sys
        -if exist $(LIBDIR)\TAP rmdir /s /q $(LIBDIR)\TAP
        -if exist $(LIBDIR)\Term rmdir /s /q $(LIBDIR)\Term
@@ -1484,7 +1559,7 @@ distclean: realclean
        -if exist $(LIBDIR)\Win32API rmdir /s /q $(LIBDIR)\Win32API
        -if exist $(LIBDIR)\XS rmdir /s /q $(LIBDIR)\XS
        -cd $(PODDIR) && del /f *.html *.bat roffitall \
-           perl5210delta.pod perlaix.pod perlamiga.pod perlandroid.pod \
+           perl52111delta.pod perlaix.pod perlamiga.pod perlandroid.pod \
            perlapi.pod perlbs2000.pod perlce.pod perlcn.pod perlcygwin.pod \
            perldos.pod perlfreebsd.pod perlhaiku.pod perlhpux.pod \
            perlhurd.pod perlintern.pod perlirix.pod perljp.pod perlko.pod \
@@ -1495,9 +1570,8 @@ distclean: realclean
            perltru64.pod perltw.pod perluniprops.pod perlvos.pod \
            perlwin32.pod
        -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph pstruct h2xs \
-           perldoc perlivp libnetcfg enc2xs piconv cpan *.bat \
+           perldoc perlivp libnetcfg enc2xs encguess piconv cpan *.bat \
            xsubpp pod2html instmodsh json_pp prove ptar ptardiff ptargrep shasum corelist zipdetails
-       -cd ..\x2p && del /f find2perl s2p psed *.bat
        -del /f ..\config.sh perlmain.c dlutils.c config.h.new \
            perlmainst.c
        -del /f $(CONFIGPM)
@@ -1524,7 +1598,6 @@ installbare : utils ..\pod\perltoc.pod
        if exist $(PERLEXESTATIC) $(XCOPY) $(PERLEXESTATIC) $(INST_BIN)\*.*
        $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
        if exist ..\perl*.pdb $(XCOPY) ..\perl*.pdb $(INST_BIN)\*.*
-       if exist ..\x2p\a2p.pdb $(XCOPY) ..\x2p\a2p.pdb $(INST_BIN)\*.*
        $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.*
 
 installhtml : doc
@@ -1535,65 +1608,68 @@ inst_lib : $(CONFIGPM)
 
 $(UNIDATAFILES) ..\pod\perluniprops.pod .UPDATEALL : $(MINIPERL) $(CONFIGPM) ..\lib\unicore\mktables Extensions_nonxs
        cd ..\lib\unicore && \
-       ..\$(MINIPERL) -I.. -I..\..\dist\Cwd\lib -I..\..\dist\Cwd mktables -P ..\..\pod -maketest -makelist -p
+       ..\$(MINIPERL) -I.. mktables -P ..\..\pod -maketest -makelist -p
 
-minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) $(UNIDATAFILES) utils
+minitest : .\config.h $(MINIPERL) ..\git_version.h $(GLOBEXE) $(CONFIGPM) $(UNIDATAFILES) $(TESTPREPGCC)
        $(XCOPY) $(MINIPERL) ..\t\$(NULL)
        if exist ..\t\perl.exe del /f ..\t\perl.exe
        rename ..\t\miniperl.exe perl.exe
        $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
-       attrib -r ..\t\*.*
-       cd ..\t && \
-       $(MINIPERL) -I..\lib harness base/*.t comp/*.t cmd/*.t io/*.t opbasic/*.t op/*.t pragma/*.t
+# Note this perl.exe is miniperl
+       cd ..\t && perl.exe TEST base/*.t comp/*.t cmd/*.t run/*.t io/*.t re/*.t opbasic/*.t op/*.t uni/*.t perf/*.t pragma/*.t
 
-test-prep : all utils ..\pod\perltoc.pod
+test-prep : all utils ..\pod\perltoc.pod $(TESTPREPGCC)
        $(XCOPY) $(PERLEXE) ..\t\$(NULL)
        $(XCOPY) $(PERLDLL) ..\t\$(NULL)
        $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
-.IF "$(CCTYPE)" == "GCC"
+
 # If building with gcc versions 4.x.x or greater, then
 # the GCC helper DLL will also need copied to the test directory.
 # The name of the dll can change, depending upon which vendor has supplied
 # your compiler, and upon the values of "x".
 # libstdc++-6.dll is copied if it exists as it, too, may then be needed.
 # Without this copying, the op/taint.t test script will fail.
+
+.IF "$(CCTYPE)" == "GCC"
+TESTPREPGCC    = test-prep-gcc
+test-prep-gcc :
        if exist $(CCDLLDIR)\libgcc_s_seh-1.dll $(XCOPY) $(CCDLLDIR)\libgcc_s_seh-1.dll ..\t\$(NULL)
        if exist $(CCDLLDIR)\libgcc_s_sjlj-1.dll $(XCOPY) $(CCDLLDIR)\libgcc_s_sjlj-1.dll ..\t\$(NULL)
        if exist $(CCDLLDIR)\libgcc_s_dw2-1.dll $(XCOPY) $(CCDLLDIR)\libgcc_s_dw2-1.dll ..\t\$(NULL)
        if exist $(CCDLLDIR)\libstdc++-6.dll $(XCOPY) $(CCDLLDIR)\libstdc++-6.dll ..\t\$(NULL)
        if exist $(CCDLLDIR)\libwinpthread-1.dll $(XCOPY) $(CCDLLDIR)\libwinpthread-1.dll ..\t\$(NULL)
+.ELSE
+TESTPREPGCC    =
 .ENDIF
 
 test : test-prep
        set PERL_STATIC_EXT=$(STATIC_EXT) && \
-           cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
+           cd ..\t && perl.exe harness $(TEST_SWITCHES) $(TEST_FILES)
 
 test_porting : test-prep
        set PERL_STATIC_EXT=$(STATIC_EXT) && \
-           cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) porting\*.t ..\lib\diagnostics.t
+           cd ..\t && perl.exe harness $(TEST_SWITCHES) porting\*.t ..\lib\diagnostics.t
 
 test-reonly : reonly utils
        $(XCOPY) $(PERLEXE) ..\t\$(NULL)
        $(XCOPY) $(PERLDLL) ..\t\$(NULL)
        $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
-       cd ..\t && \
-       $(PERLEXE) -I..\lib harness $(OPT) -re \bpat\\/ $(EXTRA) && \
-       cd ..\win32
+       cd ..\t && perl.exe harness $(OPT) -re \bpat\\/ $(EXTRA)
 
 regen :
-       cd .. && regen.pl && cd win32
+       cd .. && regen.pl
 
 test-notty : test-prep
        set PERL_STATIC_EXT=$(STATIC_EXT) && \
            set PERL_SKIP_TTY_TEST=1 && \
-           cd ..\t && $(PERLEXE) -I.\lib harness $(TEST_SWITCHES) $(TEST_FILES)
+           cd ..\t && perl.exe harness $(TEST_SWITCHES) $(TEST_FILES)
 
 _test :
        $(XCOPY) $(PERLEXE) ..\t\$(NULL)
        $(XCOPY) $(PERLDLL) ..\t\$(NULL)
        $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
        set PERL_STATIC_EXT=$(STATIC_EXT) && \
-           cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
+           cd ..\t && perl.exe harness $(TEST_SWITCHES) $(TEST_FILES)
 
 _clean :
        -@erase miniperlmain$(o)
@@ -1618,10 +1694,8 @@ _clean :
        -@erase $(UNIDATAFILES)
        -@erase $(WIN32_OBJ)
        -@erase $(DLL_OBJ)
-       -@erase $(X2P_OBJ)
        -@erase ..\*$(o) ..\*$(a) ..\*.exp *$(o) *$(a) *.exp *.res
        -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
-       -@erase ..\x2p\*.exe ..\x2p\*.bat
        -@erase *.ilk
        -@erase *.pdb
        -@erase Extensions_static
@@ -1637,13 +1711,13 @@ realclean : Extensions_realclean _clean
 # Please *don't* use this unless all tests pass.
 # If you want to report test failures, use "dmake nok" instead.
 ok: utils
-       $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)"
+       $(PERLEXE) ..\utils\perlbug -ok -s "(UNINSTALLED)"
 
 okfile: utils
-       $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)" -F perl.ok
+       $(PERLEXE) ..\utils\perlbug -ok -s "(UNINSTALLED)" -F perl.ok
 
 nok: utils
-       $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)"
+       $(PERLEXE) ..\utils\perlbug -nok -s "(UNINSTALLED)"
 
 nokfile: utils
-       $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)" -F perl.nok
+       $(PERLEXE) ..\utils\perlbug -nok -s "(UNINSTALLED)" -F perl.nok