This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Suppress "ECHO is on." messages when using dmake on Win32
[perl5.git] / win32 / makefile.mk
index 8aca918..dfb3fb4 100644 (file)
@@ -89,14 +89,11 @@ USE_LARGE_FILES *= define
 # Visual C++ > 2.x and < 6.x
 #CCTYPE                *= MSVC
 # Visual C++ >= 6.x
-CCTYPE         *= MSVC60
+#CCTYPE                *= MSVC60
 # Borland 5.02 or later
 #CCTYPE                *= BORLAND
-# mingw32+gcc-2.95.2 or better
-#CCTYPE                *= GCC
-# Uncomment this if you are using the latest MinGW release (2.0.0)
-# with gcc3.2
-#USE_GCC_V3_2  *= define
+# MinGW with gcc-2.95.2 or later
+CCTYPE         *= GCC
 
 #
 # uncomment this if your Borland compiler is older than v5.4.
@@ -161,6 +158,13 @@ CRYPT_SRC  *= fcrypt.c
 #PERL_MALLOC   *= define
 
 #
+# set this to enable debugging mstats
+# This must be enabled to use the Devel::Peek::mstat() function.  This cannot
+# be enabled without PERL_MALLOC as well.
+#
+#DEBUG_MSTATS  *= define
+
+#
 # 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,
@@ -234,6 +238,7 @@ CRYPT_FLAG  = -DHAVE_DES_FCRYPT
 .ENDIF
 
 PERL_MALLOC    *= undef
+DEBUG_MSTATS   *= undef
 
 USE_MULTI      *= undef
 USE_ITHREADS   *= undef
@@ -242,11 +247,23 @@ USE_PERLIO        *= undef
 USE_LARGE_FILES        *= undef
 USE_PERLCRT    *= undef
 
-.IF "$(USE_IMP_SYS)$(USE_MULTI)" == "defineundef"
+.IF "$(USE_IMP_SYS)" == "define"
+PERL_MALLOC    = undef
+.ENDIF
+
+.IF "$(PERL_MALLOC)" == "undef"
+DEBUG_MSTATS   = undef
+.ENDIF
+
+.IF "$(DEBUG_MSTATS)" == "define"
+BUILDOPT       += -DPERL_DEBUGGING_MSTATS
+.ENDIF
+
+.IF "$(USE_IMP_SYS) $(USE_MULTI)" == "define undef"
 USE_MULTI      != define
 .ENDIF
 
-.IF "$(USE_ITHREADS)$(USE_MULTI)" == "defineundef"
+.IF "$(USE_ITHREADS) $(USE_MULTI)" == "define undef"
 USE_MULTI      != define
 .ENDIF
 
@@ -293,7 +310,7 @@ ARCHNAME    !:= $(ARCHNAME)-thread
 
 # VC 6.0 can load the socket dll on demand.  Makes the test suite
 # run in about 10% less time.
-DELAYLOAD      *= -DELAYLOAD:wsock32.dll -DELAYLOAD:shell32.dll delayimp.lib
+DELAYLOAD      *= -DELAYLOAD:ws2_32.dll -DELAYLOAD:shell32.dll delayimp.lib
 
 .IF "$(CFG)" == "Debug"
 .ELSE
@@ -379,9 +396,6 @@ LINK_FLAGS  += -L"$(CCLIBDIR)\Release"
 
 CC             = gcc
 LINK32         = g++
-.IF "$(USE_GCC_V3_2)" == "define"
-LINK32         = g++
-.END
 LIB32          = ar rc
 IMPLIB         = dlltool
 RSC            = windres
@@ -406,7 +420,7 @@ LIBC                = -lmsvcrt
 LIBFILES       = $(CRYPT_LIB) $(LIBC) \
                  -lmoldname -lkernel32 -luser32 -lgdi32 \
                  -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 \
-                 -loleaut32 -lnetapi32 -luuid -lwsock32 -lmpr \
+                 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr \
                  -lwinmm -lversion -lodbc32
 
 .IF  "$(CFG)" == "Debug"
@@ -490,7 +504,7 @@ BUILDOPT    += -DPERL_MSVCRT_READFIX
 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 \
+               netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib \
                version.lib
 
 # win64 doesn't have some libs
@@ -523,6 +537,17 @@ BLINK_FLAGS        = $(PRIV_LINK_FLAGS) $(LINK_FLAGS)
 #################### do not edit below this line #######################
 ############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
 
+# Some dmake's built with Borland C++, including Sarathy's one at:
+# http://search.cpan.org/CPAN/authors/id/G/GS/GSAR/dmake-4.1pl1-win32.zip
+# require backslashes to be doubled-up when written to $(mktmp) files.
+# Other dmake's do not require this and would actually output a double
+# backslash if they were doubled-up.
+.IF "$(shell type $(mktmp \\))"=="\\"
+B=\\
+.ELSE
+B=\\\
+.ENDIF
+
 o *= .obj
 a *= .lib
 
@@ -570,17 +595,19 @@ MINIDIR           = .\mini
 PERLEXE                = ..\perl.exe
 WPERLEXE       = ..\wperl.exe
 GLOBEXE                = ..\perlglob.exe
-CONFIGPM       = ..\lib\Config.pm
+CONFIGPM       = ..\lib\Config.pm ..\lib\Config_heavy.pl
 MINIMOD                = ..\lib\ExtUtils\Miniperl.pm
 X2P            = ..\x2p\a2p.exe
 
 # Unicode data files generated by mktables
 UNIDATAFILES    = ..\lib\unicore\Canonical.pl ..\lib\unicore\Exact.pl \
                   ..\lib\unicore\Properties ..\lib\unicore\Decomposition.pl \
-                  ..\lib\unicore\CombiningClass.pl ..\lib\unicore\Name.pl
+                  ..\lib\unicore\CombiningClass.pl ..\lib\unicore\Name.pl \
+                  ..\lib\unicore\PVA.pl
 
 # Directories of Unicode data files generated by mktables
-UNIDATADIRS     = ..\lib\unicore\To ..\lib\unicore\lib
+UNIDATADIR1    = ..\lib\unicore\To
+UNIDATADIR2    = ..\lib\unicore\lib
 
 PERLEXE_ICO    = .\perlexe.ico
 PERLEXE_RES    = .\perlexe.res
@@ -611,6 +638,7 @@ UTILS               =                       \
                ..\utils\libnetcfg      \
                ..\utils\enc2xs         \
                ..\utils\piconv         \
+               ..\utils\corelist       \
                ..\utils\cpan           \
                ..\utils\xsubpp         \
                ..\utils\prove          \
@@ -662,7 +690,7 @@ PERLDLL             = ..\perl59.dll
 
 XCOPY          = xcopy /f /r /i /d
 RCOPY          = xcopy /f /r /i /e /d
-NOOP           = @echo
+NOOP           = @echo.
 
 #
 # filenames given to xsubpp must have forward slashes (since it puts
@@ -803,7 +831,7 @@ DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
                Sys/Hostname Storable Filter/Util/Call Encode \
                Digest/MD5 PerlIO/scalar MIME/Base64 Time/HiRes \
                Unicode/Normalize Win32
-STATIC_EXT     = DynaLoader
+STATIC_EXT     = 
 NONXS_EXT      = Errno
 
 DYNALOADER     = $(EXTDIR)\DynaLoader\DynaLoader
@@ -819,8 +847,8 @@ POD2TEXT    = $(PODDIR)\pod2text
 #      -- BKS 10-17-1999
 CFG_VARS       =                                       \
                INST_DRV=$(INST_DRV)            ~       \
-               INST_TOP=$(INST_TOP:s/\/\\/)    ~       \
-               INST_VER=$(INST_VER:s/\/\\/)    ~       \
+               INST_TOP=$(INST_TOP:s,\,$B,)    ~       \
+               INST_VER=$(INST_VER:s,\,$B,)    ~       \
                INST_ARCH=$(INST_ARCH)          ~       \
                archname=$(ARCHNAME)            ~       \
                cc=$(CC)                        ~       \
@@ -830,9 +858,9 @@ CFG_VARS    =                                       \
                d_crypt=$(D_CRYPT)              ~       \
                d_mymalloc=$(PERL_MALLOC)       ~       \
                libs=$(LIBFILES:f)              ~       \
-               incpath=$(CCINCDIR:s/\/\\/)     ~       \
+               incpath=$(CCINCDIR:s,\,$B,)     ~       \
                libperl=$(PERLIMPLIB:f)         ~       \
-               libpth=$(CCLIBDIR:s/\/\\/);$(EXTRALIBDIRS:s/\/\\/)      ~       \
+               libpth=$(CCLIBDIR:s,\,$B,);$(EXTRALIBDIRS:s,\,$B,)      ~       \
                libc=$(LIBC)                    ~       \
                make=dmake                      ~       \
                _o=$(o)                         ~       \
@@ -845,7 +873,7 @@ CFG_VARS    =                                       \
                usemultiplicity=$(USE_MULTI)    ~       \
                useperlio=$(USE_PERLIO)         ~       \
                uselargefiles=$(USE_LARGE_FILES)        ~       \
-               LINK_FLAGS=$(LINK_FLAGS:s/\/\\/)        ~       \
+               LINK_FLAGS=$(LINK_FLAGS:s,\,$B,)        ~       \
                optimize=$(OPTIMIZE)
 
 #
@@ -996,9 +1024,9 @@ $(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
 
 perllib$(o)    : perllib.c .\perlhost.h .\vdir.h .\vmem.h
 .IF "$(USE_IMP_SYS)" == "define"
-       $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
+       $(CC) -c -I. -DWITH_STATIC $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
 .ELSE
-       $(CC) -c -I. $(CFLAGS_O) $(OBJOUT_FLAG)$@ perllib.c
+       $(CC) -c -I. -DWITH_STATIC $(CFLAGS_O) $(OBJOUT_FLAG)$@ perllib.c
 .ENDIF
 
 # 1. we don't want to rebuild miniperl.exe when config.h changes
@@ -1014,10 +1042,11 @@ $(DLL_OBJ)      : $(CORE_H)
 $(X2P_OBJ)     : $(CORE_H)
 
 perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl
+       $(MINIPERL) -I..\lib buildext.pl --create-perllibst-h
        $(MINIPERL) -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) \
        $(BUILDOPT) CCTYPE=$(CCTYPE) > perldll.def
 
-$(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES)
+$(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES) Extensions_static
 .IF "$(CCTYPE)" == "BORLAND"
        $(LINK32) -Tpd -ap $(BLINK_FLAGS) \
            @$(mktmp c0d32$(o) $(PERLDLL_OBJ:s,\,\\)\n \
@@ -1027,22 +1056,27 @@ $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES)
        $(IMPLIB) $*.lib $@
 .ELIF "$(CCTYPE)" == "GCC"
        $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(BLINK_FLAGS) \
-           $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
+           $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) \
+               $(shell $(MINIPERL) -I..\lib buildext.pl --list-static-libs|tr \\\\ /) \
+               $(LIBFILES) $(LKPOST))
        dlltool --output-lib $(PERLIMPLIB) \
                --dllname $(PERLDLL:b).dll \
                --def perldll.def \
                --base-file perl.base \
                --output-exp perl.exp
        $(LINK32) -mdll -o $@ $(BLINK_FLAGS) \
-           $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) \
-               perl.exp $(LKPOST))
+           $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) \
+               $(shell $(MINIPERL) -I..\lib buildext.pl --list-static-libs|tr \\\\ /) \
+               $(LIBFILES) perl.exp $(LKPOST))
 .ELSE
        $(LINK32) -dll -def:perldll.def -out:$@ \
+           $(shell $(MINIPERL) -I..\lib buildext.pl --list-static-libs) \
            @$(mktmp -base:0x28000000 $(BLINK_FLAGS) $(DELAYLOAD) $(LIBFILES) \
                $(PERLDLL_RES) $(PERLDLL_OBJ:s,\,\\))
 .ENDIF
        $(XCOPY) $(PERLIMPLIB) $(COREDIR)
 
+
 $(PERLEXE_ICO): $(MINIPERL) makeico.pl
        $(MINIPERL) makeico.pl > $@
 
@@ -1118,8 +1152,12 @@ $(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
 
 #----------------------------------------------------------------------------------
 Extensions : buildext.pl $(PERLDEP) $(CONFIGPM)
-       $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR)
-       $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext
+       $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --dynamic
+       $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic
+
+Extensions_static : buildext.pl
+       $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --static
+       $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --static
 
 # Note: The next two targets explicitly remove a "blibdirs.exists" file that
 # currerntly gets left behind, until CPAN RT Ticket #5616 is resolved.
@@ -1191,6 +1229,8 @@ utils: $(PERLEXE) $(X2P)
 # Note that the pod cleanup in this next section is parsed (and regenerated
 # by pod/buildtoc so please check that script before making changes here
 
+# the doubled rmdir calls are needed because older cmd shells
+# don't understand /q
 distclean: realclean
        -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \
                $(PERLIMPLIB) ..\miniperl$(a) $(MINIMOD)
@@ -1238,6 +1278,10 @@ distclean: realclean
        -if exist $(LIBDIR)\List rmdir /s $(LIBDIR)\List
        -if exist $(LIBDIR)\Scalar rmdir /s /q $(LIBDIR)\Scalar
        -if exist $(LIBDIR)\Scalar rmdir /s $(LIBDIR)\Scalar
+       -if exist $(LIBDIR)\Sys rmdir /s /q $(LIBDIR)\Sys
+       -if exist $(LIBDIR)\Sys rmdir /s $(LIBDIR)\Sys
+       -if exist $(LIBDIR)\threads rmdir /s /q $(LIBDIR)\threads
+       -if exist $(LIBDIR)\threads rmdir /s $(LIBDIR)\threads
        -if exist $(LIBDIR)\XS rmdir /s /q $(LIBDIR)\XS
        -if exist $(LIBDIR)\XS rmdir /s $(LIBDIR)\XS
        -cd $(PODDIR) && del /f *.html *.bat checkpods \
@@ -1255,11 +1299,12 @@ distclean: realclean
            podchecker podselect
        -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph pstruct h2xs \
            perldoc perlivp dprofpp perlcc libnetcfg enc2xs piconv cpan *.bat \
-           xsubpp instmodsh prove
+           xsubpp instmodsh prove corelist
        -cd ..\x2p && del /f find2perl s2p psed *.bat
        -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
        -del /f $(CONFIGPM)
        -del /f bin\*.bat
+       -del /f perllibst.h
        -del /f $(PERLEXE_ICO) perl.base
        -cd .. && del /s *$(a) *.map *.pdb *.ilk *.bs *$(o) .exists pm_to_blib
        -cd $(EXTDIR) && del /s *.def Makefile Makefile.old
@@ -1286,10 +1331,9 @@ inst_lib : $(CONFIGPM)
        $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
        $(RCOPY) ..\lib $(INST_LIB)\*.*
 
-$(UNIDATAFILES) : $(MINIPERL) $(CONFIGPM) ..\lib\unicore\mktables
-       cd ..\lib\unicore
-       ..\..\$(MINIPERL) -I..\..\lib mktables
-       cd ..\..\win32
+$(UNIDATAFILES) .UPDATEALL : $(MINIPERL) $(CONFIGPM) ..\lib\unicore\mktables
+       cd ..\lib\unicore && \
+       ..\$(MINIPERL) -I.. mktables
 
 minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) $(UNIDATAFILES) utils
        $(XCOPY) $(MINIPERL) ..\t\$(NULL)
@@ -1314,11 +1358,11 @@ test-prep : all utils
 .ENDIF
 
 test : $(RIGHTMAKE) test-prep
-       cd ..\t && $(PERLEXE) -I..\lib harness
+       cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
 
 test-notty : test-prep
        set PERL_SKIP_TTY_TEST=1 && \
-           cd ..\t && $(PERLEXE) -I.\lib harness
+           cd ..\t && $(PERLEXE) -I.\lib harness $(TEST_SWITCHES) $(TEST_FILES)
 
 _test : $(RIGHTMAKE)
        $(XCOPY) $(PERLEXE) ..\t\$(NULL)
@@ -1328,8 +1372,10 @@ _test : $(RIGHTMAKE)
 .ELSE
        $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
 .ENDIF
-       cd ..\t && $(PERLEXE) -I..\lib harness
+       cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
 
+# the doubled rmdir calls are needed because older cmd shells
+# don't understand /q
 _clean :
        -@erase miniperlmain$(o)
        -@erase $(MINIPERL)
@@ -1344,7 +1390,10 @@ _clean :
        -@erase $(CORE_OBJ)
        -if exist $(MINIDIR) rmdir /s /q $(MINIDIR)
        -if exist $(MINIDIR) rmdir /s $(MINIDIR)
-       -if exist $(UNIDATADIRS) rmdir /s $(UNIDATADIRS)
+       -if exist $(UNIDATADIR1) rmdir /s /q $(UNIDATADIR1)
+       -if exist $(UNIDATADIR1) rmdir /s $(UNIDATADIR1)
+       -if exist $(UNIDATADIR2) rmdir /s /q $(UNIDATADIR2)
+       -if exist $(UNIDATADIR2) rmdir /s $(UNIDATADIR2)
        -@erase $(UNIDATAFILES)
        -@erase $(WIN32_OBJ)
        -@erase $(DLL_OBJ)