2 # Makefile to build perl on Windows NT using Microsoft NMAKE.
4 # Visual C++ 2.0 through 6.0 (and possibly newer versions)
5 # MS Platform SDK 64-bit compiler and tools **experimental**
7 # This is set up to build a perl.exe that runs off a shared library
8 # (perl58.dll). Also makes individual DLLs for the XS extensions.
12 ## Make sure you read README.win32 *before* you mess with anything here!
16 ## Build configuration. Edit the values below to suit your needs.
20 # Set these to wherever you want "nmake install" to put your
24 INST_TOP = $(INST_DRV)\perl
27 # Comment this out if you DON'T want your perl installation to be versioned.
28 # This means that the new installation will overwrite any files from the
29 # old installation at the same INST_TOP location. Leaving it enabled is
30 # the safest route, as perl adds the extra version directory to all the
31 # locations it installs files to. If you disable it, an alternative
32 # versioned installation can be obtained by setting INST_TOP above to a
33 # path that includes an arbitrary version string.
38 # Comment this out if you DON'T want your perl installation to have
39 # architecture specific components. This means that architecture-
40 # specific files will be installed along with the architecture-neutral
41 # files. Leaving it enabled is safer and more flexible, in case you
42 # want to build multiple flavors of perl and install them together in
43 # the same location. Commenting it out gives you a simpler
44 # installation that is easier to understand for beginners.
46 #INST_ARCH = \$(ARCHNAME)
49 # uncomment to enable multiple interpreters. This is need for fork()
50 # emulation and for thread support.
55 # Beginnings of interpreter cloning/threads; now reasonably complete.
56 # This should be enabled to get the fork() emulation. This needs
62 # uncomment to enable the implicit "host" layer for all system calls
63 # made by perl. This needs USE_MULTI above. This is also needed to
69 # Comment out next assign to disable perl's I/O subsystem and use compiler's
70 # stdio for IO - depending on your compiler vendor and run time library you may
71 # then get a number of fails from make test i.e. bugs - complain to them not us ;-).
72 # You will also be unable to take full advantage of perl5.8's support for multiple
73 # encodings and may see lower IO performance. You have been warned.
77 # Comment this out if you don't want to enable large file support for
78 # some reason. Should normally only be changed to maintain compatibility
79 # with an older release of perl.
80 USE_LARGE_FILES = define
83 # WARNING! This option is deprecated and will eventually go away (enable
84 # USE_ITHREADS instead).
86 # uncomment to enable threads-capabilities. This is incompatible with
87 # USE_ITHREADS, and is only here for people who may have come to rely
88 # on the experimental Thread support that was in 5.005.
90 #USE_5005THREADS = define
93 # uncomment one of the following lines if you are using either
94 # Visual C++ 2.x or Visual C++ 6.x (aka Visual Studio 98)
100 # uncomment next line if you want debug version of perl (big,slow)
101 # If not enabled, we automatically try to use maximum optimization
102 # with all compilers that are known to have a working optimizer.
107 # uncomment to enable use of PerlCRT.DLL when using the Visual C compiler.
108 # It has patches that fix known bugs in older versions of MSVCRT.DLL.
109 # This currently requires VC 5.0 with Service Pack 3 or later.
110 # Get it from CPAN at http://www.cpan.org/authors/id/D/DO/DOUGL/
111 # and follow the directions in the package to install.
113 # Not recommended if you have VC 6.x and you're not running Windows 9x.
115 #USE_PERLCRT = define
118 # uncomment to enable linking with setargv.obj under the Visual C
119 # compiler. Setting this options enables perl to expand wildcards in
120 # arguments, but it may be harder to use alternate methods like
121 # File::DosGlob that are more powerful. This option is supported only with
124 #USE_SETARGV = define
127 # if you want to have the crypt() builtin function implemented, leave this or
128 # CRYPT_LIB uncommented. The fcrypt.c file named here contains a suitable
129 # version of des_fcrypt().
134 # if you didn't set CRYPT_SRC and if you have des_fcrypt() available in a
135 # library, uncomment this, and make sure the library exists (see README.win32)
136 # Specify the full pathname of the library.
138 #CRYPT_LIB = fcrypt.lib
141 # set this if you wish to use perl's malloc
142 # WARNING: Turning this on/off WILL break binary compatibility with extensions
143 # you may have compiled with/without it. Be prepared to recompile all
144 # extensions if you change the default. Currently, this cannot be enabled
145 # if you ask for USE_IMP_SYS above.
147 #PERL_MALLOC = define
150 # set this to enable debugging mstats
151 # This must be enabled to use the Devel::Peek::mstat() function. This cannot
152 # be enabled without PERL_MALLOC as well.
154 #DEBUG_MSTATS = define
158 # set the install locations of the compiler include/libraries
159 # Running VCVARS32.BAT is *required* when using Visual C.
160 # Some versions of Visual C don't define MSVCDIR in the environment,
161 # so you may have to set CCHOME explicitly (spaces in the path name should
166 CCINCDIR = $(CCHOME)\include
167 CCLIBDIR = $(CCHOME)\lib
170 # Additional compiler flags can be specified here.
174 # This should normally be disabled. Adding -DPERL_POLLUTE enables support
175 # for old symbols by default, at the expense of extreme pollution. You most
176 # probably just want to build modules that won't compile with
177 # perl Makefile.PL POLLUTE=1
178 # instead of enabling this. Please report such modules to the respective
181 #BUILDOPT = $(BUILDOPT) -DPERL_POLLUTE
184 # This should normally be disabled. Enabling it will disable the File::Glob
185 # implementation of CORE::glob.
187 #BUILDOPT = $(BUILDOPT) -DPERL_EXTERNAL_GLOB
190 # This should normally be disabled. Enabling it causes perl to read scripts
191 # in text mode (which is the 5.005 behavior) and will break ByteLoader.
192 #BUILDOPT = $(BUILDOPT) -DPERL_TEXTMODE_SCRIPTS
195 # specify semicolon-separated list of extra directories that modules will
196 # look for libraries (spaces in path names need not be quoted)
201 # set this to your email address (perl will guess a value from
202 # from your loginname and your hostname, which may not be right)
207 ## Build configuration ends.
210 ##################### CHANGE THESE ONLY IF YOU MUST #####################
212 !IF "$(CRYPT_SRC)$(CRYPT_LIB)" == ""
216 CRYPT_FLAG = -DHAVE_DES_FCRYPT
219 !IF "$(PERL_MALLOC)" == ""
224 !IF "$(DEBUG_MSTATS)" == ""
228 !IF "$(DEBUG_MSTATS)" == "define"
229 BUILDOPT = $(BUILDOPT) -DPERL_DEBUGGING_MSTATS
232 !IF "$(USE_5005THREADS)" == ""
233 USE_5005THREADS = undef
236 !IF "$(USE_5005THREADS)" == "define"
240 !IF "$(USE_IMP_SYS)" == "define"
244 !IF "$(USE_MULTI)" == ""
248 !IF "$(USE_ITHREADS)" == ""
252 !IF "$(USE_IMP_SYS)" == ""
256 !IF "$(USE_PERLIO)" == ""
260 !IF "$(USE_LARGE_FILES)" == ""
261 USE_LARGE_FILES = undef
264 !IF "$(USE_PERLCRT)" == ""
268 !IF "$(USE_IMP_SYS)$(USE_MULTI)$(USE_5005THREADS)" == "defineundefundef"
272 !IF "$(USE_ITHREADS)$(USE_MULTI)" == "defineundef"
274 USE_5005THREADS = undef
277 !IF "$(USE_MULTI)$(USE_5005THREADS)" != "undefundef"
278 BUILDOPT = $(BUILDOPT) -DPERL_IMPLICIT_CONTEXT
281 !IF "$(USE_IMP_SYS)" != "undef"
282 BUILDOPT = $(BUILDOPT) -DPERL_IMPLICIT_SYS
285 !IF "$(PROCESSOR_ARCHITECTURE)" == ""
286 PROCESSOR_ARCHITECTURE = x86
290 !IF "$(PROCESSOR_ARCHITEW6432)" != ""
291 PROCESSOR_ARCHITECTURE = $(PROCESSOR_ARCHITEW6432)
294 !IF "$(PROCESSOR_ARCHITECTURE)" == "IA64"
302 !IF "$(USE_5005THREADS)" == "define"
303 ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-thread
305 !IF "$(USE_MULTI)" == "define"
306 ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-multi
308 !IF "$(USE_PERLIO)" == "define"
309 ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-perlio
311 ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)
316 !IF "$(USE_PERLIO)" == "define"
317 BUILDOPT = $(BUILDOPT) -DUSE_PERLIO
320 !IF "$(USE_ITHREADS)" == "define"
321 ARCHNAME = $(ARCHNAME)-thread
324 # Visual Studio 98 specific
325 !IF "$(CCTYPE)" == "MSVC60"
327 # VC 6.0 can load the socket dll on demand. Makes the test suite
328 # run in about 10% less time.
329 DELAYLOAD = -DELAYLOAD:wsock32.dll -DELAYLOAD:shell32.dll delayimp.lib
332 ARCHDIR = ..\lib\$(ARCHNAME)
333 COREDIR = ..\lib\CORE
334 AUTODIR = ..\lib\auto
338 EXTUTILSDIR = $(LIBDIR)\ExtUtils
341 INST_SCRIPT = $(INST_TOP)$(INST_VER)\bin
342 INST_BIN = $(INST_SCRIPT)$(INST_ARCH)
343 INST_LIB = $(INST_TOP)$(INST_VER)\lib
344 INST_ARCHLIB = $(INST_LIB)$(INST_ARCH)
345 INST_COREDIR = $(INST_ARCHLIB)\CORE
346 INST_POD = $(INST_LIB)\pod
347 INST_HTML = $(INST_TOP)$(INST_VER)\html
350 # Programs to compile, build .lib files and link
355 LIB32 = $(LINK32) -lib
362 INCLUDES = -I$(COREDIR) -I.\include -I. -I..
363 #PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX
364 DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT $(CRYPT_FLAG)
365 LOCDEFS = -DPERLDLL -DPERL_CORE
369 !IF "$(USE_PERLCRT)" != "define"
375 !IF "$(CFG)" == "Debug"
376 ! IF "$(CCTYPE)" == "MSVC20"
377 OPTIMIZE = -Od -MD -Z7 -DDEBUGGING
379 OPTIMIZE = -Od -MD -Zi -DDEBUGGING
383 OPTIMIZE = -MD -Zi -DNDEBUG
384 # we enable debug symbols in release builds also
385 LINK_DBG = -debug -opt:ref,icf
386 # you may want to enable this if you want COFF symbols in the executables
387 # in addition to the PDB symbols. The default Dr. Watson that ships with
388 # Windows can use the the former but not latter. The free WinDbg can be
389 # installed to get better stack traces from just the PDB symbols, so we
390 # avoid the bloat of COFF symbols by default.
391 #LINK_DBG = $(LINK_DBG) -debugtype:both
392 ! IF "$(WIN64)" == "define"
393 # enable Whole Program Optimizations (WPO) and Link Time Code Generation (LTCG)
394 OPTIMIZE = $(OPTIMIZE) -Ox -GL
395 LINK_DBG = $(LINK_DBG) -ltcg
397 # -O1 yields smaller code, which turns out to be faster than -O2 on x86
398 OPTIMIZE = $(OPTIMIZE) -O1
399 #OPTIMIZE = $(OPTIMIZE) -O2
403 !IF "$(WIN64)" == "define"
404 DEFINES = $(DEFINES) -DWIN64 -DCONSERVATIVE
405 OPTIMIZE = $(OPTIMIZE) -Wp64 -Op
408 !IF "$(USE_PERLCRT)" != "define"
409 BUILDOPT = $(BUILDOPT) -DPERL_MSVCRT_READFIX
412 LIBBASEFILES = $(CRYPT_LIB) \
413 oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
414 comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
415 netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
418 # win64 doesn't have some libs
419 !IF "$(WIN64)" != "define"
420 LIBBASEFILES = $(LIBBASEFILES) odbc32.lib odbccp32.lib
423 # we add LIBC here, since we may be using PerlCRT.dll
424 LIBFILES = $(LIBBASEFILES) $(LIBC)
426 CFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) \
427 $(PCHFLAGS) $(OPTIMIZE)
428 LINK_FLAGS = -nologo -nodefaultlib $(LINK_DBG) \
429 -libpath:"$(INST_COREDIR)" \
430 -machine:$(PROCESSOR_ARCHITECTURE)
434 CFLAGS_O = $(CFLAGS) $(BUILDOPT)
436 #################### do not edit below this line #######################
437 ############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
445 .SUFFIXES : .c $(o) .dll .lib .exe .rc .res
448 $(CC) -c -I$(<D) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $<
454 $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
455 -out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
463 # makedef.pl must be updated if this changes, and this should normally
464 # only change when there is an incompatible revision of the public API.
465 PERLIMPLIB = ..\perl58.lib
466 PERLDLL = ..\perl58.dll
468 MINIPERL = ..\miniperl.exe
470 PERLEXE = ..\perl.exe
471 WPERLEXE = ..\wperl.exe
472 GLOBEXE = ..\perlglob.exe
473 CONFIGPM = ..\lib\Config.pm
474 MINIMOD = ..\lib\ExtUtils\Miniperl.pm
477 # Unicode data files generated by mktables
478 UNIDATAFILES = ..\lib\unicore\Canonical.pl ..\lib\unicore\Exact.pl \
479 ..\lib\unicore\Properties ..\lib\unicore\Decomposition.pl \
480 ..\lib\unicore\CombiningClass.pl ..\lib\unicore\Name.pl \
481 ..\lib\unicore\PVA.pl
483 # Directories of Unicode data files generated by mktables
484 UNIDATADIR1 = ..\lib\unicore\To
485 UNIDATADIR2 = ..\lib\unicore\lib
487 PERLEXE_ICO = .\perlexe.ico
488 PERLEXE_RES = .\perlexe.res
491 # Nominate a target which causes extensions to be re-built
492 # This used to be $(PERLEXE), but at worst it is the .dll that they depend
493 # on and really only the interface - i.e. the .def file used to export symbols
495 PERLDEP = perldll.def
497 PL2BAT = bin\pl2bat.pl
498 GLOBBAT = bin\perlglob.bat
539 !IF "$(WIN64)" == "define"
540 CFGSH_TMPL = config.vc64
541 CFGH_TMPL = config_H.vc64
543 CFGSH_TMPL = config.vc
544 CFGH_TMPL = config_H.vc
547 XCOPY = xcopy /f /r /i /d
548 RCOPY = xcopy /f /r /i /e /d
555 # filenames given to xsubpp must have forward slashes (since it puts
556 # full pathnames in #line strings)
557 XSUBPP = ..\$(MINIPERL) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp \
596 EXTRACORE_SRC = $(EXTRACORE_SRC) perllib.c
598 !IF "$(PERL_MALLOC)" == "define"
599 EXTRACORE_SRC = $(EXTRACORE_SRC) ..\malloc.c
602 EXTRACORE_SRC = $(EXTRACORE_SRC) ..\perlio.c
609 # We need this for miniperl build unless we override canned
610 # config.h #define building mini\*
611 #!IF "$(USE_PERLIO)" == "define"
612 WIN32_SRC = $(WIN32_SRC) .\win32io.c
615 !IF "$(CRYPT_SRC)" != ""
616 WIN32_SRC = $(WIN32_SRC) .\$(CRYPT_SRC)
619 DLL_SRC = $(DYNALOADER).c
665 .\include\sys\socket.h \
668 CORE_H = $(CORE_NOCFG_H) .\config.h
670 MICROCORE_OBJ = $(MICROCORE_SRC:.c=.obj)
671 CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:.c=.obj)
672 WIN32_OBJ = $(WIN32_SRC:.c=.obj)
673 MINICORE_OBJ = $(MICROCORE_OBJ:..\=.\mini\) \
674 $(MINIDIR)\miniperlmain$(o) \
675 $(MINIDIR)\perlio$(o)
676 MINIWIN32_OBJ = $(WIN32_OBJ:.\=.\mini\)
677 MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
678 DLL_OBJ = $(DLL_SRC:.c=.obj)
679 X2P_OBJ = $(X2P_SRC:.c=.obj)
681 PERLDLL_OBJ = $(CORE_OBJ)
682 PERLEXE_OBJ = perlmain$(o)
684 PERLDLL_OBJ = $(PERLDLL_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
685 #PERLEXE_OBJ = $(PERLEXE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
687 !IF "$(USE_SETARGV)" != ""
688 SETARGV_OBJ = setargv$(o)
691 DYNALOADER = $(EXTDIR)\DynaLoader\DynaLoader
692 SOCKET = $(EXTDIR)\Socket\Socket
693 FCNTL = $(EXTDIR)\Fcntl\Fcntl
694 OPCODE = $(EXTDIR)\Opcode\Opcode
695 SDBM_FILE = $(EXTDIR)\SDBM_File\SDBM_File
697 POSIX = $(EXTDIR)\POSIX\POSIX
698 ATTRS = $(EXTDIR)\attrs\attrs
699 THREAD = $(EXTDIR)\Thread\Thread
702 DUMPER = $(EXTDIR)\Data\Dumper\Dumper
703 ERRNO = $(EXTDIR)\Errno\Errno
704 PEEK = $(EXTDIR)\Devel\Peek\Peek
705 BYTELOADER = $(EXTDIR)\ByteLoader\ByteLoader
706 DPROF = $(EXTDIR)\Devel\DProf\DProf
707 GLOB = $(EXTDIR)\File\Glob\Glob
708 HOSTNAME = $(EXTDIR)\Sys\Hostname\Hostname
709 STORABLE = $(EXTDIR)\Storable\Storable
710 FILTER = $(EXTDIR)\Filter\Util\Call\Call
711 ENCODE = $(EXTDIR)\Encode\Encode
712 MD5 = $(EXTDIR)\Digest\MD5\MD5
713 PERLIOSCALAR = $(EXTDIR)\PerlIO\scalar\scalar
714 MIMEBASE64 = $(EXTDIR)\MIME\Base64\Base64
715 TIMEHIRES = $(EXTDIR)\Time\HiRes\HiRes
716 CWD = $(EXTDIR)\Cwd\Cwd
717 LISTUTIL = $(EXTDIR)\List\Util\Util
718 PERLIOVIA = $(EXTDIR)\PerlIO\via\via
719 XSAPITEST = $(EXTDIR)\XS\APItest\APItest
720 XSTYPEMAP = $(EXTDIR)\XS\Typemap\Typemap
721 UNICODENORMALIZE = $(EXTDIR)\Unicode\Normalize\Normalize
722 WIN32_DIR = ext\Win32
724 SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll
725 FCNTL_DLL = $(AUTODIR)\Fcntl\Fcntl.dll
726 OPCODE_DLL = $(AUTODIR)\Opcode\Opcode.dll
727 SDBM_FILE_DLL = $(AUTODIR)\SDBM_File\SDBM_File.dll
728 IO_DLL = $(AUTODIR)\IO\IO.dll
729 POSIX_DLL = $(AUTODIR)\POSIX\POSIX.dll
730 ATTRS_DLL = $(AUTODIR)\attrs\attrs.dll
731 THREAD_DLL = $(AUTODIR)\Thread\Thread.dll
732 B_DLL = $(AUTODIR)\B\B.dll
733 DUMPER_DLL = $(AUTODIR)\Data\Dumper\Dumper.dll
734 PEEK_DLL = $(AUTODIR)\Devel\Peek\Peek.dll
735 RE_DLL = $(AUTODIR)\re\re.dll
736 BYTELOADER_DLL = $(AUTODIR)\ByteLoader\ByteLoader.dll
737 DPROF_DLL = $(AUTODIR)\Devel\DProf\DProf.dll
738 GLOB_DLL = $(AUTODIR)\File\Glob\Glob.dll
739 HOSTNAME_DLL = $(AUTODIR)\Sys\Hostname\Hostname.dll
740 STORABLE_DLL = $(AUTODIR)\Storable\Storable.dll
741 FILTER_DLL = $(AUTODIR)\Filter\Util\Call\Call.dll
742 ENCODE_DLL = $(AUTODIR)\Encode\Encode.dll
743 MD5_DLL = $(AUTODIR)\Digest\MD5\MD5.dll
744 PERLIOSCALAR_DLL = $(AUTODIR)\PerlIO\scalar\scalar.dll
745 MIMEBASE64_DLL = $(AUTODIR)\MIME\Base64\Base64.dll
746 TIMEHIRES_DLL = $(AUTODIR)\Time\HiRes\HiRes.dll
747 CWD_DLL = $(AUTODIR)\Cwd\Cwd.dll
748 LISTUTIL_DLL = $(AUTODIR)\List\Util\Util.dll
749 PERLIOVIA_DLL = $(AUTODIR)\PerlIO\via\via.dll
750 XSAPITEST_DLL = $(AUTODIR)\XS\APItest\APItest.dll
751 XSTYPEMAP_DLL = $(AUTODIR)\XS\Typemap\Typemap.dll
752 UNICODENORMALIZE_DLL = $(AUTODIR)\Unicode\Normalize\Normalize.dll
753 WIN32_DLL = $(AUTODIR)\Win32\Win32.dll
784 $(UNICODENORMALIZE).c \
808 $(PERLIOSCALAR_DLL) \
816 $(UNICODENORMALIZE_DLL) \
819 POD2HTML = $(PODDIR)\pod2html
820 POD2MAN = $(PODDIR)\pod2man
821 POD2LATEX = $(PODDIR)\pod2latex
822 POD2TEXT = $(PODDIR)\pod2text
825 "INST_DRV=$(INST_DRV)" \
826 "INST_TOP=$(INST_TOP)" \
827 "INST_VER=$(INST_VER)" \
828 "INST_ARCH=$(INST_ARCH)" \
829 "archname=$(ARCHNAME)" \
832 "ccflags=-nologo -Gf -W3 $(OPTIMIZE:"=\") $(DEFINES) $(BUILDOPT)" \
833 "cf_email=$(EMAIL)" \
834 "d_crypt=$(D_CRYPT)" \
835 "d_mymalloc=$(PERL_MALLOC)" \
837 "incpath=$(CCINCDIR:"=\")" \
838 "libperl=$(PERLIMPLIB:..\=)" \
839 "libpth=$(CCLIBDIR:"=\");$(EXTRALIBDIRS:"=\")" \
841 "make=$(MAKE_BARE)" \
842 "usethreads=$(USE_ITHREADS)" \
843 "use5005threads=$(USE_5005THREADS)" \
844 "useithreads=$(USE_ITHREADS)" \
845 "usethreads=$(USE_5005THREADS)" \
846 "usemultiplicity=$(USE_MULTI)" \
847 "useperlio=$(USE_PERLIO)" \
848 "uselargefiles=$(USE_LARGE_FILES)" \
849 "LINK_FLAGS=$(LINK_FLAGS:"=\")" \
850 "optimize=$(OPTIMIZE:"=\")"
856 all : .\config.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(UNIDATAFILES) $(PERLEXE) \
858 @echo Everything is up to date. '$(MAKE_BARE) test' to run test suite.
860 $(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
862 #------------------------------------------------------------
864 $(GLOBEXE) : perlglob$(o)
865 $(LINK32) $(LINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
866 perlglob$(o) setargv$(o)
868 perlglob$(o) : perlglob.c
870 config.w32 : $(CFGSH_TMPL)
871 copy $(CFGSH_TMPL) config.w32
873 .\config.h : $(CFGH_TMPL)
875 copy $(CFGH_TMPL) config.h
877 ..\config.sh : config.w32 $(MINIPERL) config_sh.PL
878 $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) config.w32 > ..\config.sh
880 # this target is for when changes to the main config.sh happen
881 # edit config.{b,v,g}c and make this target once for each supported
882 # compiler (e.g. `nmake CCTYPE=BORLAND regen_config_h`)
884 perl config_sh.PL $(CFG_VARS) $(CFGSH_TMPL) > ..\config.sh
886 -del /f perl.exe perl*.dll
891 -perl config_h.PL "INST_VER=$(INST_VER)"
892 rename config.h $(CFGH_TMPL)
894 $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
898 if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
899 $(XCOPY) ..\*.h $(COREDIR)\*.*
900 $(XCOPY) ..\*.inc $(COREDIR)\*.*
901 $(XCOPY) *.h $(COREDIR)\*.*
902 $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.*
903 $(RCOPY) include $(COREDIR)\*.*
904 -$(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)"
905 if errorlevel 1 $(MAKE) /$(MAKEFLAGS) $(CONFIGPM)
907 $(MINIPERL) : $(MINIDIR) $(MINI_OBJ)
908 $(LINK32) -subsystem:console -out:$@ @<<
909 $(LINK_FLAGS) $(LIBFILES) $(MINI_OBJ)
913 if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
915 $(MINICORE_OBJ) : $(CORE_NOCFG_H)
916 $(CC) -c $(CFLAGS) -DPERL_EXTERNAL_GLOB $(OBJOUT_FLAG)$@ ..\$(*F).c
918 $(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
919 $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*F).c
921 # -DPERL_IMPLICIT_SYS needs C++ for perllib.c
922 # This is the only file that depends on perlhost.h, vmem.h, and vdir.h
923 !IF "$(USE_IMP_SYS)" == "define"
924 perllib$(o) : perllib.c .\perlhost.h .\vdir.h .\vmem.h
925 $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
928 # 1. we don't want to rebuild miniperl.exe when config.h changes
929 # 2. we don't want to rebuild miniperl.exe with non-default config.h
930 $(MINI_OBJ) : $(CORE_NOCFG_H)
932 $(WIN32_OBJ) : $(CORE_H)
933 $(CORE_OBJ) : $(CORE_H)
934 $(DLL_OBJ) : $(CORE_H)
935 $(X2P_OBJ) : $(CORE_H)
937 perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl
938 $(MINIPERL) -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \
939 CCTYPE=$(CCTYPE) > perldll.def
941 $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES)
942 $(LINK32) -dll -def:perldll.def -base:0x28000000 -out:$@ @<<
943 $(LINK_FLAGS) $(DELAYLOAD) $(LIBFILES) $(PERLDLL_OBJ) $(PERLDLL_RES)
945 $(XCOPY) $(PERLIMPLIB) $(COREDIR)
947 $(PERLEXE_ICO): $(MINIPERL) makeico.pl
948 $(MINIPERL) makeico.pl > $@
950 $(PERLEXE_RES): perlexe.rc $(PERLEXE_ICO)
952 $(MINIMOD) : $(MINIPERL) ..\minimod.pl
954 miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
957 ..\x2p\a2p$(o) : ..\x2p\a2p.c
958 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\a2p.c
960 ..\x2p\hash$(o) : ..\x2p\hash.c
961 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\hash.c
963 ..\x2p\str$(o) : ..\x2p\str.c
964 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\str.c
966 ..\x2p\util$(o) : ..\x2p\util.c
967 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\util.c
969 ..\x2p\walk$(o) : ..\x2p\walk.c
970 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\walk.c
972 $(X2P) : $(MINIPERL) $(X2P_OBJ)
973 $(MINIPERL) ..\x2p\find2perl.PL
974 $(MINIPERL) ..\x2p\s2p.PL
975 $(LINK32) -subsystem:console -out:$@ @<<
976 $(LINK_FLAGS) $(LIBFILES) $(X2P_OBJ)
979 perlmain.c : runperl.c
980 copy runperl.c perlmain.c
982 perlmain$(o) : perlmain.c
983 $(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c
985 $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES)
986 $(LINK32) -subsystem:console -out:$@ -stack:0x1000000 $(LINK_FLAGS) \
987 $(LIBFILES) $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES)
988 copy $(PERLEXE) $(WPERLEXE)
989 $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS
991 $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
993 $(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
994 if not exist $(AUTODIR) mkdir $(AUTODIR)
996 ..\$(MINIPERL) -I..\..\lib $(*B)_pm.PL
997 ..\$(MINIPERL) -I..\..\lib XSLoader_pm.PL
999 $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
1000 $(XCOPY) $(EXTDIR)\$(*B)\XSLoader.pm $(LIBDIR)\$(NULL)
1002 $(XSUBPP) dl_win32.xs > $(*B).c
1005 $(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
1006 copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
1008 #----------------------------------------------------------------------------------
1009 Extensions: buildext.pl $(PERLDEP) $(CONFIGPM)
1010 $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR)
1011 $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext
1013 # Note: The next two targets explicitly remove a "blibdirs.exists" file that
1014 # currerntly gets left behind, until CPAN RT Ticket #5616 is resolved.
1017 -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) clean
1018 -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext clean
1019 -if exist $(EXTDIR)\SDBM_File\sdbm\blibdirs.exists del /f $(EXTDIR)\SDBM_File\sdbm\blibdirs.exists
1021 Extensions_realclean:
1022 -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) realclean
1023 -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext realclean
1024 -if exist $(EXTDIR)\SDBM_File\sdbm\blibdirs.exists del /f $(EXTDIR)\SDBM_File\sdbm\blibdirs.exists
1026 #----------------------------------------------------------------------------------
1029 $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=./html \
1030 --podpath=pod:lib:ext:utils --htmlroot="file://$(INST_HTML::=|)" \
1031 --libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse
1033 # Note that this next section is parsed (and regenerated) by pod/buildtoc
1034 # so please check that script before making structural changes here
1036 utils: $(PERLEXE) $(X2P)
1038 $(MAKE) PERL=$(MINIPERL)
1040 copy ..\vms\perlvms.pod .\perlvms.pod
1041 copy ..\README.aix ..\pod\perlaix.pod
1042 copy ..\README.amiga ..\pod\perlamiga.pod
1043 copy ..\README.apollo ..\pod\perlapollo.pod
1044 copy ..\README.beos ..\pod\perlbeos.pod
1045 copy ..\README.bs2000 ..\pod\perlbs2000.pod
1046 copy ..\README.ce ..\pod\perlce.pod
1047 copy ..\README.cn ..\pod\perlcn.pod
1048 copy ..\README.cygwin ..\pod\perlcygwin.pod
1049 copy ..\README.dgux ..\pod\perldgux.pod
1050 copy ..\README.dos ..\pod\perldos.pod
1051 copy ..\README.epoc ..\pod\perlepoc.pod
1052 copy ..\README.freebsd ..\pod\perlfreebsd.pod
1053 copy ..\README.hpux ..\pod\perlhpux.pod
1054 copy ..\README.hurd ..\pod\perlhurd.pod
1055 copy ..\README.irix ..\pod\perlirix.pod
1056 copy ..\README.jp ..\pod\perljp.pod
1057 copy ..\README.ko ..\pod\perlko.pod
1058 copy ..\README.machten ..\pod\perlmachten.pod
1059 copy ..\README.macos ..\pod\perlmacos.pod
1060 copy ..\README.macosx ..\pod\perlmacosx.pod
1061 copy ..\README.mint ..\pod\perlmint.pod
1062 copy ..\README.mpeix ..\pod\perlmpeix.pod
1063 copy ..\README.netware ..\pod\perlnetware.pod
1064 copy ..\README.os2 ..\pod\perlos2.pod
1065 copy ..\README.os390 ..\pod\perlos390.pod
1066 copy ..\README.os400 ..\pod\perlos400.pod
1067 copy ..\README.plan9 ..\pod\perlplan9.pod
1068 copy ..\README.qnx ..\pod\perlqnx.pod
1069 copy ..\README.solaris ..\pod\perlsolaris.pod
1070 copy ..\README.tru64 ..\pod\perltru64.pod
1071 copy ..\README.tw ..\pod\perltw.pod
1072 copy ..\README.uts ..\pod\perluts.pod
1073 copy ..\README.vmesa ..\pod\perlvmesa.pod
1074 copy ..\README.vms ..\pod\perlvms.pod
1075 copy ..\README.vos ..\pod\perlvos.pod
1076 copy ..\README.win32 ..\pod\perlwin32.pod
1077 copy ..\pod\perl585delta.pod ..\pod\perldelta.pod
1078 $(MAKE) -f ..\win32\pod.mak converters
1080 $(PERLEXE) lib_pm.PL
1082 $(PERLEXE) $(PL2BAT) $(UTILS)
1084 # Note that the pod cleanup in this next section is parsed (and regenerated
1085 # by pod/buildtoc so please check that script before making changes here
1087 # the doubled rmdir calls are needed because older cmd shells
1088 # don't understand /q
1089 distclean: realclean
1090 -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \
1091 $(PERLIMPLIB) ..\miniperl.lib $(MINIMOD)
1093 -del /f $(EXTENSION_DLL)
1094 -del /f $(EXTENSION_C) $(DYNALOADER).c $(ERRNO).pm
1095 -del /f $(EXTDIR)\DynaLoader\dl_win32.xs
1096 -del /f $(EXTDIR)\DynaLoader\DynaLoader.pm
1097 -del /f $(EXTDIR)\DynaLoader\XSLoader.pm
1098 -del /f $(LIBDIR)\Encode.pm $(LIBDIR)\encoding.pm $(LIBDIR)\Errno.pm
1099 -del /f $(LIBDIR)\Config.pod $(LIBDIR)\POSIX.pod $(LIBDIR)\threads.pm
1100 -del /f $(LIBDIR)\.exists $(LIBDIR)\attrs.pm $(LIBDIR)\DynaLoader.pm
1101 -del /f $(LIBDIR)\XSLoader.pm $(LIBDIR)\lib.pm
1102 -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
1103 -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm
1104 -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
1105 -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
1106 -del /f $(LIBDIR)\ByteLoader.pm
1107 -del /f $(LIBDIR)\Devel\Peek.pm $(LIBDIR)\Devel\DProf.pm
1108 -del /f $(LIBDIR)\Devel\PPPort.pm
1109 -del /f $(LIBDIR)\File\Glob.pm
1110 -del /f $(LIBDIR)\Storable.pm
1111 -del /f $(LIBDIR)\Digest\MD5.pm
1112 -del /f $(LIBDIR)\PerlIO\encoding.pm
1113 -del /f $(LIBDIR)\PerlIO\scalar.pm
1114 -del /f $(LIBDIR)\PerlIO\via.pm
1115 -del /f $(LIBDIR)\Sys\Hostname.pm
1116 -del /f $(LIBDIR)\Thread\Signal.pm $(LIBDIR)\Thread\Specific.pm
1117 -del /f $(LIBDIR)\threads\shared.pm
1118 -del /f $(LIBDIR)\Time\HiRes.pm
1119 -del /f $(LIBDIR)\Unicode\Normalize.pm
1120 -del /f $(LIBDIR)\Win32.pm
1121 -if exist $(LIBDIR)\IO rmdir /s /q $(LIBDIR)\IO
1122 -if exist $(LIBDIR)\IO rmdir /s $(LIBDIR)\IO
1123 -if exist $(LIBDIR)\B rmdir /s /q $(LIBDIR)\B
1124 -if exist $(LIBDIR)\B rmdir /s $(LIBDIR)\B
1125 -if exist $(LIBDIR)\Data rmdir /s /q $(LIBDIR)\Data
1126 -if exist $(LIBDIR)\Data rmdir /s $(LIBDIR)\Data
1127 -if exist $(LIBDIR)\Encode rmdir /s /q $(LIBDIR)\Encode
1128 -if exist $(LIBDIR)\Encode rmdir /s $(LIBDIR)\Encode
1129 -if exist $(LIBDIR)\Filter\Util rmdir /s /q $(LIBDIR)\Filter\Util
1130 -if exist $(LIBDIR)\Filter\Util rmdir /s $(LIBDIR)\Filter\Util
1131 -if exist $(LIBDIR)\MIME rmdir /s /q $(LIBDIR)\MIME
1132 -if exist $(LIBDIR)\MIME rmdir /s $(LIBDIR)\MIME
1133 -if exist $(LIBDIR)\List rmdir /s /q $(LIBDIR)\List
1134 -if exist $(LIBDIR)\List rmdir /s $(LIBDIR)\List
1135 -if exist $(LIBDIR)\Scalar rmdir /s /q $(LIBDIR)\Scalar
1136 -if exist $(LIBDIR)\Scalar rmdir /s $(LIBDIR)\Scalar
1137 -if exist $(LIBDIR)\XS rmdir /s /q $(LIBDIR)\XS
1138 -if exist $(LIBDIR)\XS rmdir /s $(LIBDIR)\XS
1139 -cd $(PODDIR) && del /f *.html *.bat checkpods \
1140 perlaix.pod perlamiga.pod perlapollo.pod perlbeos.pod \
1141 perlbs2000.pod perlce.pod perlcn.pod perlcygwin.pod \
1142 perldelta.pod perldgux.pod perldos.pod perlepoc.pod \
1143 perlfreebsd.pod perlhpux.pod perlhurd.pod perlirix.pod \
1144 perljp.pod perlko.pod perlmachten.pod perlmacos.pod \
1145 perlmacosx.pod perlmint.pod perlmpeix.pod perlnetware.pod \
1146 perlos2.pod perlos390.pod perlos400.pod perlplan9.pod \
1147 perlqnx.pod perlsolaris.pod perltru64.pod perltw.pod \
1148 perluts.pod perlvmesa.pod perlvms.pod perlvms.pod perlvos.pod \
1150 pod2html pod2latex pod2man pod2text pod2usage \
1151 podchecker podselect
1152 -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph pstruct h2xs \
1153 perldoc perlivp dprofpp perlcc libnetcfg enc2xs piconv cpan *.bat \
1154 xsubpp instmodsh prove
1155 -cd ..\x2p && del /f find2perl s2p psed *.bat
1156 -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
1159 -del /f $(PERLEXE_ICO) perl.base
1160 -cd .. && del /s *.lib *.map *.pdb *.ilk *.bs *$(o) .exists pm_to_blib
1161 -cd $(EXTDIR) && del /s *.def Makefile Makefile.old
1162 -if exist $(AUTODIR) rmdir /s /q $(AUTODIR)
1163 -if exist $(AUTODIR) rmdir /s $(AUTODIR)
1164 -if exist $(COREDIR) rmdir /s /q $(COREDIR)
1165 -if exist $(COREDIR) rmdir /s $(COREDIR)
1167 install : all installbare installhtml
1170 $(PERLEXE) ..\installperl
1171 if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\*.*
1172 $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
1173 if exist ..\perl*.pdb $(XCOPY) ..\perl*.pdb $(INST_BIN)\*.*
1174 if exist ..\x2p\a2p.pdb $(XCOPY) ..\x2p\a2p.pdb $(INST_BIN)\*.*
1175 $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.*
1178 $(RCOPY) html\*.* $(INST_HTML)\*.*
1180 inst_lib : $(CONFIGPM)
1181 copy splittree.pl ..
1182 $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
1183 $(RCOPY) ..\lib $(INST_LIB)\*.*
1185 $(UNIDATAFILES) : $(MINIPERL) $(CONFIGPM) ..\lib\unicore\mktables
1186 cd ..\lib\unicore && \
1187 ..\$(MINIPERL) -I.. mktables
1189 minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) utils $(UNIDATAFILES)
1190 $(XCOPY) $(MINIPERL) ..\t\$(NULL)
1191 if exist ..\t\perl.exe del /f ..\t\perl.exe
1192 rename ..\t\miniperl.exe perl.exe
1193 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1196 $(MINIPERL) -I..\lib harness base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t
1198 test-prep : all utils
1199 $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1200 $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1201 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1205 $(PERLEXE) -I..\lib harness
1208 test-notty : test-prep
1209 set PERL_SKIP_TTY_TEST=1
1211 $(PERLEXE) -I..\lib harness
1215 $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1216 $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1217 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1219 $(PERLEXE) -I..\lib harness
1222 # the doubled rmdir calls are needed because older cmd shells
1223 # don't understand /q
1225 -@$(DEL) miniperlmain$(o)
1226 -@$(DEL) $(MINIPERL)
1227 -@$(DEL) perlglob$(o)
1228 -@$(DEL) perlmain$(o)
1233 -@$(DEL) $(WPERLEXE)
1235 -@$(DEL) $(CORE_OBJ)
1236 -if exist $(MINIDIR) rmdir /s /q $(MINIDIR)
1237 -if exist $(MINIDIR) rmdir /s $(MINIDIR)
1238 -if exist $(UNIDATADIR1) rmdir /s /q $(UNIDATADIR1)
1239 -if exist $(UNIDATADIR1) rmdir /s $(UNIDATADIR1)
1240 -if exist $(UNIDATADIR2) rmdir /s /q $(UNIDATADIR2)
1241 -if exist $(UNIDATADIR2) rmdir /s $(UNIDATADIR2)
1242 -@$(DEL) $(UNIDATAFILES)
1243 -@$(DEL) $(WIN32_OBJ)
1246 -@$(DEL) ..\*$(o) ..\*.lib ..\*.exp *$(o) *.lib *.exp *.res
1247 -@$(DEL) ..\t\*.exe ..\t\*.dll ..\t\*.bat
1248 -@$(DEL) ..\x2p\*.exe ..\x2p\*.bat
1252 clean : Extensions_clean _clean
1254 realclean : Extensions_realclean _clean
1256 # Handy way to run perlbug -ok without having to install and run the
1257 # installed perlbug. We don't re-run the tests here - we trust the user.
1258 # Please *don't* use this unless all tests pass.
1259 # If you want to report test failures, use "nmake nok" instead.
1261 $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)"
1264 $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)" -F perl.ok
1267 $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)"
1270 $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)" -F perl.nok