This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
(perl #133494) better document CCHOME for GCC builds
[perl5.git] / win32 / Makefile
index 8002ca3..603e97b 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
-# (perl526.dll).  Also makes individual DLLs for the XS extensions.
+# (perl529.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.26.0
+#INST_VER      = \5.29.4
 
 #
 # Comment this out if you DON'T want your perl installation to have
@@ -112,37 +112,27 @@ DEFAULT_INC_EXCLUDES_DOT = define
 # uncomment exactly one of the following
 #
 # Visual C++ 6.0 (aka Visual C++ 98)
-CCTYPE         = MSVC60
+#CCTYPE                = MSVC60
 # Visual C++ .NET 2002/2003 (aka Visual C++ 7.0/7.1) (full version)
 #CCTYPE                = MSVC70
 # Visual C++ Toolkit 2003 (aka Visual C++ 7.1) (free command-line tools)
 #CCTYPE                = MSVC70FREE
-# Windows Server 2003 SP1 Platform SDK (April 2005)
+# Windows Server 2003 SP1 Platform SDK (April 2005) (64-bit compiler and tools)
 #CCTYPE                = SDK2003SP1
-# Visual C++ 2005 (aka Visual C++ 8.0) (full version)
+# Visual C++ 2005 (aka Visual C++ 8.0) (full version or Express Edition)
 #CCTYPE                = MSVC80
-# Visual C++ 2005 Express Edition (aka Visual C++ 8.0) (free version)
-#CCTYPE                = MSVC80FREE
-# Visual C++ 2008 (aka Visual C++ 9.0) (full version)
+# Visual C++ 2008 (aka Visual C++ 9.0) (full version or Express Edition)
 #CCTYPE                = MSVC90
-# Visual C++ 2008 Express Edition (aka Visual C++ 9.0) (free version)
-#CCTYPE                = MSVC90FREE
-# Visual C++ 2010 (aka Visual C++ 10.0) (full version)
+# Visual C++ 2010 (aka Visual C++ 10.0) (full version or Express Edition)
 #CCTYPE                = MSVC100
-# Visual C++ 2010 Express Edition (aka Visual C++ 10.0) (free version)
-#CCTYPE                = MSVC100FREE
-# Visual C++ 2012 (aka Visual C++ 11.0) (full version)
+# Visual C++ 2012 (aka Visual C++ 11.0) (full version or Express Edition)
 #CCTYPE                = MSVC110
-# Visual C++ 2012 Express Edition (aka Visual C++ 11.0) (free version)
-#CCTYPE                = MSVC110FREE
-# Visual C++ 2013 (aka Visual C++ 12.0) (full version)
+# Visual C++ 2013 (aka Visual C++ 12.0) (full version or Express Edition)
 #CCTYPE                = MSVC120
-# Visual C++ 2013 Express Edition (aka Visual C++ 12.0) (free version)
-#CCTYPE                = MSVC120FREE
-# Visual C++ 2015 (aka Visual C++ 14.0) (full version)
+# Visual C++ 2015 (aka Visual C++ 14.0) (full version or Express Edition)
 #CCTYPE                = MSVC140
-# Visual C++ 2015 Express Edition (aka Visual C++ 14.0) (free version)
-#CCTYPE                = MSVC140FREE
+# Visual C++ 2017 (aka Visual C++ 14.1) (full version or Community Edition)
+#CCTYPE                = MSVC141
 
 #
 # If you are using Intel C++ Compiler uncomment this
@@ -202,31 +192,38 @@ 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 perl526s.lib will also be created.
+# variables below. A static library perl529s.lib will also be created.
 # Ordinary perl.exe is not affected by this option.
 #
 #BUILD_STATIC  = define
 
 #
 # in addition to BUILD_STATIC the option ALL_STATIC makes *every*
-# extension get statically built
+# extension get statically built.
 # This will result in a very large perl executable, but the main purpose
 # is to have proper linking set so as to be able to create miscellaneous
-# executables with different built-in extensions
+# executables with different built-in extensions.
 #
 #ALL_STATIC    = define
 
 #
+# set the install location of the compiler
+# Running VCVARS32.BAT, VCVARSALL.BAT or similar is *required* when using
+# Visual C++.
+# Versions of Visual C++ up to VC++ 7.1 define $(MSVCDir); versions since then
+# define $(VCINSTALLDIR) instead, but for VC++ 14.1 we need the subfolder given
+# by $(VCToolsInstallDir).
 #
-# set the install locations of the compiler include/libraries
-# Running VCVARS32.BAT is *required* when using Visual C.
-# Some versions of Visual C don't define MSVCDIR in the environment,
-# so you may have to set CCHOME explicitly (spaces in the path name should
-# not be quoted)
-#
+!IF "$(CCTYPE)" == "MSVC60" || \
+    "$(CCTYPE)" == "MSVC70" || "$(CCTYPE)" == "MSVC70FREE"
 CCHOME         = $(MSVCDIR)
-CCINCDIR       = $(CCHOME)\include
-CCLIBDIR       = $(CCHOME)\lib
+!ELSE
+!  IF "$(CCTYPE)" == "MSVC141"
+CCHOME         = $(VCTOOLSINSTALLDIR)
+!  ELSE
+CCHOME         = $(VCINSTALLDIR)
+!  ENDIF
+!ENDIF
 
 #
 # Additional compiler flags can be specified here.
@@ -439,6 +436,23 @@ EMBED_EXE_MANI     = if exist $@.manifest mt -nologo -manifest $@.manifest -outputre
 EMBED_DLL_MANI = if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2 && \
                  if exist $@.manifest del $@.manifest
 
+# Set the install location of the compiler headers/libraries.
+# These are saved into $Config{incpath} and $Config{libpth}.
+CCINCDIR       = $(CCHOME)\include
+!IF "$(CCTYPE)" == "MSVC141"
+!  IF "$(WIN64)" == "define"
+CCLIBDIR       = $(CCHOME)\lib\x64
+!  ELSE
+CCLIBDIR       = $(CCHOME)\lib\x86
+!  ENDIF
+!ELSE
+!  IF "$(WIN64)" == "define"
+CCLIBDIR       = $(CCHOME)\lib\amd64
+!  ELSE
+CCLIBDIR       = $(CCHOME)\lib
+!  ENDIF
+!ENDIF
+
 ARCHDIR                = ..\lib\$(ARCHNAME)
 COREDIR                = ..\lib\CORE
 AUTODIR                = ..\lib\auto
@@ -449,7 +463,6 @@ CPANDIR             = ..\cpan
 PODDIR         = ..\pod
 HTMLDIR                = .\html
 
-#
 INST_SCRIPT    = $(INST_TOP)$(INST_VER)\bin
 INST_BIN       = $(INST_SCRIPT)$(INST_ARCH)
 INST_LIB       = $(INST_TOP)$(INST_VER)\lib
@@ -461,7 +474,13 @@ INST_HTML  = $(INST_TOP)$(INST_VER)\html
 # Programs to compile, build .lib files and link
 #
 
-!IF "$(__ICC)" != "define"
+# Poison the recipe if no CCTYPE is set, and delete mini\.exists so everything
+# is rebuilt next time to avoid reusing a mini config.h written with no sane CC
+# version set
+!IF "$(CCTYPE)" == ""
+CC             = @echo CCTYPE makefile variable not set && del mini\.exists && exit 1 &&
+LINK32         = @echo CCTYPE makefile variable not set && del mini\.exists && exit 1 &&
+!ELSE IF "$(__ICC)" != "define"
 CC             = cl
 LINK32         = link
 !ELSE
@@ -481,7 +500,7 @@ DEFINES             = -DWIN32 -D_CONSOLE -DNO_STRICT
 LOCDEFS                = -DPERLDLL -DPERL_CORE
 CXX_FLAG       = -TP -EHsc
 
-!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC140FREE"
+!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141"
 LIBC           = ucrt.lib
 !ELSE
 LIBC           = msvcrt.lib
@@ -496,7 +515,7 @@ OPTIMIZE    = -Od -MD -Zi
 LINK_DBG       = -debug
 !ELSE
 !IF  "$(CFG)" == "DebugFull"
-!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC140FREE"
+!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141"
 LIBC           = ucrtd.lib
 !ELSE
 LIBC           = msvcrtd.lib
@@ -535,11 +554,20 @@ OPTIMIZE  = $(OPTIMIZE) -fp:precise
 DEFINES                = $(DEFINES) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
 !ENDIF
 
-# Likewise for deprecated Winsock APIs in VC++ 14.0 for now.
-!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC140FREE"
+# Likewise for deprecated Winsock APIs in VC++ 14.0 onwards for now.
+!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141"
 DEFINES                = $(DEFINES) -D_WINSOCK_DEPRECATED_NO_WARNINGS
 !ENDIF
 
+# The Windows Server 2003 SP1 SDK compiler only defines _configthreadlocale() if
+# _MT is defined, i.e. when using /MT (the LIBCMT.lib version of the CRT), which
+# the perl build doesn't use. We therefore specify NO_THREAD_SAFE_LOCALE so that
+# perl.h doesn't set USE_THREAD_SAFE_LOCALE, which it otherwise would do since
+# _MSC_VER is 1400 for this compiler (as per MSVC80).
+!IF "$(CCTYPE)" == "SDK2003SP1"
+DEFINES                = $(DEFINES) -DNO_THREAD_SAFE_LOCALE
+!ENDIF
+
 # In VS 2005 (VC++ 8.0) Microsoft changes time_t from 32-bit to
 # 64-bit, even in 32-bit mode.  It also provides the _USE_32BIT_TIME_T
 # preprocessor option to revert back to the old functionality for
@@ -560,7 +588,7 @@ LIBBASEFILES        = \
                netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib \
                version.lib odbc32.lib odbccp32.lib comctl32.lib
 
-!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC140FREE"
+!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141"
 !  IF  "$(CFG)" == "DebugFull"
 LIBBASEFILES   = $(LIBBASEFILES) msvcrtd.lib vcruntimed.lib
 !  ELSE
@@ -576,11 +604,11 @@ LIBBASEFILES      = $(LIBBASEFILES) msvcrt.lib vcruntime.lib
 LIBBASEFILES   = $(LIBBASEFILES) libircmt.lib libmmd.lib
 !ENDIF
 
-# The 64 bit Windows Server 2003 SP1 SDK compilers link against MSVCRT.dll, which
+# The Windows Server 2003 SP1 SDK compiler links against MSVCRT.dll, which
 # doesn't include the buffer overrun verification code used by the /GS switch.
 # Since the code links against libraries that are compiled with /GS, this
 # "security cookie verification" code must be included via bufferoverflow.lib.
-!IF "$(WIN64)" == "define" && "$(CCTYPE)" == "SDK2003SP1"
+!IF "$(CCTYPE)" == "SDK2003SP1"
 LIBBASEFILES    = $(LIBBASEFILES) bufferoverflowU.lib
 !ENDIF
 
@@ -611,12 +639,13 @@ PRIV_LINK_FLAGS   = $(PRIV_LINK_FLAGS) "/manifestdependency:type='Win32' name='Mic
 RSC_FLAGS      = -DINCLUDE_MANIFEST
 !ENDIF
 
+# VS 2017 (VC++ 14.1) requires at minimum Windows 7 SP1 (with latest Windows Updates)
+
 # 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 "$(CCTYPE)" == "MSVC120" || "$(CCTYPE)" == "MSVC140"
 !  IF "$(WIN64)" == "define"
 LINK_FLAGS     = $(LINK_FLAGS) -subsystem:console,"5.02"
 !  ELSE
@@ -665,9 +694,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     = ..\perl526.lib
-PERLSTATICLIB  = ..\perl526s.lib
-PERLDLL                = ..\perl526.dll
+PERLIMPLIB     = ..\perl529.lib
+PERLSTATICLIB  = ..\perl529s.lib
+PERLDLL                = ..\perl529.dll
 
 MINIPERL       = ..\miniperl.exe
 MINIDIR                = .\mini
@@ -744,6 +773,7 @@ MAKE_BARE   = nmake
 
 CFGSH_TMPL     = config.vc
 CFGH_TMPL      = config_H.vc
+INT64          = __int64
 
 XCOPY          = xcopy /f /r /i /d /y
 RCOPY          = xcopy /f /r /i /e /d /y
@@ -924,8 +954,9 @@ CFG_VARS    =                                       \
 # Top targets
 #
 
-all : .\config.h ..\git_version.h $(GLOBEXE) $(CONFIGPM) \
-       $(UNIDATAFILES) MakePPPort $(PERLEXE) Extensions_nonxs Extensions $(PERLSTATIC)
+all : ..\git_version.h $(GLOBEXE) $(CONFIGPM) \
+       $(UNIDATAFILES) MakePPPort $(PERLEXE) Extensions_nonxs Extensions PostExt \
+       $(PERLSTATIC)
        @echo   Everything is up to date. '$(MAKE_BARE) test' to run test suite.
 
 regnodes : ..\regnodes.h
@@ -949,112 +980,6 @@ $(GLOBEXE) : perlglob$(o)
 
 perlglob$(o)  : perlglob.c
 
-#
-# Copy the template config.h and set configurables at the end of it
-# as per the options chosen and compiler used.
-# Note: This config.h is only used to build miniperl.exe anyway, but
-# it's as well to have its options correct to be sure that it builds
-# and so that it's "-V" options are correct for use by makedef.pl. The
-# real config.h used to build perl.exe is generated from the top-level
-# config_h.SH by config_h.PL (run by miniperl.exe).
-#
-.\config.h : $(CFGH_TMPL)
-       -del /f config.h
-       copy $(CFGH_TMPL) config.h
-       @echo.>>$@
-       @echo #ifndef _config_h_footer_>>$@
-       @echo #define _config_h_footer_>>$@
-!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC140FREE"
-       @echo #undef FILE_ptr>>$@
-       @echo #define FILE_ptr(fp) PERLIO_FILE_ptr(fp)>>$@
-       @echo #undef FILE_cnt>>$@
-       @echo #define FILE_cnt(fp) PERLIO_FILE_cnt(fp)>>$@
-       @echo #undef FILE_base>>$@
-       @echo #define FILE_base(fp) PERLIO_FILE_base(fp)>>$@
-       @echo #undef FILE_bufsiz>>$@
-       @echo #define FILE_bufsiz(fp) (PERLIO_FILE_cnt(fp) + PERLIO_FILE_ptr(fp) - PERLIO_FILE_base(fp))>>$@
-       @echo #define I_STDBOOL>>$@
-!ENDIF
-       @echo #undef Off_t>>$@
-       @echo #undef LSEEKSIZE>>$@
-       @echo #undef Off_t_size>>$@
-       @echo #undef PTRSIZE>>$@
-       @echo #undef SSize_t>>$@
-       @echo #undef HAS_ATOLL>>$@
-       @echo #undef HAS_STRTOLL>>$@
-       @echo #undef HAS_STRTOULL>>$@
-       @echo #undef IVTYPE>>$@
-       @echo #undef UVTYPE>>$@
-       @echo #undef IVSIZE>>$@
-       @echo #undef UVSIZE>>$@
-       @echo #undef NV_PRESERVES_UV>>$@
-       @echo #undef NV_PRESERVES_UV_BITS>>$@
-       @echo #undef IVdf>>$@
-       @echo #undef UVuf>>$@
-       @echo #undef UVof>>$@
-       @echo #undef UVxf>>$@
-       @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>>$@
-       @echo #define Off_t_size ^8>>$@
-!ELSE
-       @echo #define Off_t long>>$@
-       @echo #define LSEEKSIZE ^4>>$@
-       @echo #define Off_t_size ^4>>$@
-!ENDIF
-!IF "$(WIN64)"=="define"
-       @echo #define PTRSIZE ^8>>$@
-       @echo #define SSize_t __int64>>$@
-       @echo #define HAS_ATOLL>>$@
-       @echo #define HAS_STRTOLL>>$@
-       @echo #define HAS_STRTOULL>>$@
-       @echo #define Size_t_size ^8>>$@
-!ELSE
-       @echo #define PTRSIZE ^4>>$@
-       @echo #define SSize_t int>>$@
-       @echo #undef HAS_ATOLL>>$@
-       @echo #undef HAS_STRTOLL>>$@
-       @echo #undef HAS_STRTOULL>>$@
-       @echo #define Size_t_size ^4>>$@
-!ENDIF
-!IF "$(USE_64_BIT_INT)"=="define"
-       @echo #define IVTYPE __int64>>$@
-       @echo #define UVTYPE unsigned __int64>>$@
-       @echo #define IVSIZE ^8>>$@
-       @echo #define UVSIZE ^8>>$@
-       @echo #undef NV_PRESERVES_UV>>$@
-       @echo #define NV_PRESERVES_UV_BITS 53>>$@
-       @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>>$@
-       @echo #define UVTYPE unsigned long>>$@
-       @echo #define IVSIZE ^4>>$@
-       @echo #define UVSIZE ^4>>$@
-       @echo #define NV_PRESERVES_UV>>$@
-       @echo #define NV_PRESERVES_UV_BITS 32>>$@
-       @echo #define IVdf "ld">>$@
-       @echo #define UVuf "lu">>$@
-       @echo #define UVof "lo">>$@
-       @echo #define UVxf "lx">>$@
-       @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
        cd .. && miniperl -Ilib make_patchnum.pl && cd win32
 
@@ -1083,18 +1008,127 @@ $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL
        -$(MINIPERL) -I..\lib config_h.PL
        if errorlevel 1 $(MAKE) /$(MAKEFLAGS) $(CONFIGPM)
 
+.\config.h : $(CONFIGPM)
+
 # See the comment in Makefile.SH explaining this seemingly cranky ordering
-$(MINIPERL) : ..\lib\buildcustomize.pl 
+$(MINIPERL) : ..\lib\buildcustomize.pl
 
-..\lib\buildcustomize.pl : $(MINIDIR) $(MINI_OBJ) ..\write_buildcustomize.pl
+..\lib\buildcustomize.pl : $(MINI_OBJ) ..\write_buildcustomize.pl
        $(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 ..
 
-$(MINIDIR) :
+$(MINIDIR)\.exists : $(CFGH_TMPL)
        if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
+#
+# Copy the template config.h and set configurables at the end of it
+# as per the options chosen and compiler used.
+# Note: This config.h is only used to build miniperl.exe anyway, but
+# it's as well to have its options correct to be sure that it builds
+# and so that it's "-V" options are correct for use by makedef.pl. The
+# real config.h used to build perl.exe is generated from the top-level
+# config_h.SH by config_h.PL (run by miniperl.exe).
+#
+       copy $(CFGH_TMPL) config.h
+       @(echo.&& \
+       echo #ifndef _config_h_footer_&& \
+       echo #define _config_h_footer_&& \
+       echo #undef Off_t&& \
+       echo #undef LSEEKSIZE&& \
+       echo #undef Off_t_size&& \
+       echo #undef PTRSIZE&& \
+       echo #undef SSize_t&& \
+       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&& \
+       echo #undef UVSIZE&& \
+       echo #undef NV_PRESERVES_UV&& \
+       echo #undef NV_PRESERVES_UV_BITS&& \
+       echo #undef IVdf&& \
+       echo #undef UVuf&& \
+       echo #undef UVof&& \
+       echo #undef UVxf&& \
+       echo #undef UVXf&& \
+       echo #undef USE_64_BIT_INT&& \
+       echo #undef USE_LONG_DOUBLE&& \
+       echo #undef USE_CPLUSPLUS)>> config.h
+!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141"
+       @(echo #undef FILE_ptr&& \
+       echo #undef FILE_cnt&& \
+       echo #undef FILE_base&& \
+       echo #undef FILE_bufsiz&& \
+       echo #define FILE_ptr^(fp^) PERLIO_FILE_ptr^(fp^)&& \
+       echo #define FILE_cnt^(fp^) PERLIO_FILE_cnt^(fp^)&& \
+       echo #define FILE_base^(fp^) PERLIO_FILE_base^(fp^)&& \
+       echo #define FILE_bufsiz^(fp^) ^(PERLIO_FILE_cnt^(fp^) + PERLIO_FILE_ptr^(fp^) - PERLIO_FILE_base^(fp^)^)&& \
+       echo #define I_STDBOOL)>> config.h
+!ENDIF
+!IF "$(USE_LARGE_FILES)"=="define"
+       @(echo #define Off_t $(INT64)&& \
+       echo #define LSEEKSIZE ^8&& \
+       echo #define Off_t_size ^8)>> config.h
+!ELSE
+       @(echo #define Off_t long&& \
+       echo #define LSEEKSIZE ^4&& \
+       echo #define Off_t_size ^4)>> config.h
+!ENDIF
+!IF "$(WIN64)"=="define"
+       @(echo #define PTRSIZE ^8&& \
+       echo #define SSize_t $(INT64)&& \
+       echo #define HAS_ATOLL&& \
+       echo #define HAS_STRTOLL&& \
+       echo #define HAS_STRTOULL&& \
+       echo #define Size_t_size ^8)>> config.h
+!ELSE
+       @(echo #define PTRSIZE ^4&& \
+       echo #define SSize_t int&& \
+       echo #undef HAS_ATOLL&& \
+       echo #undef HAS_STRTOLL&& \
+       echo #undef HAS_STRTOULL&& \
+       echo #define Size_t_size ^4)>> config.h
+!ENDIF
+!IF "$(USE_64_BIT_INT)"=="define"
+       @(echo #define IVTYPE $(INT64)&& \
+       echo #define UVTYPE unsigned $(INT64)&& \
+       echo #define IVSIZE ^8&& \
+       echo #define UVSIZE ^8&& \
+       echo #undef NV_PRESERVES_UV&& \
+       echo #define NV_PRESERVES_UV_BITS 53&& \
+       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)>> config.h
+!ELSE
+       @(echo #define IVTYPE long&& \
+       echo #define UVTYPE unsigned long&& \
+       echo #define IVSIZE ^4&& \
+       echo #define UVSIZE ^4&& \
+       echo #define NV_PRESERVES_UV&& \
+       echo #define NV_PRESERVES_UV_BITS 32&& \
+       echo #define IVdf "ld"&& \
+       echo #define UVuf "lu"&& \
+       echo #define UVof "lo"&& \
+       echo #define UVxf "lx"&& \
+       echo #define UVXf "lX"&& \
+       echo #undef USE_64_BIT_INT)>> config.h
+!ENDIF
+!IF "$(USE_CPLUSPLUS)"=="define"
+       @(echo #define USE_CPLUSPLUS&& \
+       echo #endif)>> config.h
+!ELSE
+       @(echo #undef USE_CPLUSPLUS&& \
+       echo #endif)>> config.h
+!ENDIF
+#separate line since this is sentinal that this target is done
+       @rem. > $(MINIDIR)\.exists
 
 $(MINICORE_OBJ) : $(CORE_NOCFG_H)
        $(CC) -c $(CFLAGS) -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL $(OBJOUT_FLAG)$@ ..\$(*F).c
@@ -1112,7 +1146,7 @@ perllib$(o)       : perllib.c .\perlhost.h .\vdir.h .\vmem.h
 # 1. we don't want to rebuild miniperl.exe when config.h changes
 # 2. we don't want to rebuild miniperl.exe with non-default config.h
 # 3. we can't have miniperl.exe depend on git_version.h, as miniperl creates it
-$(MINI_OBJ)    : $(CORE_NOCFG_H)
+$(MINI_OBJ)    : $(MINIDIR)\.exists $(CORE_NOCFG_H)
 
 $(WIN32_OBJ)   : $(CORE_H)
 $(CORE_OBJ)    : $(CORE_H)
@@ -1210,6 +1244,13 @@ Extensions_clean:
 Extensions_realclean: 
        -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=realclean
 
+PostExt: ..\lib\Storable\Limit.pm
+
+..\lib\Storable\Limit.pm: $(PERLEXE) Extensions
+       cd ..\dist\Storable && $(MAKE) lib\Storable\Limit.pm
+       if not exist ..\lib\Storable mkdir ..\lib\Storable
+       copy ..\dist\Storable\lib\Storable\Limit.pm ..\lib\Storable\Limit.pm
+
 #-------------------------------------------------------------------------------
 
 doc: $(PERLEXE) ..\pod\perltoc.pod
@@ -1260,7 +1301,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\perl52513delta.pod
+       copy ..\pod\perldelta.pod ..\pod\perl5294delta.pod
        cd ..\win32
        $(PERLEXE) $(PL2BAT) $(UTILS)
        $(MINIPERL) -I..\lib ..\autodoc.pl ..
@@ -1288,6 +1329,7 @@ distclean: realclean
        -del /f $(LIBDIR)\Time\HiRes.pm
        -del /f $(LIBDIR)\Unicode\Normalize.pm
        -del /f $(LIBDIR)\Math\BigInt\FastCalc.pm
+       -del /f $(LIBDIR)\Storable.pm $(LIBDIR)\Storable\Limit.pm
        -del /f $(LIBDIR)\Win32.pm
        -del /f $(LIBDIR)\Win32CORE.pm
        -del /f $(LIBDIR)\Win32API\File.pm
@@ -1359,7 +1401,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 \
-           perl52513delta.pod perlaix.pod perlamiga.pod perlandroid.pod \
+           perl5294delta.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 \