This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
New perldelta
[perl5.git] / win32 / Makefile
index e5c3c86..e27650b 100644 (file)
@@ -5,7 +5,7 @@
 #      Windows SDK 64-bit compiler and tools
 #
 # This is set up to build a perl.exe that runs off a shared library
-# (perl521.dll).  Also makes individual DLLs for the XS extensions.
+# (perl525.dll).  Also makes individual DLLs for the XS extensions.
 #
 
 ##
@@ -38,7 +38,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.6
+#INST_VER      = \5.25.8
 
 #
 # Comment this out if you DON'T want your perl installation to have
@@ -81,15 +81,6 @@ 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.
@@ -105,35 +96,42 @@ USE_LARGE_FILES    = define
 #USE_64_BIT_INT        = define
 
 #
+# Uncomment this if you want to disable looking up values from
+# HKEY_CURRENT_USER\Software\Perl and HKEY_LOCAL_MACHINE\Software\Perl in
+# the Registry.
+#
+#USE_NO_REGISTRY = define
+
+#
 # uncomment exactly one of the following
 #
-# Visual C++ 6.x (aka Visual C++ 98)
+# Visual C++ 6.0 (aka Visual C++ 98)
 CCTYPE         = MSVC60
-# Visual C++ .NET 2002/2003 (aka Visual C++ 7.x) (full version)
+# Visual C++ .NET 2002/2003 (aka Visual C++ 7.0/7.1) (full version)
 #CCTYPE                = MSVC70
-# Visual C++ Toolkit 2003 (aka Visual C++ 7.x) (free command-line tools)
+# Visual C++ Toolkit 2003 (aka Visual C++ 7.1) (free command-line tools)
 #CCTYPE                = MSVC70FREE
 # Windows Server 2003 SP1 Platform SDK (April 2005)
 #CCTYPE                = SDK2003SP1
-# Visual C++ 2005 (aka Visual C++ 8.x) (full version)
+# Visual C++ 2005 (aka Visual C++ 8.0) (full version)
 #CCTYPE                = MSVC80
-# Visual C++ 2005 Express Edition (aka Visual C++ 8.x) (free version)
+# Visual C++ 2005 Express Edition (aka Visual C++ 8.0) (free version)
 #CCTYPE                = MSVC80FREE
-# Visual C++ 2008 (aka Visual C++ 9.x) (full version)
+# Visual C++ 2008 (aka Visual C++ 9.0) (full version)
 #CCTYPE                = MSVC90
-# Visual C++ 2008 Express Edition (aka Visual C++ 9.x) (free version)
+# Visual C++ 2008 Express Edition (aka Visual C++ 9.0) (free version)
 #CCTYPE                = MSVC90FREE
-# Visual C++ 2010 (aka Visual C++ 10.x) (full version)
+# Visual C++ 2010 (aka Visual C++ 10.0) (full version)
 #CCTYPE                = MSVC100
-# Visual C++ 2010 Express Edition (aka Visual C++ 10.x) (free version)
+# Visual C++ 2010 Express Edition (aka Visual C++ 10.0) (free version)
 #CCTYPE                = MSVC100FREE
-# Visual C++ 2012 (aka Visual C++ 11.x) (full version)
+# Visual C++ 2012 (aka Visual C++ 11.0) (full version)
 #CCTYPE                = MSVC110
-# Visual C++ 2012 Express Edition (aka Visual C++ 11.x) (free version)
+# Visual C++ 2012 Express Edition (aka Visual C++ 11.0) (free version)
 #CCTYPE                = MSVC110FREE
-# Visual C++ 2013 (aka Visual C++ 12.x) (full version)
+# Visual C++ 2013 (aka Visual C++ 12.0) (full version)
 #CCTYPE                = MSVC120
-# Visual C++ 2013 Express Edition (aka Visual C++ 12.x) (free version)
+# Visual C++ 2013 Express Edition (aka Visual C++ 12.0) (free version)
 #CCTYPE                = MSVC120FREE
 
 #
@@ -142,10 +140,27 @@ CCTYPE            = MSVC60
 #__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.)
+#
 #CFG           = Debug
 
 #
@@ -177,7 +192,7 @@ CCTYPE              = MSVC60
 # set this to additionally provide a statically linked perl-static.exe.
 # Note that dynamic loading will not work with this perl, so you must
 # include required modules statically using the STATIC_EXT or ALL_STATIC
-# variables below. A static library perl521s.lib will also be created.
+# variables below. A static library perl525s.lib will also be created.
 # Ordinary perl.exe is not affected by this option.
 #
 #BUILD_STATIC  = define
@@ -278,10 +293,6 @@ USE_ITHREADS       = undef
 USE_IMP_SYS    = undef
 !ENDIF
 
-!IF "$(USE_PERLIO)" == ""
-USE_PERLIO     = undef
-!ENDIF
-
 !IF "$(USE_LARGE_FILES)" == ""
 USE_LARGE_FILES        = undef
 !ENDIF
@@ -290,6 +301,10 @@ USE_LARGE_FILES    = undef
 USE_64_BIT_INT = undef
 !ENDIF
 
+!IF "$(USE_NO_REGISTRY)" == ""
+USE_NO_REGISTRY        = undef
+!ENDIF
+
 !IF "$(USE_IMP_SYS)$(USE_MULTI)" == "defineundef"
 USE_MULTI      = define
 !ENDIF
@@ -310,6 +325,10 @@ BUILDOPT   = $(BUILDOPT) -DPERL_IMPLICIT_CONTEXT
 BUILDOPT       = $(BUILDOPT) -DPERL_IMPLICIT_SYS
 !ENDIF
 
+!IF "$(USE_NO_REGISTRY)" != "undef"
+BUILDOPT       = $(BUILDOPT) -DWIN32_NO_REGISTRY
+!ENDIF
+
 !IF "$(PROCESSOR_ARCHITECTURE)" == ""
 PROCESSOR_ARCHITECTURE = x86
 !ENDIF
@@ -368,15 +387,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       = $(BUILDOPT) -DUSE_PERLIO
 !ENDIF
 
 !IF "$(USE_ITHREADS)" == "define"
@@ -389,13 +400,22 @@ ARCHNAME  = $(ARCHNAME)-64int
 !ENDIF
 !ENDIF
 
-# All but the free version of VC++ 7.x can load DLLs on demand.  Makes the test
+# All but the free version of VC++ 7.1 can load DLLs on demand.  Makes the test
 # suite run in about 10% less time.
 !IF "$(CCTYPE)" != "MSVC70FREE"
+# If no registry, advapi32 is only used for Perl_pp_getlogin/getlogin/GetUserNameA
+# which is rare to execute
+!IF "$(USE_NO_REGISTRY)" != "undef"
+DELAYLOAD      = -DELAYLOAD:ws2_32.dll -DELAYLOAD:advapi32.dll delayimp.lib
+MINIDELAYLOAD  =
+!ELSE
 DELAYLOAD      = -DELAYLOAD:ws2_32.dll delayimp.lib
+#miniperl never does any registry lookups
+MINIDELAYLOAD  = -DELAYLOAD:advapi32.dll
+!ENDIF
 !ENDIF
 
-# Visual C++ 2005 and 2008 (VC++ 8.x and 9.x) create manifest files for EXEs and
+# Visual C++ 2005 and 2008 (VC++ 8.0 and 9.0) create manifest files for EXEs and
 # DLLs. These either need copying everywhere with the binaries, or else need
 # embedding in them otherwise MSVCR80.dll or MSVCR90.dll won't be found. For
 # simplicity, embed them if they exist (and delete them afterwards so that they
@@ -445,15 +465,23 @@ INCLUDES  = -I$(COREDIR) -I.\include -I. -I..
 #PCHFLAGS      = -Fpc:\temp\vcmoduls.pch -YX
 DEFINES                = -DWIN32 -D_CONSOLE -DNO_STRICT
 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
 !ELSE
+!IF  "$(CFG)" == "DebugSymbols"
+OPTIMIZE       = -Od -MD -Zi
+LINK_DBG       = -debug
+!ELSE
+!IF  "$(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
 # we enable debug symbols in release builds also
@@ -471,13 +499,15 @@ LINK_DBG  = $(LINK_DBG) -ltcg
 LIB_FLAGS      = -ltcg
 !  ENDIF
 !ENDIF
+!ENDIF
+!ENDIF
 
 !IF "$(WIN64)" == "define"
 DEFINES                = $(DEFINES) -DWIN64 -DCONSERVATIVE
 OPTIMIZE       = $(OPTIMIZE) -fp:precise
 !ENDIF
 
-# For now, silence warnings from VC++ 8.x onwards about "unsafe" CRT functions
+# For now, silence warnings from VC++ 8.0 onwards about "unsafe" CRT functions
 # and POSIX CRT function names being deprecated.
 !IF "$(PREMSVC80)" == "undef"
 DEFINES                = $(DEFINES) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
@@ -523,6 +553,12 @@ LIBFILES   = $(LIBBASEFILES) $(LIBC)
 
 #EXTRACFLAGS   = -nologo -GF -W4 -wd4127 -wd4706
 EXTRACFLAGS    = -nologo -GF -W3
+!IF "$(__ICC)" == "define"
+EXTRACFLAGS    = $(EXTRACFLAGS) -Qstd=c99
+!ENDIF
+!IF "$(USE_CPLUSPLUS)" == "define"
+EXTRACFLAGS    = $(EXTRACFLAGS) $(CXX_FLAG)
+!ENDIF
 CFLAGS         = $(EXTRACFLAGS) $(INCLUDES) $(DEFINES) $(LOCDEFS) \
                $(PCHFLAGS) $(OPTIMIZE)
 LINK_FLAGS     = -nologo -nodefaultlib $(LINK_DBG) \
@@ -535,11 +571,28 @@ EXEOUT_FLAG       = -Fe
 CFLAGS_O       = $(CFLAGS) $(BUILDOPT)
 
 !IF "$(PREMSVC80)" == "undef"
-LINK_FLAGS     = $(LINK_FLAGS) "/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"
+PRIV_LINK_FLAGS        = $(PRIV_LINK_FLAGS) "/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"
 !ELSE
 RSC_FLAGS      = -DINCLUDE_MANIFEST
 !ENDIF
 
+# For XP support in >= VS 2013 (VC++ 12.0), subsystem is always in Config.pm
+# LINK_FLAGS else subsystem is only needed for EXE building, not XS DLL building
+# Console vs GUI makes no difference for DLLs, so use default for cleaner
+# building cmd lines
+!IF "$(CCTYPE)" == "MSVC120" || "$(CCTYPE)" == "MSVC120FREE" \
+    || "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC140FREE"
+!  IF "$(WIN64)" == "define"
+LINK_FLAGS     = $(LINK_FLAGS) -subsystem:console,"5.02"
+!  ELSE
+LINK_FLAGS     = $(LINK_FLAGS) -subsystem:console,"5.01"
+!  ENDIF
+
+!ELSE
+PRIV_LINK_FLAGS        = $(PRIV_LINK_FLAGS) -subsystem:console
+!ENDIF
+
+BLINK_FLAGS    = $(PRIV_LINK_FLAGS) $(LINK_FLAGS)
 
 #################### do not edit below this line #######################
 ############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
@@ -565,8 +618,8 @@ o = .obj
        $(NOOP)
 
 $(o).dll:
-       $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
-           -out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
+       $(LINK32) -dll -implib:$(*B).lib -def:$(*B).def \
+           -out:$@ $(BLINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
        $(EMBED_DLL_MANI)
 
 .rc.res:
@@ -577,9 +630,9 @@ $(o).dll:
 
 # makedef.pl must be updated if this changes, and this should normally
 # only change when there is an incompatible revision of the public API.
-PERLIMPLIB     = ..\perl521.lib
-PERLSTATICLIB  = ..\perl521s.lib
-PERLDLL                = ..\perl521.dll
+PERLIMPLIB     = ..\perl525.lib
+PERLSTATICLIB  = ..\perl525s.lib
+PERLDLL                = ..\perl525.dll
 
 MINIPERL       = ..\miniperl.exe
 MINIDIR                = .\mini
@@ -633,6 +686,7 @@ UTILS               =                       \
                ..\utils\perlivp        \
                ..\utils\libnetcfg      \
                ..\utils\enc2xs         \
+               ..\utils\encguess               \
                ..\utils\piconv         \
                ..\utils\corelist       \
                ..\utils\cpan           \
@@ -671,10 +725,11 @@ MICROCORE_SRC     =               \
                ..\deb.c        \
                ..\doio.c       \
                ..\doop.c       \
+               ..\dquote.c     \
                ..\dump.c       \
                ..\globals.c    \
                ..\gv.c         \
-               ..\mro.c        \
+               ..\mro_core.c   \
                ..\hv.c         \
                ..\locale.c     \
                ..\keywords.c   \
@@ -699,6 +754,7 @@ MICROCORE_SRC       =               \
                ..\scope.c      \
                ..\sv.c         \
                ..\taint.c      \
+               ..\time64.c     \
                ..\toke.c       \
                ..\universal.c  \
                ..\utf8.c       \
@@ -714,17 +770,11 @@ EXTRACORE_SRC     = $(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      = $(WIN32_SRC) .\win32io.c
-#!ENDIF
-
-
 CORE_NOCFG_H   =               \
                ..\av.h         \
                ..\cop.h        \
@@ -815,6 +865,7 @@ CFG_VARS    =                                       \
                "cc=$(CC)"                              \
                "ld=$(LINK32)"                          \
                "ccflags=$(EXTRACFLAGS) $(OPTIMIZE:"=\") $(DEFINES) $(BUILDOPT)"        \
+               "usecplusplus=$(USE_CPLUSPLUS)"         \
                "cf_email=$(EMAIL)"                     \
                "d_mymalloc=$(PERL_MALLOC)"             \
                "libs=$(LIBFILES)"                      \
@@ -827,8 +878,8 @@ CFG_VARS    =                                       \
                "usethreads=$(USE_ITHREADS)"            \
                "useithreads=$(USE_ITHREADS)"           \
                "usemultiplicity=$(USE_MULTI)"          \
-               "useperlio=$(USE_PERLIO)"               \
                "use64bitint=$(USE_64_BIT_INT)"         \
+               "uselongdouble=undef"                   \
                "uselargefiles=$(USE_LARGE_FILES)"      \
                "usesitecustomize=$(USE_SITECUST)"      \
                "LINK_FLAGS=$(LINK_FLAGS:"=\")"         \
@@ -858,15 +909,12 @@ static: $(PERLEXESTATIC)
 #------------------------------------------------------------
 
 $(GLOBEXE) : perlglob$(o)
-       $(LINK32) $(LINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
+       $(LINK32) $(BLINK_FLAGS) $(LIBFILES) -out:$@ \
            perlglob$(o) setargv$(o)
        $(EMBED_EXE_MANI)
 
 perlglob$(o)  : perlglob.c
 
-config.w32 : $(CFGSH_TMPL)
-       copy $(CFGSH_TMPL) config.w32
-
 #
 # Copy the template config.h and set configurables at the end of it
 # as per the options chosen and compiler used.
@@ -903,6 +951,7 @@ config.w32 : $(CFGSH_TMPL)
        @echo #undef UVXf>>$@
        @echo #undef USE_64_BIT_INT>>$@
        @echo #undef Size_t_size>>$@
+       @echo #undef USE_CPLUSPLUS>>$@
 !IF "$(USE_LARGE_FILES)"=="define"
        @echo #define Off_t __int64>>$@
        @echo #define LSEEKSIZE ^8>>$@
@@ -954,6 +1003,11 @@ config.w32 : $(CFGSH_TMPL)
        @echo #define UVXf "lX">>$@
        @echo #undef USE_64_BIT_INT>>$@
 !ENDIF
+!IF "$(USE_CPLUSPLUS)"=="define"
+       @echo #define USE_CPLUSPLUS>>$@
+!ELSE
+       @echo #undef USE_CPLUSPLUS>>$@
+!ENDIF
        @echo #endif>>$@
 
 ..\git_version.h : $(MINIPERL) ..\make_patchnum.pl
@@ -962,12 +1016,12 @@ config.w32 : $(CFGSH_TMPL)
 # make sure that we recompile perl.c if the git version changes
 ..\perl$(o) : ..\git_version.h
 
-..\config.sh : config.w32 $(MINIPERL) config_sh.PL FindExt.pm
-       $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) config.w32 > ..\config.sh
+..\config.sh : $(CFGSH_TMPL) config_sh.PL FindExt.pm $(MINIPERL)
+       $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) $(CFGSH_TMPL) > ..\config.sh
 
 # This target is for when changes to the main config.sh happen.
 # Edit config.vc, then make perl in a minimal configuration (i.e. with MULTI,
-# ITHREADS, IMP_SYS, LARGE_FILES and PERLIO off), then make this target
+# ITHREADS, IMP_SYS and LARGE_FILES off), then make this target
 # to regenerate config_H.vc.
 regen_config_h:
        $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) $(CFGSH_TMPL) > ..\config.sh
@@ -978,7 +1032,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)\*.*
@@ -989,8 +1042,8 @@ $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL
 $(MINIPERL) : ..\lib\buildcustomize.pl 
 
 ..\lib\buildcustomize.pl : $(MINIDIR) $(MINI_OBJ) ..\write_buildcustomize.pl
-       $(LINK32) -subsystem:console -out:$(MINIPERL) @<<
-       $(LINK_FLAGS) $(DELAYLOAD) $(LIBFILES) $(MINI_OBJ)
+       $(LINK32) -out:$(MINIPERL) @<<
+       $(BLINK_FLAGS) $(DELAYLOAD) $(MINIDELAYLOAD) $(LIBFILES) $(MINI_OBJ)
 <<
        $(EMBED_EXE_MANI:..\lib\buildcustomize.pl=..\miniperl.exe)
        $(MINIPERL) -I..\lib -f ..\write_buildcustomize.pl ..
@@ -1027,7 +1080,7 @@ perldll.def : $(MINIPERL) $(CONFIGPM) ..\embed.fnc ..\makedef.pl create_perllibs
 
 $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES) Extensions_static
        $(LINK32) -dll -def:perldll.def -base:0x28000000 -out:$@ @Extensions_static @<<
-               $(LINK_FLAGS) $(DELAYLOAD) $(LIBFILES) $(PERLDLL_OBJ) $(PERLDLL_RES)
+               $(BLINK_FLAGS) $(DELAYLOAD) $(LIBFILES) $(PERLDLL_OBJ) $(PERLDLL_RES)
 <<
        $(EMBED_DLL_MANI)
        $(XCOPY) $(PERLIMPLIB) $(COREDIR)
@@ -1050,8 +1103,8 @@ $(BITCOUNT_H) : $(GENUUDMAP)
 $(GENUUDMAP_OBJ) : ..\mg_raw.h
 
 $(GENUUDMAP) : $(GENUUDMAP_OBJ)
-       $(LINK32) -subsystem:console -out:$@ @<<
-               $(LINK_FLAGS) $(LIBFILES) $(GENUUDMAP_OBJ)
+       $(LINK32) -out:$@ @<<
+               $(BLINK_FLAGS) $(LIBFILES) $(GENUUDMAP_OBJ)
 <<
        $(EMBED_EXE_MANI)
 
@@ -1068,14 +1121,14 @@ perlmainst$(o) : perlmainst.c
        $(CC) $(CFLAGS_O) $(OBJOUT_FLAG)$@ -c perlmainst.c
 
 $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES)
-       $(LINK32) -subsystem:console -out:$@ $(LINK_FLAGS) \
+       $(LINK32) -out:$@ $(BLINK_FLAGS) \
            $(PERLEXE_OBJ) $(PERLEXE_RES) $(PERLIMPLIB) $(LIBFILES) $(SETARGV_OBJ)
        $(EMBED_EXE_MANI)
        copy $(PERLEXE) $(WPERLEXE)
        $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS
 
 $(PERLEXESTATIC): $(PERLSTATICLIB) $(CONFIGPM) $(PERLEXEST_OBJ) $(PERLEXE_RES)
-       $(LINK32) -subsystem:console -out:$@ $(LINK_FLAGS) \
+       $(LINK32) -out:$@ $(BLINK_FLAGS) \
            $(PERLEXEST_OBJ) $(PERLEXE_RES) $(PERLSTATICLIB) $(LIBFILES) $(SETARGV_OBJ)
        $(EMBED_EXE_MANI)
 
@@ -1115,7 +1168,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::=|)" \
            --recurse
 
@@ -1162,7 +1215,7 @@ utils: $(PERLEXE) ..\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\perl5216delta.pod
+       copy ..\pod\perldelta.pod ..\pod\perl5259delta.pod
        cd ..\win32
        $(PERLEXE) $(PL2BAT) $(UTILS)
        $(MINIPERL) -I..\lib ..\autodoc.pl ..
@@ -1197,6 +1250,7 @@ distclean: realclean
        -del /f $(LIBDIR)\buildcustomize.pl
        -del /f $(DISTDIR)\XSLoader\XSLoader.pm
        -del /f *.def *.map
+       -if exist $(LIBDIR)\Amiga rmdir /s /q $(LIBDIR)\Amiga
        -if exist $(LIBDIR)\App rmdir /s /q $(LIBDIR)\App
        -if exist $(LIBDIR)\Archive rmdir /s /q $(LIBDIR)\Archive
        -if exist $(LIBDIR)\Attribute rmdir /s /q $(LIBDIR)\Attribute
@@ -1223,6 +1277,7 @@ distclean: realclean
        -if exist $(LIBDIR)\Hash rmdir /s /q $(LIBDIR)\Hash
        -if exist $(LIBDIR)\HTTP rmdir /s /q $(LIBDIR)\HTTP
        -if exist $(LIBDIR)\I18N rmdir /s /q $(LIBDIR)\I18N
+       -if exist $(LIBDIR)\inc rmdir /s /q $(LIBDIR)\inc
        -if exist $(LIBDIR)\IO rmdir /s /q $(LIBDIR)\IO
        -if exist $(LIBDIR)\IPC rmdir /s /q $(LIBDIR)\IPC
        -if exist $(LIBDIR)\JSON rmdir /s /q $(LIBDIR)\JSON
@@ -1247,6 +1302,7 @@ distclean: realclean
        -if exist $(LIBDIR)\TAP rmdir /s /q $(LIBDIR)\TAP
        -if exist $(LIBDIR)\Term rmdir /s /q $(LIBDIR)\Term
        -if exist $(LIBDIR)\Test rmdir /s /q $(LIBDIR)\Test
+       -if exist $(LIBDIR)\Test2 rmdir /s /q $(LIBDIR)\Test2
        -if exist $(LIBDIR)\Text rmdir /s /q $(LIBDIR)\Text
        -if exist $(LIBDIR)\Thread rmdir /s /q $(LIBDIR)\Thread
        -if exist $(LIBDIR)\threads rmdir /s /q $(LIBDIR)\threads
@@ -1258,7 +1314,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 \
-           perl5216delta.pod perlaix.pod perlamiga.pod perlandroid.pod \
+           perl5259delta.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 \
@@ -1269,7 +1325,7 @@ 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
        -del /f ..\config.sh perlmain.c dlutils.c config.h.new \
                perlmainst.c
@@ -1307,16 +1363,15 @@ inst_lib : $(CONFIGPM)
 
 $(UNIDATAFILES) ..\pod\perluniprops.pod : $(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 -check $@ $(FIRSTUNIFILE)
+       ..\$(MINIPERL) -I.. mktables -P ..\..\pod -maketest -makelist -p -check $@ $(FIRSTUNIFILE)
 
-minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) utils $(UNIDATAFILES)
+minitest : .\config.h $(MINIPERL) ..\git_version.h $(GLOBEXE) $(CONFIGPM) $(UNIDATAFILES)
        $(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
        $(XCOPY) $(PERLEXE) ..\t\$(NULL)
@@ -1326,12 +1381,12 @@ test-prep : all utils ../pod/perltoc.pod
 
 test : test-prep
        cd ..\t
-       $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
+       perl.exe harness $(TEST_SWITCHES) $(TEST_FILES)
        cd ..\win32
 
 test_porting : test-prep
        cd ..\t
-       $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) porting\*.t ..\lib\diagnostics.t
+       perl.exe harness $(TEST_SWITCHES) porting\*.t ..\lib\diagnostics.t
        cd ..\win32
 
 test-reonly : reonly utils
@@ -1339,7 +1394,7 @@ test-reonly : reonly utils
        $(XCOPY) $(PERLDLL) ..\t\$(NULL)
        $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
        cd ..\t
-       $(PERLEXE) -I..\lib harness $(OPT) -re \bre\\/ $(EXTRA)
+       perl.exe harness $(OPT) -re \bre\\/ $(EXTRA)
        cd ..\win32
 
 regen :
@@ -1350,7 +1405,7 @@ regen :
 test-notty : test-prep
        set PERL_SKIP_TTY_TEST=1
        cd ..\t
-       $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
+       perl.exe harness $(TEST_SWITCHES) $(TEST_FILES)
        cd ..\win32
 
 _test : 
@@ -1358,7 +1413,7 @@ _test :
        $(XCOPY) $(PERLDLL) ..\t\$(NULL)
        $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
        cd ..\t
-       $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
+       perl.exe harness $(TEST_SWITCHES) $(TEST_FILES)
        cd ..\win32
 
 _clean :
@@ -1367,7 +1422,6 @@ _clean :
        -@$(DEL) perlglob$(o)
        -@$(DEL) perlmain$(o)
        -@$(DEL) perlmainst$(o)
-       -@$(DEL) config.w32
        -@$(DEL) config.h
        -@$(DEL) ..\git_version.h
        -@$(DEL) $(GLOBEXE)
@@ -1399,13 +1453,13 @@ realclean : Extensions_realclean _clean
 # Please *don't* use this unless all tests pass.
 # If you want to report test failures, use "nmake 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