This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Placate nervous compilers that see longer than ints switch()ing.
[perl5.git] / win32 / Makefile
index 3909230..af11990 100644 (file)
@@ -2,7 +2,7 @@
 # Makefile to build perl on Windows NT using Microsoft NMAKE.
 #
 # This is set up to build a perl.exe that runs off a shared library
-# (perl.dll).  Also makes individual DLLs for the XS extensions.
+# (perl56.dll).  Also makes individual DLLs for the XS extensions.
 #
 
 ##
@@ -29,7 +29,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.5.670
+INST_VER       = \5.6.0
 
 #
 # Comment this out if you DON'T want your perl installation to have
@@ -49,8 +49,6 @@ INST_ARCH     = \$(ARCHNAME)
 #USE_MULTI     = define
 
 #
-# XXX WARNING! This option is still very experimental.  May be broken.
-#
 # Beginnings of interpreter cloning/threads; still very incomplete.
 # This should be enabled to get the fork() emulation.  This needs
 # USE_MULTI as well.
@@ -178,11 +176,6 @@ CCLIBDIR   = $(CCHOME)\lib
 #BUILDOPT      = $(BUILDOPT) -DPERL_TEXTMODE_SCRIPTS
 
 #
-# This should normally be disabled.  Enabling it runs a cloned toplevel
-# interpreter (*EXPERIMENTAL*, fails tests)
-#BUILDOPT      = $(BUILDOPT) -DTOP_CLONE
-
-#
 # specify semicolon-separated list of extra directories that modules will
 # look for libraries (spaces in path names need not be quoted)
 #
@@ -333,7 +326,6 @@ RSC         = rc
 # Options
 #
 
-RUNTIME                = -MD
 INCLUDES       = -I$(COREDIR) -I.\include -I. -I..
 #PCHFLAGS      = -Fpc:\temp\vcmoduls.pch -YX 
 DEFINES                = -DWIN32 -D_CONSOLE -DNO_STRICT $(CRYPT_FLAG)
@@ -342,42 +334,28 @@ SUBSYS            = console
 CXX_FLAG       = -TP -GX
 
 !IF "$(USE_PERLCRT)" != "define"
-!   IF  "$(CFG)" == "Debug"
-PERLCRTLIBC    = msvcrtd.lib
-!   ELSE
-PERLCRTLIBC    = msvcrt.lib
-!   ENDIF
+LIBC   = msvcrt.lib
 !ELSE
-!   IF  "$(CFG)" == "Debug"
-PERLCRTLIBC    = PerlCRTD.lib
-!   ELSE
-PERLCRTLIBC    = PerlCRT.lib
-!   ENDIF
+LIBC   = PerlCRT.lib
 !ENDIF
 
 PERLEXE_RES    =
 PERLDLL_RES    =
 
-!IF "$(RUNTIME)" == "-MD"
-LIBC           = $(PERLCRTLIBC)
-!ELSE
-LIBC           = libcmt.lib
-!ENDIF
-
 !IF  "$(CFG)" == "Debug"
 !  IF "$(CCTYPE)" == "MSVC20"
-OPTIMIZE       = -Od $(RUNTIME) -Z7 -D_DEBUG -DDEBUGGING
+OPTIMIZE       = -Od -MD -Z7 -DDEBUGGING
 !  ELSE
-OPTIMIZE       = -Od $(RUNTIME)d -Zi -D_DEBUG -DDEBUGGING
+OPTIMIZE       = -Od -MD -Zi -DDEBUGGING
 !  ENDIF
 LINK_DBG       = -debug -pdb:none
 !ELSE
 !  IF  "$(CFG)" == "Optimize"
 # -O1 yields smaller code, which turns out to be faster than -O2
-#OPTIMIZE      = -O2 $(RUNTIME) -DNDEBUG
-OPTIMIZE       = -O1 $(RUNTIME) -DNDEBUG
+#OPTIMIZE      = -O2 -MD -DNDEBUG
+OPTIMIZE       = -O1 -MD -DNDEBUG
 !  ELSE
-OPTIMIZE       = -Od $(RUNTIME) -DNDEBUG
+OPTIMIZE       = -Od -MD -DNDEBUG
 !  ENDIF
 LINK_DBG       = -release
 !ENDIF
@@ -391,7 +369,7 @@ BUILDOPT    = $(BUILDOPT) -DPERL_OBJECT
 BUILDOPT       = $(BUILDOPT) -DPERL_MSVCRT_READFIX
 !ENDIF
 
-LIBBASEFILES   = $(DELAYLOAD) $(CRYPT_LIB) \
+LIBBASEFILES   = $(CRYPT_LIB) \
                oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
                comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
                netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
@@ -616,7 +594,7 @@ SETARGV_OBJ = setargv$(o)
 
 DYNAMIC_EXT    = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
                Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob \
-               Sys/Hostname
+               Sys/Hostname Storable
 STATIC_EXT     = DynaLoader
 NONXS_EXT      = Errno
 
@@ -638,6 +616,7 @@ BYTELOADER  = $(EXTDIR)\ByteLoader\ByteLoader
 DPROF          = $(EXTDIR)\Devel\DProf\DProf
 GLOB           = $(EXTDIR)\File\Glob\Glob
 HOSTNAME       = $(EXTDIR)\Sys\Hostname\Hostname
+STORABLE       = $(EXTDIR)\Storable\Storable
 
 SOCKET_DLL     = $(AUTODIR)\Socket\Socket.dll
 FCNTL_DLL      = $(AUTODIR)\Fcntl\Fcntl.dll
@@ -655,6 +634,7 @@ BYTELOADER_DLL      = $(AUTODIR)\ByteLoader\ByteLoader.dll
 DPROF_DLL      = $(AUTODIR)\Devel\DProf\DProf.dll
 GLOB_DLL       = $(AUTODIR)\File\Glob\Glob.dll
 HOSTNAME_DLL   = $(AUTODIR)\Sys\Hostname\Hostname.dll
+STORABLE_DLL   = $(AUTODIR)\Storable\Storable.dll
 
 ERRNO_PM       = $(LIBDIR)\Errno.pm
 
@@ -674,7 +654,8 @@ EXTENSION_C =               \
                $(BYTELOADER).c \
                $(DPROF).c      \
                $(GLOB).c       \
-               $(HOSTNAME).c
+               $(HOSTNAME).c   \
+               $(STORABLE).c
 
 EXTENSION_DLL  =               \
                $(SOCKET_DLL)   \
@@ -692,7 +673,8 @@ EXTENSION_DLL       =               \
                $(BYTELOADER_DLL)       \
                $(DPROF_DLL)    \
                $(GLOB_DLL)     \
-               $(HOSTNAME_DLL)
+               $(HOSTNAME_DLL) \
+               $(STORABLE_DLL)
 
 EXTENSION_PM   =               \
                $(ERRNO_PM)
@@ -815,8 +797,8 @@ perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl
            CCTYPE=$(CCTYPE) > perldll.def
 
 $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES)
-       $(LINK32) -dll -def:perldll.def -out:$@ @<<
-               $(LINK_FLAGS) /base:0x28000000 $(LIBFILES) $(PERLDLL_OBJ) $(PERLDLL_RES)
+       $(LINK32) -dll -def:perldll.def -base:0x28000000 -out:$@ @<<
+               $(LINK_FLAGS) $(DELAYLOAD) $(LIBFILES) $(PERLDLL_OBJ) $(PERLDLL_RES)
 <<
        $(XCOPY) $(PERLIMPLIB) $(COREDIR)
 
@@ -852,8 +834,8 @@ perlmain$(o) : perlmain.c
        $(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c
 
 $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES)
-       $(LINK32) -subsystem:console -out:$@ $(LINK_FLAGS) $(LIBFILES) \
-           $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES)
+       $(LINK32) -subsystem:console -out:$@ -stack:0x1000000 $(LINK_FLAGS) \
+           $(LIBFILES) $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES)
        copy $(PERLEXE) $(WPERLEXE)
        $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS
        copy splittree.pl .. 
@@ -970,6 +952,12 @@ $(BYTELOADER_DLL): $(PERLEXE) $(BYTELOADER).xs
        $(MAKE)
        cd ..\..\win32
 
+$(STORABLE_DLL): $(PERLEXE) $(STORABLE).xs
+       cd $(EXTDIR)\$(*B)
+       ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+       $(MAKE)
+       cd ..\..\win32
+
 $(ERRNO_PM): $(PERLEXE) $(ERRNO)_pm.PL
        cd $(EXTDIR)\$(*B)
        ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
@@ -985,8 +973,17 @@ utils: $(PERLEXE) $(X2P)
        cd ..\utils
        $(MAKE) PERL=$(MINIPERL)
        cd ..\pod
+       copy ..\README.amiga .\perlamiga.pod
+       copy ..\README.cygwin .\perlcygwin.pod
+       copy ..\README.dos .\perldos.pod
+       copy ..\README.hpux .\perlhpux.pod
+       copy ..\README.machten .\perlmachten.pod
+       copy ..\README.os2 .\perlos2.pod
+       copy ..\vms\perlvms.pod .\perlvms.pod
        copy ..\README.win32 .\perlwin32.pod
        $(MAKE) -f ..\win32\pod.mak converters
+       cd ..\lib
+       $(PERLEXE) lib_pm.PL
        cd ..\win32
        $(PERLEXE) $(PL2BAT) $(UTILS)
 
@@ -1006,10 +1003,11 @@ distclean: clean
        -del /f $(LIBDIR)\Data\Dumper.pm $(LIBDIR)\ByteLoader.pm
        -del /f $(LIBDIR)\Devel\Peek.pm $(LIBDIR)\Devel\DProf.pm
        -del /f $(LIBDIR)\File\Glob.pm
-       -rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO
-       -rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread
-       -rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B
-       -rmdir /s /q $(LIBDIR)\Data || rmdir /s $(LIBDIR)\Data
+       -del /f $(LIBDIR)\Storable.pm
+       -if exist $(LIBDIR)\IO rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO
+       -if exist $(LIBDIR)\Thread rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread
+       -if exist $(LIBDIR)\B rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B
+       -if exist $(LIBDIR)\Data rmdir /s /q $(LIBDIR)\Data || rmdir /s $(LIBDIR)\Data
        -del /f $(PODDIR)\*.html
        -del /f $(PODDIR)\*.bat
        cd ..\utils
@@ -1026,8 +1024,8 @@ distclean: clean
        cd $(EXTDIR)
        -del /s *.lib *.def *.map *.pdb *.bs Makefile *$(o) pm_to_blib
        cd ..\win32
-       -rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR)
-       -rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR)
+       -if exist $(AUTODIR) rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR)
+       -if exist $(COREDIR) rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR)
 
 install : all installbare installhtml
 
@@ -1095,7 +1093,7 @@ clean :
        -@erase $(WPERLEXE)
        -@erase $(PERLDLL)
        -@erase $(CORE_OBJ)
-       -rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR)
+       -if exist $(MINIDIR) rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR)
        -@erase $(WIN32_OBJ)
        -@erase $(DLL_OBJ)
        -@erase $(X2P_OBJ)
@@ -1104,3 +1102,19 @@ clean :
        -@erase ..\x2p\*.exe ..\x2p\*.bat
        -@erase *.ilk
        -@erase *.pdb
+# Handy way to run perlbug -ok without having to install and run the
+# installed perlbug. We don't re-run the tests here - we trust the user.
+# 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)"
+
+okfile: utils
+       $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)" -F perl.ok
+nok: utils
+       $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)"
+nokfile: utils
+       $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)" -F perl.nok