This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
(perl #129000) create a safer utf8_hop()
[perl5.git] / win32 / makefile.mk
1 #
2 # Makefile to build perl on Windows using DMAKE.
3 # Supported compilers:
4 #       Microsoft Visual C++ 6.0 or later
5 #       MinGW with gcc-3.4.5 or later
6 #       Windows SDK 64-bit compiler and tools
7 #
8 # This is set up to build a perl.exe that runs off a shared library
9 # (perl525.dll).  Also makes individual DLLs for the XS extensions.
10 #
11
12 ##
13 ## Make sure you read README.win32 *before* you mess with anything here!
14 ##
15
16 #
17 # Import everything from the environment like NMAKE does.
18 #
19 .IMPORT : .EVERYTHING
20
21 ##
22 ## Build configuration.  Edit the values below to suit your needs.
23 ##
24
25 #
26 # Set these to wherever you want "dmake install" to put your
27 # newly built perl.
28 #
29 INST_DRV        *= c:
30 INST_TOP        *= $(INST_DRV)\perl
31
32 #
33 # Uncomment if you want to build a 32-bit Perl using a 32-bit compiler
34 # on a 64-bit version of Windows.
35 #
36 #WIN64          *= undef
37
38 #
39 # Comment this out if you DON'T want your perl installation to be versioned.
40 # This means that the new installation will overwrite any files from the
41 # old installation at the same INST_TOP location.  Leaving it enabled is
42 # the safest route, as perl adds the extra version directory to all the
43 # locations it installs files to.  If you disable it, an alternative
44 # versioned installation can be obtained by setting INST_TOP above to a
45 # path that includes an arbitrary version string.
46 #
47 #INST_VER       *= \5.25.7
48
49 #
50 # Comment this out if you DON'T want your perl installation to have
51 # architecture specific components.  This means that architecture-
52 # specific files will be installed along with the architecture-neutral
53 # files.  Leaving it enabled is safer and more flexible, in case you
54 # want to build multiple flavors of perl and install them together in
55 # the same location.  Commenting it out gives you a simpler
56 # installation that is easier to understand for beginners.
57 #
58 #INST_ARCH      *= \$(ARCHNAME)
59
60 #
61 # Uncomment this if you want perl to run
62 #       $Config{sitelibexp}\sitecustomize.pl
63 # before anything else.  This script can then be set up, for example,
64 # to add additional entries to @INC.
65 #
66 #USE_SITECUST   *= define
67
68 #
69 # uncomment to enable multiple interpreters.  This is needed for fork()
70 # emulation and for thread support, and is auto-enabled by USE_IMP_SYS
71 # and USE_ITHREADS below.
72 #
73 USE_MULTI       *= define
74
75 #
76 # Interpreter cloning/threads; now reasonably complete.
77 # This should be enabled to get the fork() emulation.  This needs (and
78 # will auto-enable) USE_MULTI above.
79 #
80 USE_ITHREADS    *= define
81
82 #
83 # uncomment to enable the implicit "host" layer for all system calls
84 # made by perl.  This is also needed to get fork().  This needs (and
85 # will auto-enable) USE_MULTI above.
86 #
87 USE_IMP_SYS     *= define
88
89 #
90 # Comment this out if you don't want to enable large file support for
91 # some reason.  Should normally only be changed to maintain compatibility
92 # with an older release of perl.
93 #
94 USE_LARGE_FILES *= define
95
96 #
97 # Uncomment this if you're building a 32-bit perl and want 64-bit integers.
98 # (If you're building a 64-bit perl then you will have 64-bit integers whether
99 # or not this is uncommented.)
100 # Note: This option is not supported in 32-bit MSVC60 builds.
101 #
102 #USE_64_BIT_INT *= define
103
104 #
105 # Uncomment this if you want to support the use of long doubles in GCC builds.
106 # This option is not supported for MSVC builds.
107 #
108 #USE_LONG_DOUBLE *=define
109
110 #
111 # Uncomment this if you want to disable looking up values from
112 # HKEY_CURRENT_USER\Software\Perl and HKEY_LOCAL_MACHINE\Software\Perl in
113 # the Registry.
114 #
115 #USE_NO_REGISTRY *=define
116
117 #
118 # uncomment exactly one of the following
119 #
120 # Visual C++ 6.0 (aka Visual C++ 98)
121 #CCTYPE         *= MSVC60
122 # Visual C++ .NET 2002/2003 (aka Visual C++ 7.0/7.1) (full version)
123 #CCTYPE         *= MSVC70
124 # Visual C++ Toolkit 2003 (aka Visual C++ 7.1) (free command-line tools)
125 #CCTYPE         *= MSVC70FREE
126 # Windows Server 2003 SP1 Platform SDK (April 2005)
127 #CCTYPE         = SDK2003SP1
128 # Visual C++ 2005 (aka Visual C++ 8.0) (full version)
129 #CCTYPE         *= MSVC80
130 # Visual C++ 2005 Express Edition (aka Visual C++ 8.0) (free version)
131 #CCTYPE         *= MSVC80FREE
132 # Visual C++ 2008 (aka Visual C++ 9.0) (full version)
133 #CCTYPE         *= MSVC90
134 # Visual C++ 2008 Express Edition (aka Visual C++ 9.0) (free version)
135 #CCTYPE         *= MSVC90FREE
136 # Visual C++ 2010 (aka Visual C++ 10.0) (full version)
137 #CCTYPE         = MSVC100
138 # Visual C++ 2010 Express Edition (aka Visual C++ 10.0) (free version)
139 #CCTYPE         = MSVC100FREE
140 # Visual C++ 2012 (aka Visual C++ 11.0) (full version)
141 #CCTYPE         = MSVC110
142 # Visual C++ 2012 Express Edition (aka Visual C++ 11.0) (free version)
143 #CCTYPE         = MSVC110FREE
144 # Visual C++ 2013 (aka Visual C++ 12.0) (full version)
145 #CCTYPE         = MSVC120
146 # Visual C++ 2013 Express Edition (aka Visual C++ 12.0) (free version)
147 #CCTYPE         = MSVC120FREE
148 # MinGW or mingw-w64 with gcc-3.4.5 or later
149 #CCTYPE         = GCC
150
151 #
152 # If you are using GCC, 4.3 or later by default we add the -fwrapv option.
153 # See https://rt.perl.org/Ticket/Display.html?id=121505
154 #
155 #GCCWRAPV       *= define
156
157 #
158 # If you are using Intel C++ Compiler uncomment this
159 #
160 #__ICC          *= define
161
162 #
163 # Uncomment this if you want to build everything in C++ mode
164 #
165 #USE_CPLUSPLUS  *= define
166
167 #
168 # uncomment next line if you want debug version of perl (big/slow)
169 # If not enabled, we automatically try to use maximum optimization
170 # with all compilers that are known to have a working optimizer.
171 #
172 # You can also set CFG = DebugSymbols for a slightly smaller/faster
173 # debug build without the special debugging code in perl which is
174 # enabled via -DDEBUGGING;
175 #
176 # or you can set CFG = DebugFull for an even fuller (bigger/slower)
177 # debug build using the debug version of the CRT, and enabling VC++
178 # debug features such as extra assertions and invalid parameter warnings
179 # in perl and CRT code via -D_DEBUG.  (Note that the invalid parameter
180 # handler does get triggered from time to time in this configuration,
181 # which causes warnings to be printed on STDERR, which in turn causes a
182 # few tests to fail.)  (This configuration is only available for VC++ builds.)
183 #
184 #CFG            *= Debug
185
186 #
187 # uncomment to enable linking with setargv.obj under the Visual C
188 # compiler. Setting this options enables perl to expand wildcards in
189 # arguments, but it may be harder to use alternate methods like
190 # File::DosGlob that are more powerful.  This option is supported only with
191 # Visual C.
192 #
193 #USE_SETARGV    *= define
194
195 #
196 # set this if you wish to use perl's malloc
197 # WARNING: Turning this on/off WILL break binary compatibility with extensions
198 # you may have compiled with/without it.  Be prepared to recompile all
199 # extensions if you change the default.  Currently, this cannot be enabled
200 # if you ask for USE_IMP_SYS above.
201 #
202 #PERL_MALLOC    *= define
203
204 #
205 # set this to enable debugging mstats
206 # This must be enabled to use the Devel::Peek::mstat() function.  This cannot
207 # be enabled without PERL_MALLOC as well.
208 #
209 #DEBUG_MSTATS   *= define
210
211 #
212 # set this to additionally provide a statically linked perl-static.exe.
213 # Note that dynamic loading will not work with this perl, so you must
214 # include required modules statically using the STATIC_EXT or ALL_STATIC
215 # variables below. A static library perl525s.lib will also be created.
216 # Ordinary perl.exe is not affected by this option.
217 #
218 #BUILD_STATIC   *= define
219
220 #
221 # in addition to BUILD_STATIC the option ALL_STATIC makes *every*
222 # extension get statically built
223 # This will result in a very large perl executable, but the main purpose
224 # is to have proper linking set so as to be able to create miscellaneous
225 # executables with different built-in extensions
226 #
227 #ALL_STATIC     *= define
228
229 #
230 # set the install locations of the compiler include/libraries
231 # Running VCVARS32.BAT is *required* when using Visual C.
232 # Some versions of Visual C don't define MSVCDIR in the environment,
233 # so you may have to set CCHOME explicitly (spaces in the path name should
234 # not be quoted)
235 #
236
237 #CCHOME         *= C:\MinGW
238
239 #
240 # uncomment this if you are using x86_64-w64-mingw32 cross-compiler
241 # ie if your gcc executable is called 'x86_64-w64-mingw32-gcc'
242 # instead of the usual 'gcc'.
243 #
244 #GCCCROSS       *= define
245
246 #
247 # Additional compiler flags can be specified here.
248 #
249 BUILDOPT        *= $(BUILDOPTEXTRA)
250
251 #
252 # This should normally be disabled.  Enabling it will disable the File::Glob
253 # implementation of CORE::glob.
254 #
255 #BUILDOPT       += -DPERL_EXTERNAL_GLOB
256
257 #
258 # Perl needs to read scripts in text mode so that the DATA filehandle
259 # works correctly with seek() and tell(), or around auto-flushes of
260 # all filehandles (e.g. by system(), backticks, fork(), etc).
261 #
262 # The current version on the ByteLoader module on CPAN however only
263 # works if scripts are read in binary mode.  But before you disable text
264 # mode script reading (and break some DATA filehandle functionality)
265 # please check first if an updated ByteLoader isn't available on CPAN.
266 #
267 BUILDOPT        += -DPERL_TEXTMODE_SCRIPTS
268
269 #
270 # specify semicolon-separated list of extra directories that modules will
271 # look for libraries (spaces in path names need not be quoted)
272 #
273 EXTRALIBDIRS    *=
274
275 #
276 # set this to point to cmd.exe (only needed if you use some
277 # alternate shell that doesn't grok cmd.exe style commands)
278 #
279 #SHELL          *= g:\winnt\system32\cmd.exe
280
281 #
282 # set this to your email address (perl will guess a value from
283 # from your loginname and your hostname, which may not be right)
284 #
285 #EMAIL          *=
286
287 ##
288 ## Build configuration ends.
289 ##
290
291 ##################### CHANGE THESE ONLY IF YOU MUST #####################
292
293 PERL_MALLOC     *= undef
294 DEBUG_MSTATS    *= undef
295
296 USE_SITECUST    *= undef
297 USE_MULTI       *= undef
298 USE_ITHREADS    *= undef
299 USE_IMP_SYS     *= undef
300 USE_LARGE_FILES *= undef
301 USE_64_BIT_INT  *= undef
302 USE_LONG_DOUBLE *= undef
303 USE_NO_REGISTRY *= undef
304
305
306 .IF "$(USE_IMP_SYS)" == "define"
307 PERL_MALLOC     = undef
308 .ENDIF
309
310 .IF "$(PERL_MALLOC)" == "undef"
311 DEBUG_MSTATS    = undef
312 .ENDIF
313
314 .IF "$(DEBUG_MSTATS)" == "define"
315 BUILDOPT        += -DPERL_DEBUGGING_MSTATS
316 .ENDIF
317
318 .IF "$(USE_IMP_SYS) $(USE_MULTI)" == "define undef"
319 USE_MULTI       != define
320 .ENDIF
321
322 .IF "$(USE_ITHREADS) $(USE_MULTI)" == "define undef"
323 USE_MULTI       != define
324 .ENDIF
325
326 .IF "$(USE_SITECUST)" == "define"
327 BUILDOPT        += -DUSE_SITECUSTOMIZE
328 .ENDIF
329
330 .IF "$(USE_MULTI)" != "undef"
331 BUILDOPT        += -DPERL_IMPLICIT_CONTEXT
332 .ENDIF
333
334 .IF "$(USE_IMP_SYS)" != "undef"
335 BUILDOPT        += -DPERL_IMPLICIT_SYS
336 .ENDIF
337
338 .IF "$(USE_NO_REGISTRY)" != "undef"
339 BUILDOPT        += -DWIN32_NO_REGISTRY
340 .ENDIF
341
342 #no explicit CCTYPE given, do auto detection
343 .IF "$(CCTYPE)" == ""
344 GCCTARGET       *= $(shell gcc -dumpmachine 2>NUL & exit /b 0)
345 #do we have a GCC?
346 .IF "$(GCCTARGET)" != ""
347 CCTYPE          = GCC
348 .ELSE
349 #use var to capture 1st line only, not 8th token of lines 2 & 3 in cl.exe output
350 MSVCVER         := $(shell (set MSVCVER=) & (for /f "tokens=8 delims=.^ " \
351         %i in ('cl ^2^>^&1') do @if not defined MSVCVER set /A "MSVCVER=%i-6"))
352 CCTYPE          := MSVC$(MSVCVER)0
353 .ENDIF
354 .ENDIF
355
356
357 .IF "$(CCHOME)" == ""
358 .IF "$(CCTYPE)" == "GCC"
359 CCHOME          *= C:\MinGW
360 .ELSE
361 CCHOME          *= $(MSVCDIR)
362 .ENDIF
363 .ENDIF
364
365 #
366 # Following sets $Config{incpath} and $Config{libpth}
367 #
368
369 .IF "$(GCCCROSS)" == "define"
370 CCINCDIR *= $(CCHOME)\x86_64-w64-mingw32\include
371 CCLIBDIR *= $(CCHOME)\x86_64-w64-mingw32\lib
372 CCDLLDIR *= $(CCLIBDIR)
373 .ELSE
374 CCINCDIR *= $(CCHOME)\include
375 CCLIBDIR *= $(CCHOME)\lib
376 CCDLLDIR *= $(CCHOME)\bin
377 .ENDIF
378
379 PROCESSOR_ARCHITECTURE *= x86
380
381 .IF "$(WIN64)" == "undef"
382 PROCESSOR_ARCHITECTURE  = x86
383 .ENDIF
384
385 .IF "$(WIN64)" == ""
386 # When we are running from a 32bit cmd.exe on AMD64 then
387 # PROCESSOR_ARCHITECTURE is set to x86 and PROCESSOR_ARCHITEW6432
388 # is set to AMD64
389 .IF "$(PROCESSOR_ARCHITEW6432)" != ""
390 PROCESSOR_ARCHITECTURE  != $(PROCESSOR_ARCHITEW6432)
391 WIN64                   = define
392 .ELIF "$(PROCESSOR_ARCHITECTURE)" == "AMD64" || "$(PROCESSOR_ARCHITECTURE)" == "IA64"
393 WIN64                   = define
394 .ELSE
395 WIN64                   = undef
396 .ENDIF
397 .ENDIF
398
399 .IF "$(WIN64)" == "define"
400 USE_64_BIT_INT  = define
401 .ENDIF
402
403 # Treat 64-bit MSVC60 (doesn't really exist) as SDK2003SP1 because
404 # both link against MSVCRT.dll (which is part of Windows itself) and
405 # not against a compiler specific versioned runtime.
406 .IF "$(WIN64)" == "define" && "$(CCTYPE)" == "MSVC60"
407 CCTYPE          = SDK2003SP1
408 .ENDIF
409
410 # Disable the 64-bit-int option for (32-bit) MSVC60 builds since that compiler
411 # does not support it.
412 .IF "$(CCTYPE)" == "MSVC60"
413 USE_64_BIT_INT  != undef
414 .ENDIF
415
416 # Disable the long double option for MSVC builds since that compiler
417 # does not support it.
418 .IF "$(CCTYPE)" != "GCC"
419 USE_LONG_DOUBLE != undef
420 .ENDIF
421
422 ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
423 .IF "$(ARCHITECTURE)" == "AMD64"
424 ARCHITECTURE    = x64
425 .ENDIF
426 .IF "$(ARCHITECTURE)" == "IA64"
427 ARCHITECTURE    = ia64
428 .ENDIF
429
430 .IF "$(USE_MULTI)" == "define"
431 ARCHNAME        = MSWin32-$(ARCHITECTURE)-multi
432 .ELSE
433 ARCHNAME        = MSWin32-$(ARCHITECTURE)-perlio
434 .ENDIF
435
436 .IF "$(USE_ITHREADS)" == "define"
437 ARCHNAME        !:= $(ARCHNAME)-thread
438 .ENDIF
439
440 .IF "$(WIN64)" != "define"
441 .IF "$(USE_64_BIT_INT)" == "define"
442 ARCHNAME        !:= $(ARCHNAME)-64int
443 .ENDIF
444 .ENDIF
445
446 .IF "$(USE_LONG_DOUBLE)" == "define"
447 ARCHNAME        !:= $(ARCHNAME)-ld
448 .ENDIF
449
450 ARCHDIR         = ..\lib\$(ARCHNAME)
451 COREDIR         = ..\lib\CORE
452 AUTODIR         = ..\lib\auto
453 LIBDIR          = ..\lib
454 EXTDIR          = ..\ext
455 DISTDIR         = ..\dist
456 CPANDIR         = ..\cpan
457 PODDIR          = ..\pod
458 HTMLDIR         = .\html
459
460 #
461 INST_SCRIPT     = $(INST_TOP)$(INST_VER)\bin
462 INST_BIN        = $(INST_SCRIPT)$(INST_ARCH)
463 INST_LIB        = $(INST_TOP)$(INST_VER)\lib
464 INST_ARCHLIB    = $(INST_LIB)$(INST_ARCH)
465 INST_COREDIR    = $(INST_ARCHLIB)\CORE
466 INST_HTML       = $(INST_TOP)$(INST_VER)\html
467
468 #
469 # Programs to compile, build .lib files and link
470 #
471
472 .USESHELL :
473
474 MINIBUILDOPT    *=
475
476 .IF "$(CCTYPE)" == "GCC"
477
478 .IF "$(GCCCROSS)" == "define"
479 ARCHPREFIX      = x86_64-w64-mingw32-
480 .ENDIF
481
482 CC              = $(ARCHPREFIX)gcc
483 LINK32          = $(ARCHPREFIX)g++
484 LIB32           = $(ARCHPREFIX)ar rc
485 IMPLIB          = $(ARCHPREFIX)dlltool
486 RSC             = $(ARCHPREFIX)windres
487
488 .IF "$(USE_LONG_DOUBLE)" == "define"
489 BUILDOPT        += -D__USE_MINGW_ANSI_STDIO
490 MINIBUILDOPT    += -D__USE_MINGW_ANSI_STDIO
491 .ENDIF
492
493 GCCWRAPV *= $(shell for /f "delims=. tokens=1,2,3" %i in ('$(CC) -dumpversion') do @if "%i"=="4" (if "%j" geq "3" echo define) else if "%i" geq "5" (echo define))
494
495 .IF "$(GCCWRAPV)" == "define"
496 BUILDOPT        += -fwrapv
497 MINIBUILDOPT    += -fwrapv
498 .ENDIF
499
500 i = .i
501 o = .o
502 a = .a
503
504 #
505 # Options
506 #
507
508 INCLUDES        = -I.\include -I. -I..
509 DEFINES         = -DWIN32
510 .IF "$(WIN64)" == "define"
511 DEFINES         += -DWIN64 -DCONSERVATIVE
512 .ENDIF
513 LOCDEFS         = -DPERLDLL -DPERL_CORE
514 CXX_FLAG        = -xc++
515
516 # Current releases of MinGW 5.1.4 (as of 11-Aug-2009) will fail to link
517 # correctly if -lmsvcrt is specified explicitly.
518 LIBC            =
519 #LIBC           = -lmsvcrt
520
521 # same libs as MSVC
522 LIBFILES        = $(LIBC) -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool \
523         -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 \
524         -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
525
526 .IF  "$(CFG)" == "Debug"
527 OPTIMIZE        = -g -O2 -DDEBUGGING
528 LINK_DBG        = -g
529 .ELIF  "$(CFG)" == "DebugSymbols"
530 OPTIMIZE        = -g -O2
531 LINK_DBG        = -g
532 .ELSE
533 OPTIMIZE        = -s -O2
534 LINK_DBG        = -s
535 .ENDIF
536
537 EXTRACFLAGS     =
538 .IF "$(USE_CPLUSPLUS)" == "define"
539 EXTRACFLAGS     += $(CXX_FLAG)
540 .ENDIF
541 CFLAGS          = $(EXTRACFLAGS) $(INCLUDES) $(DEFINES) $(LOCDEFS) $(OPTIMIZE)
542 LINK_FLAGS      = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)"
543 OBJOUT_FLAG     = -o
544 EXEOUT_FLAG     = -o
545 LIBOUT_FLAG     =
546 PDBOUT          =
547
548 BUILDOPT        += -fno-strict-aliasing -mms-bitfields
549 MINIBUILDOPT    += -fno-strict-aliasing
550
551 TESTPREPGCC     = test-prep-gcc
552
553 .ELSE
554
555 # All but the free version of VC++ 7.1 can load DLLs on demand.  Makes the test
556 # suite run in about 10% less time.
557 .IF "$(CCTYPE)" != "MSVC70FREE"
558 # If no registry, advapi32 is only used for Perl_pp_getlogin/getlogin/GetUserNameA
559 # which is rare to execute
560 .IF "$(USE_NO_REGISTRY)" != "undef"
561 DELAYLOAD       = -DELAYLOAD:ws2_32.dll -DELAYLOAD:advapi32.dll delayimp.lib
562 MINIDELAYLOAD   =
563 .ELSE
564 DELAYLOAD       = -DELAYLOAD:ws2_32.dll delayimp.lib
565 #miniperl never does any registry lookups
566 MINIDELAYLOAD   = -DELAYLOAD:advapi32.dll
567 .ENDIF
568 .ENDIF
569
570 # Visual C++ 2005 and 2008 (VC++ 8.0 and 9.0) create manifest files for EXEs and
571 # DLLs. These either need copying everywhere with the binaries, or else need
572 # embedding in them otherwise MSVCR80.dll or MSVCR90.dll won't be found. For
573 # simplicity, embed them if they exist (and delete them afterwards so that they
574 # don't get installed too).
575 EMBED_EXE_MANI  = if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1 && \
576                   if exist $@.manifest del $@.manifest
577 EMBED_DLL_MANI  = if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2 && \
578                   if exist $@.manifest del $@.manifest
579
580 # Most relevant compiler-specific options fall into two groups:
581 # either pre-MSVC80 or MSVC80 onwards, so define a macro for this.
582 .IF "$(CCTYPE)" == "MSVC60" || \
583     "$(CCTYPE)" == "MSVC70" || "$(CCTYPE)" == "MSVC70FREE"
584 PREMSVC80       = define
585 .ELSE
586 PREMSVC80       = undef
587 .ENDIF
588
589 .IF "$(__ICC)" != "define"
590 CC              = cl
591 LINK32          = link
592 .ELSE
593 CC              = icl
594 LINK32          = xilink
595 .ENDIF
596 LIB32           = $(LINK32) -lib
597 RSC             = rc
598
599 #
600 # Options
601 #
602
603 INCLUDES        = -I.\include -I. -I..
604 #PCHFLAGS       = -Fpc:\temp\vcmoduls.pch -YX
605 DEFINES         = -DWIN32 -D_CONSOLE -DNO_STRICT
606 LOCDEFS         = -DPERLDLL -DPERL_CORE
607 CXX_FLAG        = -TP -EHsc
608
609 LIBC            = msvcrt.lib
610
611 .IF  "$(CFG)" == "Debug"
612 OPTIMIZE        = -Od -MD -Zi -DDEBUGGING
613 LINK_DBG        = -debug
614 .ELIF  "$(CFG)" == "DebugSymbols"
615 OPTIMIZE        = -Od -MD -Zi
616 LINK_DBG        = -debug
617 .ELIF  "$(CFG)" == "DebugFull"
618 LIBC            = msvcrtd.lib
619 OPTIMIZE        = -Od -MDd -Zi -D_DEBUG -DDEBUGGING
620 LINK_DBG        = -debug
621 .ELSE
622 # -O1 yields smaller code, which turns out to be faster than -O2 on x86 and x64
623 OPTIMIZE        = -O1 -MD -Zi -DNDEBUG
624 # we enable debug symbols in release builds also
625 LINK_DBG        = -debug -opt:ref,icf
626 # you may want to enable this if you want COFF symbols in the executables
627 # in addition to the PDB symbols.  The default Dr. Watson that ships with
628 # Windows can use the the former but not latter.  The free WinDbg can be
629 # installed to get better stack traces from just the PDB symbols, so we
630 # avoid the bloat of COFF symbols by default.
631 #LINK_DBG       = $(LINK_DBG) -debugtype:both
632 .IF "$(CCTYPE)" != "MSVC60"
633 # enable Whole Program Optimizations (WPO) and Link Time Code Generation (LTCG)
634 OPTIMIZE        += -GL
635 LINK_DBG        += -ltcg
636 LIB_FLAGS       = -ltcg
637 .ENDIF
638 .ENDIF
639
640 .IF "$(WIN64)" == "define"
641 DEFINES         += -DWIN64 -DCONSERVATIVE
642 OPTIMIZE        += -fp:precise
643 .ENDIF
644
645 # For now, silence warnings from VC++ 8.0 onwards about "unsafe" CRT functions
646 # and POSIX CRT function names being deprecated.
647 .IF "$(PREMSVC80)" == "undef"
648 DEFINES         += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
649 .ENDIF
650
651 # In VS 2005 (VC++ 8.0) Microsoft changes time_t from 32-bit to
652 # 64-bit, even in 32-bit mode.  It also provides the _USE_32BIT_TIME_T
653 # preprocessor option to revert back to the old functionality for
654 # backward compatibility.  We define this symbol here for older 32-bit
655 # compilers only (which aren't using it at all) for the sole purpose
656 # of getting it into $Config{ccflags}.  That way if someone builds
657 # Perl itself with e.g. VC6 but later installs an XS module using VC8
658 # the time_t types will still be compatible.
659 .IF "$(WIN64)" == "undef"
660 .IF "$(PREMSVC80)" == "define"
661 BUILDOPT        += -D_USE_32BIT_TIME_T
662 .ENDIF
663 .ENDIF
664
665 LIBBASEFILES    = oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
666         comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
667         netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib \
668         odbc32.lib odbccp32.lib comctl32.lib
669
670 # Avoid __intel_new_proc_init link error for libircmt.
671 # libmmd is /MD equivelent, other variants exist.
672 # libmmd is Intel C's math addon funcs to MS CRT, contains long doubles, C99,
673 # and optimized C89 funcs
674 .IF "$(__ICC)" == "define"
675 LIBBASEFILES    += libircmt.lib libmmd.lib
676 .ENDIF
677
678 # The 64 bit Windows Server 2003 SP1 SDK compilers link against MSVCRT.dll, which
679 # doesn't include the buffer overrun verification code used by the /GS switch.
680 # Since the code links against libraries that are compiled with /GS, this
681 # "security cookie verification" code must be included via bufferoverflow.lib.
682 .IF "$(WIN64)" == "define" && "$(CCTYPE)" == "SDK2003SP1"
683 LIBBASEFILES    += bufferoverflowU.lib
684 .ENDIF
685
686 LIBFILES        = $(LIBBASEFILES) $(LIBC)
687
688 EXTRACFLAGS     = -nologo -GF -W3
689 .IF "$(__ICC)" == "define"
690 EXTRACFLAGS     += -Qstd=c99
691 .ENDIF
692 .IF "$(USE_CPLUSPLUS)" == "define"
693 EXTRACFLAGS     += $(CXX_FLAG)
694 .ENDIF
695 CFLAGS          = $(EXTRACFLAGS) $(INCLUDES) $(DEFINES) $(LOCDEFS) \
696                 $(PCHFLAGS) $(OPTIMIZE)
697 LINK_FLAGS      = -nologo -nodefaultlib $(LINK_DBG) \
698                 -libpath:"$(INST_COREDIR)" \
699                 -machine:$(PROCESSOR_ARCHITECTURE)
700 LIB_FLAGS       += -nologo
701 OBJOUT_FLAG     = -Fo
702 EXEOUT_FLAG     = -Fe
703 LIBOUT_FLAG     = /out:
704 PDBOUT          = -Fd$*.pdb
705 TESTPREPGCC     =
706
707 .ENDIF
708
709 CFLAGS_O        = $(CFLAGS) $(BUILDOPT)
710
711 .IF "$(PREMSVC80)" == "undef"
712 PRIV_LINK_FLAGS += "/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"
713 .ELSE
714 RSC_FLAGS       = -DINCLUDE_MANIFEST
715 .ENDIF
716
717
718 # For XP support in >= VS 2013 (VC++ 12.0), subsystem is always in Config.pm
719 # LINK_FLAGS else subsystem is only needed for EXE building, not XS DLL building
720 # Console vs GUI makes no difference for DLLs, so use default for cleaner
721 # building cmd lines
722 .IF "$(CCTYPE)" == "MSVC120" || "$(CCTYPE)" == "MSVC120FREE" \
723     || "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC140FREE"
724 .IF "$(WIN64)" == "define"
725 LINK_FLAGS      += -subsystem:console,"5.02"
726 .ELSE
727 LINK_FLAGS      += -subsystem:console,"5.01"
728 .ENDIF
729
730 .ELIF "$(CCTYPE)" != "GCC"
731 PRIV_LINK_FLAGS += -subsystem:console
732 .ENDIF
733
734 BLINK_FLAGS     = $(PRIV_LINK_FLAGS) $(LINK_FLAGS)
735
736 #################### do not edit below this line #######################
737 ############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
738
739 # Some old dmakes (including Sarathy's one at
740 # http://search.cpan.org/CPAN/authors/id/G/GS/GSAR/dmake-4.1pl1-win32.zip)
741 # don't support logical OR (||) or logical AND (&&) in conditional
742 # expressions and hence don't process this makefile correctly. Determine
743 # whether this is the case so that we can give the user an error message.
744 .IF 1 == 1 || 1 == 1
745 NEWDMAKE = define
746 .ELSE
747 NEWDMAKE = undef
748 .ENDIF
749
750 o *= .obj
751 a *= .lib
752
753 LKPRE           = INPUT (
754 LKPOST          = )
755
756 #
757 # Rules
758 #
759
760 .SUFFIXES : .c .i $(o) .dll $(a) .exe .rc .res
761
762 .c$(o):
763         $(CC) -c $(null,$(<:d) $(NULL) -I$(<:d)) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $(PDBOUT) $<
764
765 .c.i:
766         $(CC) -c $(null,$(<:d) $(NULL) -I$(<:d)) $(CFLAGS_O) -E $< >$@
767
768 .y.c:
769         $(NOOP)
770
771 $(o).dll:
772 .IF "$(CCTYPE)" == "GCC"
773         $(LINK32) -o $@ $(BLINK_FLAGS) $< $(LIBFILES)
774         $(IMPLIB) --input-def $(*B).def --output-lib $(*B).a $@
775 .ELSE
776         $(LINK32) -dll -implib:$(*B).lib -def:$(*B).def \
777             -out:$@ $(BLINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
778         $(EMBED_DLL_MANI)
779 .ENDIF
780
781 .rc.res:
782 .IF "$(CCTYPE)" == "GCC"
783         $(RSC) --use-temp-file --include-dir=. --include-dir=.. -O COFF -D INCLUDE_MANIFEST -i $< -o $@
784 .ELSE
785         $(RSC) -i.. -DINCLUDE_MANIFEST $<
786 .ENDIF
787
788 #
789 # various targets
790
791 #do not put $(MINIPERL) as a dep/prereq in a rule, instead put $(HAVEMINIPERL)
792 #$(MINIPERL) is not a buildable target, use "dmake mp" if you want to just build
793 #miniperl alone
794 MINIPERL        = ..\miniperl.exe
795 HAVEMINIPERL    = ..\lib\buildcustomize.pl
796 MINIDIR         = .\mini
797 PERLEXE         = ..\perl.exe
798 WPERLEXE        = ..\wperl.exe
799 PERLEXESTATIC   = ..\perl-static.exe
800 STATICDIR       = .\static.tmp
801 GLOBEXE         = ..\perlglob.exe
802 CONFIGPM        = ..\lib\Config.pm
803 GENUUDMAP       = ..\generate_uudmap.exe
804 .IF "$(BUILD_STATIC)" == "define" || "$(ALL_STATIC)" == "define"
805 PERLSTATIC      = static
806 .ELSE
807 PERLSTATIC      = 
808 .ENDIF
809
810 # Unicode data files generated by mktables
811 UNIDATAFILES     = ..\lib\unicore\Decomposition.pl ..\lib\unicore\TestProp.pl \
812                    ..\lib\unicore\CombiningClass.pl ..\lib\unicore\Name.pl \
813                    ..\lib\unicore\UCD.pl ..\lib\unicore\Name.pm            \
814                    ..\lib\unicore\Heavy.pl ..\lib\unicore\mktables.lst
815
816 # Directories of Unicode data files generated by mktables
817 UNIDATADIR1     = ..\lib\unicore\To
818 UNIDATADIR2     = ..\lib\unicore\lib
819
820 PERLEXE_MANIFEST= .\perlexe.manifest
821 PERLEXE_ICO     = .\perlexe.ico
822 PERLEXE_RES     = .\perlexe.res
823 PERLDLL_RES     =
824
825 # Nominate a target which causes extensions to be re-built
826 # This used to be $(PERLEXE), but at worst it is the .dll that they depend
827 # on and really only the interface - i.e. the .def file used to export symbols
828 # from the .dll
829 PERLDEP = $(PERLIMPLIB)
830
831
832 PL2BAT          = bin\pl2bat.pl
833
834 UTILS           =                       \
835                 ..\utils\h2ph           \
836                 ..\utils\splain         \
837                 ..\utils\perlbug        \
838                 ..\utils\pl2pm          \
839                 ..\utils\c2ph           \
840                 ..\utils\pstruct        \
841                 ..\utils\h2xs           \
842                 ..\utils\perldoc        \
843                 ..\utils\perlivp        \
844                 ..\utils\libnetcfg      \
845                 ..\utils\enc2xs         \
846                 ..\utils\encguess       \
847                 ..\utils\piconv         \
848                 ..\utils\corelist       \
849                 ..\utils\cpan           \
850                 ..\utils\xsubpp         \
851                 ..\utils\pod2html       \
852                 ..\utils\prove          \
853                 ..\utils\ptar           \
854                 ..\utils\ptardiff       \
855                 ..\utils\ptargrep       \
856                 ..\utils\zipdetails     \
857                 ..\utils\shasum         \
858                 ..\utils\instmodsh      \
859                 ..\utils\json_pp        \
860                 bin\exetype.pl          \
861                 bin\runperl.pl          \
862                 bin\pl2bat.pl           \
863                 bin\perlglob.pl         \
864                 bin\search.pl
865
866 .IF "$(CCTYPE)" == "GCC"
867
868 CFGSH_TMPL      = config.gc
869 CFGH_TMPL       = config_H.gc
870 PERLIMPLIB      = $(COREDIR)\libperl525$(a)
871 PERLSTATICLIB   = ..\libperl525s$(a)
872 INT64           = long long
873
874 .ELSE
875
876 CFGSH_TMPL      = config.vc
877 CFGH_TMPL       = config_H.vc
878 INT64           = __int64
879
880 .ENDIF
881
882 # makedef.pl must be updated if this changes, and this should normally
883 # only change when there is an incompatible revision of the public API.
884 PERLIMPLIB      *= $(COREDIR)\perl525$(a)
885 PERLEXPLIB      *= $(COREDIR)\perl525.exp
886 PERLSTATICLIB   *= ..\perl525s$(a)
887 PERLDLL         = ..\perl525.dll
888
889 #EUMM on Win32 isn't ready for parallel make, so only allow this file to be parallel
890 #$(MAKE) will contain the -P that this makefile was called with, which is bad for
891 #make_ext.pl since upto jobs*jobs processes will run instead of jobs
892 #also any recipie containing $(MAKE) is special cased by dmake to execute recipes
893 #containing $(MAKE) when "dmake -n" is executed, which causes recursive calls
894 #to dmake, which means "dmake -n" is then broken as a diagnostic tool since
895 #"dmake -n" will invoke all the make_ext.pl scripts build things instead of
896 #showing what to build since $(MAKE) is an arg to make_ext.pl, not an invocation
897 #of the dmake process
898 PLMAKE          = dmake
899
900 XCOPY           = xcopy /f /r /i /d /y
901 RCOPY           = xcopy /f /r /i /e /d /y
902 NOOP            = @rem
903
904 #first ones are arrange in compile time order for faster parallel building
905 #see #123867 for details
906 MICROCORE_SRC   =               \
907                 ..\toke.c       \
908                 ..\regcomp.c    \
909                 ..\regexec.c    \
910                 ..\op.c         \
911                 ..\sv.c         \
912                 ..\pp.c         \
913                 ..\pp_ctl.c     \
914                 ..\pp_sys.c     \
915                 ..\pp_pack.c    \
916                 ..\pp_hot.c     \
917                 ..\gv.c         \
918                 ..\perl.c       \
919                 ..\utf8.c       \
920                 ..\dump.c       \
921                 ..\hv.c         \
922                 ..\av.c         \
923                 ..\caretx.c     \
924                 ..\deb.c        \
925                 ..\doio.c       \
926                 ..\doop.c       \
927                 ..\dquote.c     \
928                 ..\globals.c    \
929                 ..\mro_core.c   \
930                 ..\locale.c     \
931                 ..\keywords.c   \
932                 ..\mathoms.c    \
933                 ..\mg.c         \
934                 ..\numeric.c    \
935                 ..\pad.c        \
936                 ..\perlapi.c    \
937                 ..\perly.c      \
938                 ..\pp_sort.c    \
939                 ..\reentr.c     \
940                 ..\run.c        \
941                 ..\scope.c      \
942                 ..\taint.c      \
943                 ..\time64.c     \
944                 ..\universal.c  \
945                 ..\util.c
946
947 EXTRACORE_SRC   += perllib.c
948
949 .IF "$(PERL_MALLOC)" == "define"
950 EXTRACORE_SRC   += ..\malloc.c
951 .ENDIF
952
953 EXTRACORE_SRC   += ..\perlio.c
954
955 WIN32_SRC       =               \
956                 .\win32.c       \
957                 .\win32io.c     \
958                 .\win32sck.c    \
959                 .\win32thread.c \
960                 .\fcrypt.c
961
962 CORE_NOCFG_H    =               \
963                 ..\av.h         \
964                 ..\cop.h        \
965                 ..\cv.h         \
966                 ..\dosish.h     \
967                 ..\embed.h      \
968                 ..\form.h       \
969                 ..\gv.h         \
970                 ..\handy.h      \
971                 ..\hv.h         \
972                 ..\hv_func.h    \
973                 ..\iperlsys.h   \
974                 ..\mg.h         \
975                 ..\nostdio.h    \
976                 ..\op.h         \
977                 ..\opcode.h     \
978                 ..\perl.h       \
979                 ..\perlapi.h    \
980                 ..\perlsdio.h   \
981                 ..\perly.h      \
982                 ..\pp.h         \
983                 ..\proto.h      \
984                 ..\regcomp.h    \
985                 ..\regexp.h     \
986                 ..\scope.h      \
987                 ..\sv.h         \
988                 ..\thread.h     \
989                 ..\unixish.h    \
990                 ..\utf8.h       \
991                 ..\util.h       \
992                 ..\warnings.h   \
993                 ..\XSUB.h       \
994                 ..\EXTERN.h     \
995                 ..\perlvars.h   \
996                 ..\intrpvar.h   \
997                 .\include\dirent.h      \
998                 .\include\netdb.h       \
999                 .\include\sys\errno2.h  \
1000                 .\include\sys\socket.h  \
1001                 .\win32.h
1002
1003 CORE_H          = $(CORE_NOCFG_H) .\config.h ..\git_version.h
1004
1005 UUDMAP_H        = ..\uudmap.h
1006 BITCOUNT_H      = ..\bitcount.h
1007 MG_DATA_H       = ..\mg_data.h
1008 GENERATED_HEADERS = $(UUDMAP_H) $(BITCOUNT_H) $(MG_DATA_H)
1009
1010 HAVE_COREDIR    = .\.coreheaders
1011
1012 MICROCORE_OBJ   = $(MICROCORE_SRC:db:+$(o))
1013 CORE_OBJ        = $(MICROCORE_OBJ) $(EXTRACORE_SRC:db:+$(o))
1014 WIN32_OBJ       = $(WIN32_SRC:db:+$(o))
1015 MINICORE_OBJ    = $(MINIDIR)\{$(MICROCORE_OBJ:f) miniperlmain$(o) perlio$(o)}
1016 MINIWIN32_OBJ   = $(MINIDIR)\{$(WIN32_OBJ:f)}
1017 MINI_OBJ        = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
1018 DLL_OBJ         = $(DYNALOADER)
1019
1020 PERLDLL_OBJ     = $(CORE_OBJ)
1021 PERLEXE_OBJ     = perlmain$(o)
1022 PERLEXEST_OBJ   = perlmainst$(o)
1023
1024 PERLDLL_OBJ     += $(WIN32_OBJ) $(DLL_OBJ)
1025
1026 .IF "$(USE_SETARGV)" != ""
1027 SETARGV_OBJ     = setargv$(o)
1028 .ENDIF
1029
1030 .IF "$(ALL_STATIC)" == "define"
1031 # some exclusions, unfortunately, until fixed:
1032 #  - MakeMaker isn't capable enough for SDBM_File (small bug)
1033 STATIC_EXT      = * !SDBM_File
1034 .ELSE
1035 # specify static extensions here, for example:
1036 # (be sure to include Win32CORE to load Win32 on demand)
1037 #STATIC_EXT     = Win32CORE Cwd Compress/Raw/Zlib
1038 STATIC_EXT      = Win32CORE
1039 .ENDIF
1040
1041 DYNALOADER      = ..\DynaLoader$(o)
1042
1043 # vars must be separated by "\t+~\t+", since we're using the tempfile
1044 # version of config_sh.pl (we were overflowing someone's buffer by
1045 # trying to fit them all on the command line)
1046 #       -- BKS 10-17-1999
1047 CFG_VARS        =                                       \
1048                 INST_TOP=$(INST_TOP)    ~       \
1049                 INST_VER=$(INST_VER)    ~       \
1050                 INST_ARCH=$(INST_ARCH)          ~       \
1051                 archname=$(ARCHNAME)            ~       \
1052                 cc=$(CC)                        ~       \
1053                 ld=$(LINK32)                    ~       \
1054                 ccflags=$(EXTRACFLAGS) $(OPTIMIZE) $(DEFINES) $(BUILDOPT)       ~       \
1055                 usecplusplus=$(USE_CPLUSPLUS)   ~       \
1056                 cf_email=$(EMAIL)               ~       \
1057                 d_mymalloc=$(PERL_MALLOC)       ~       \
1058                 libs=$(LIBFILES:f)              ~       \
1059                 incpath=$(CCINCDIR)     ~       \
1060                 libperl=$(PERLIMPLIB:f)         ~       \
1061                 libpth=$(CCLIBDIR);$(EXTRALIBDIRS)      ~       \
1062                 libc=$(LIBC)                    ~       \
1063                 make=$(PLMAKE)                  ~       \
1064                 _o=$(o)                         ~       \
1065                 obj_ext=$(o)                    ~       \
1066                 _a=$(a)                         ~       \
1067                 lib_ext=$(a)                    ~       \
1068                 static_ext=$(STATIC_EXT)        ~       \
1069                 usethreads=$(USE_ITHREADS)      ~       \
1070                 useithreads=$(USE_ITHREADS)     ~       \
1071                 usemultiplicity=$(USE_MULTI)    ~       \
1072                 use64bitint=$(USE_64_BIT_INT)   ~       \
1073                 uselongdouble=$(USE_LONG_DOUBLE)        ~       \
1074                 uselargefiles=$(USE_LARGE_FILES)        ~       \
1075                 usesitecustomize=$(USE_SITECUST)        ~       \
1076                 LINK_FLAGS=$(LINK_FLAGS)        ~       \
1077                 optimize=$(OPTIMIZE)    ~       \
1078                 ARCHPREFIX=$(ARCHPREFIX)        ~       \
1079                 WIN64=$(WIN64)
1080
1081 #
1082 # Top targets
1083 #
1084
1085 all : CHECKDMAKE rebasePE Extensions_nonxs $(PERLSTATIC)
1086
1087 ..\regcomp$(o) : ..\regnodes.h ..\regcharclass.h
1088
1089 ..\regexec$(o) : ..\regnodes.h ..\regcharclass.h
1090
1091 reonly : ..\regnodes.h $(UNIDATAFILES) Extensions_reonly
1092
1093 static: $(PERLEXESTATIC)
1094
1095 #----------------------------------------------------------------
1096
1097 CHECKDMAKE :
1098 .IF "$(NEWDMAKE)" == "define"
1099         $(NOOP)
1100 .ELSE
1101         @echo Your dmake doesn't support ^|^| or ^&^& in conditional expressions.
1102         @echo Please get the latest dmake from http://search.cpan.org/dist/dmake/
1103         @exit 1
1104 .ENDIF
1105
1106 $(GLOBEXE) : perlglob.c
1107 .IF "$(CCTYPE)" == "GCC"
1108         $(LINK32) $(OPTIMIZE) $(BLINK_FLAGS) -mconsole -o $@ perlglob.c $(LIBFILES)
1109 .ELSE
1110         $(CC) $(OPTIMIZE) $(PDBOUT) -Fe$@ perlglob.c -link $(BLINK_FLAGS) \
1111         setargv$(o) $(LIBFILES) && $(EMBED_EXE_MANI)
1112 .ENDIF
1113
1114 ..\git_version.h : $(HAVEMINIPERL) ..\make_patchnum.pl
1115         $(MINIPERL) -I..\lib ..\make_patchnum.pl
1116
1117 # make sure that we recompile perl.c if the git version changes
1118 ..\perl$(o) : ..\git_version.h
1119
1120 ..\config.sh : $(CFGSH_TMPL) config_sh.PL FindExt.pm $(HAVEMINIPERL)
1121         $(MINIPERL) -I..\lib config_sh.PL --cfgsh-option-file \
1122             $(mktmp $(CFG_VARS)) $(CFGSH_TMPL) > ..\config.sh
1123
1124 # This target is for when changes to the main config.sh happen.
1125 # Edit config.gc, then make perl using GCC in a minimal configuration (i.e.
1126 # with MULTI, ITHREADS, IMP_SYS and LARGE_FILES off), then make
1127 # this target to regenerate config_H.gc.
1128 regen_config_h:
1129         $(MINIPERL) -I..\lib config_sh.PL --cfgsh-option-file $(mktmp $(CFG_VARS)) \
1130             $(CFGSH_TMPL) > ..\config.sh
1131         $(MINIPERL) -I..\lib ..\configpm --chdir=..
1132         -del /f $(CFGH_TMPL)
1133         -$(MINIPERL) -I..\lib config_h.PL "ARCHPREFIX=$(ARCHPREFIX)"
1134         rename config.h $(CFGH_TMPL)
1135
1136 $(CONFIGPM) .\config.h .UPDATEALL: ..\config.sh config_h.PL
1137         $(MINIPERL) -I..\lib ..\configpm --chdir=..
1138         -$(MINIPERL) -I..\lib config_h.PL "ARCHPREFIX=$(ARCHPREFIX)"
1139
1140 # See the comment in Makefile.SH explaining this seemingly cranky ordering
1141 ..\lib\buildcustomize.pl : $(MINI_OBJ) ..\write_buildcustomize.pl
1142 .IF "$(CCTYPE)" == "GCC"
1143         $(LINK32) -v -mconsole -o $(MINIPERL) $(BLINK_FLAGS) \
1144             $(mktmp $(LKPRE) $(MINI_OBJ) $(LIBFILES) $(LKPOST))
1145 .ELSE
1146         $(LINK32) -out:$(MINIPERL) $(BLINK_FLAGS) \
1147             @$(mktmp $(DELAYLOAD) $(MINIDELAYLOAD) $(LIBFILES) $(MINI_OBJ))
1148         $(EMBED_EXE_MANI:s/$@/$(MINIPERL)/)
1149 .ENDIF
1150         $(MINIPERL) -I..\lib -f ..\write_buildcustomize.pl ..
1151
1152 #convinence target, get a working miniperl
1153 mp : $(CONFIGPM)
1154
1155 $(MINIDIR)\.exists : $(CFGH_TMPL)
1156         if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
1157 #
1158 # Copy the template config.h and set configurables at the end of it
1159 # as per the options chosen and compiler used.
1160 # Note: This config.h is only used to build miniperl.exe anyway, but
1161 # it's as well to have its options correct to be sure that it builds
1162 # and so that it's "-V" options are correct for use by makedef.pl. The
1163 # real config.h used to build perl.exe is generated from the top-level
1164 # config_h.SH by config_h.PL (run by miniperl.exe).
1165 #
1166 # MINIDIR generates config.h so miniperl.exe is not rebuilt when the 2nd
1167 # config.h is generated in CONFIGPM target, see also the comments for $(MINI_OBJ).
1168         copy $(CFGH_TMPL) config.h
1169         @(echo.&& \
1170         echo #ifndef _config_h_footer_&& \
1171         echo #define _config_h_footer_&& \
1172         echo #undef Off_t&& \
1173         echo #undef LSEEKSIZE&& \
1174         echo #undef Off_t_size&& \
1175         echo #undef PTRSIZE&& \
1176         echo #undef SSize_t&& \
1177         echo #undef HAS_ATOLL&& \
1178         echo #undef HAS_STRTOLL&& \
1179         echo #undef HAS_STRTOULL&& \
1180         echo #undef Size_t_size&& \
1181         echo #undef IVTYPE&& \
1182         echo #undef UVTYPE&& \
1183         echo #undef IVSIZE&& \
1184         echo #undef UVSIZE&& \
1185         echo #undef NV_PRESERVES_UV&& \
1186         echo #undef NV_PRESERVES_UV_BITS&& \
1187         echo #undef IVdf&& \
1188         echo #undef UVuf&& \
1189         echo #undef UVof&& \
1190         echo #undef UVxf&& \
1191         echo #undef UVXf&& \
1192         echo #undef USE_64_BIT_INT&& \
1193         echo #undef Gconvert&& \
1194         echo #undef HAS_FREXPL&& \
1195         echo #undef HAS_ISNANL&& \
1196         echo #undef HAS_MODFL&& \
1197         echo #undef HAS_MODFL_PROTO&& \
1198         echo #undef HAS_SQRTL&& \
1199         echo #undef HAS_STRTOLD&& \
1200         echo #undef PERL_PRIfldbl&& \
1201         echo #undef PERL_PRIgldbl&& \
1202         echo #undef PERL_PRIeldbl&& \
1203         echo #undef PERL_SCNfldbl&& \
1204         echo #undef NVTYPE&& \
1205         echo #undef NVSIZE&& \
1206         echo #undef LONG_DOUBLESIZE&& \
1207         echo #undef NV_OVERFLOWS_INTEGERS_AT&& \
1208         echo #undef NVef&& \
1209         echo #undef NVff&& \
1210         echo #undef NVgf&& \
1211         echo #undef USE_LONG_DOUBLE&& \
1212         echo #undef USE_CPLUSPLUS)>> config.h
1213 .IF "$(USE_LARGE_FILES)"=="define"
1214         @(echo #define Off_t $(INT64)&& \
1215         echo #define LSEEKSIZE ^8&& \
1216         echo #define Off_t_size ^8)>> config.h
1217 .ELSE
1218         @(echo #define Off_t long&& \
1219         echo #define LSEEKSIZE ^4&& \
1220         echo #define Off_t_size ^4)>> config.h
1221 .ENDIF
1222 .IF "$(WIN64)"=="define"
1223         @(echo #define PTRSIZE ^8&& \
1224         echo #define SSize_t $(INT64)&& \
1225         echo #define HAS_ATOLL&& \
1226         echo #define HAS_STRTOLL&& \
1227         echo #define HAS_STRTOULL&& \
1228         echo #define Size_t_size ^8)>> config.h
1229 .ELSE
1230         @(echo #define PTRSIZE ^4&& \
1231         echo #define SSize_t int&& \
1232         echo #undef HAS_ATOLL&& \
1233         echo #undef HAS_STRTOLL&& \
1234         echo #undef HAS_STRTOULL&& \
1235         echo #define Size_t_size ^4)>> config.h
1236 .ENDIF
1237 .IF "$(USE_64_BIT_INT)"=="define"
1238         @(echo #define IVTYPE $(INT64)&& \
1239         echo #define UVTYPE unsigned $(INT64)&& \
1240         echo #define IVSIZE ^8&& \
1241         echo #define UVSIZE ^8)>> config.h
1242 .IF "$(USE_LONG_DOUBLE)"=="define"
1243         @(echo #define NV_PRESERVES_UV&& \
1244         echo #define NV_PRESERVES_UV_BITS 64)>> config.h
1245 .ELSE
1246         @(echo #undef NV_PRESERVES_UV&& \
1247         echo #define NV_PRESERVES_UV_BITS 53)>> config.h
1248 .ENDIF
1249         @(echo #define IVdf "I64d"&& \
1250         echo #define UVuf "I64u"&& \
1251         echo #define UVof "I64o"&& \
1252         echo #define UVxf "I64x"&& \
1253         echo #define UVXf "I64X"&& \
1254         echo #define USE_64_BIT_INT)>> config.h
1255 .ELSE
1256         @(echo #define IVTYPE long&& \
1257         echo #define UVTYPE unsigned long&& \
1258         echo #define IVSIZE ^4&& \
1259         echo #define UVSIZE ^4&& \
1260         echo #define NV_PRESERVES_UV&& \
1261         echo #define NV_PRESERVES_UV_BITS 32&& \
1262         echo #define IVdf "ld"&& \
1263         echo #define UVuf "lu"&& \
1264         echo #define UVof "lo"&& \
1265         echo #define UVxf "lx"&& \
1266         echo #define UVXf "lX"&& \
1267         echo #undef USE_64_BIT_INT)>> config.h
1268 .ENDIF
1269 .IF "$(USE_LONG_DOUBLE)"=="define"
1270         @(echo #define Gconvert^(x,n,t,b^) sprintf^(^(b^),"%.*""Lg",^(n^),^(x^)^)&& \
1271         echo #define HAS_FREXPL&& \
1272         echo #define HAS_ISNANL&& \
1273         echo #define HAS_MODFL&& \
1274         echo #define HAS_MODFL_PROTO&& \
1275         echo #define HAS_SQRTL&& \
1276         echo #define HAS_STRTOLD&& \
1277         echo #define PERL_PRIfldbl "Lf"&& \
1278         echo #define PERL_PRIgldbl "Lg"&& \
1279         echo #define PERL_PRIeldbl "Le"&& \
1280         echo #define PERL_SCNfldbl "Lf"&& \
1281         echo #define NVTYPE long double)>> config.h
1282 .IF "$(WIN64)"=="define"
1283         @(echo #define NVSIZE ^16&& \
1284         echo #define LONG_DOUBLESIZE ^16)>> config.h
1285 .ELSE
1286         @(echo #define NVSIZE ^12&& \
1287         echo #define LONG_DOUBLESIZE ^12)>> config.h
1288 .ENDIF
1289         @(echo #define NV_OVERFLOWS_INTEGERS_AT 256.0*256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0*2.0*2.0*2.0&& \
1290         echo #define NVef "Le"&& \
1291         echo #define NVff "Lf"&& \
1292         echo #define NVgf "Lg"&& \
1293         echo #define USE_LONG_DOUBLE)>> config.h
1294 .ELSE
1295         @(echo #define Gconvert^(x,n,t,b^) sprintf^(^(b^),"%.*g",^(n^),^(x^)^)&& \
1296         echo #undef HAS_FREXPL&& \
1297         echo #undef HAS_ISNANL&& \
1298         echo #undef HAS_MODFL&& \
1299         echo #undef HAS_MODFL_PROTO&& \
1300         echo #undef HAS_SQRTL&& \
1301         echo #undef HAS_STRTOLD&& \
1302         echo #undef PERL_PRIfldbl&& \
1303         echo #undef PERL_PRIgldbl&& \
1304         echo #undef PERL_PRIeldbl&& \
1305         echo #undef PERL_SCNfldbl&& \
1306         echo #define NVTYPE double&& \
1307         echo #define NVSIZE ^8&& \
1308         echo #define LONG_DOUBLESIZE ^8&& \
1309         echo #define NV_OVERFLOWS_INTEGERS_AT 256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0&& \
1310         echo #define NVef "e"&& \
1311         echo #define NVff "f"&& \
1312         echo #define NVgf "g"&& \
1313         echo #undef USE_LONG_DOUBLE)>> config.h
1314 .ENDIF
1315 .IF "$(USE_CPLUSPLUS)"=="define"
1316         @(echo #define USE_CPLUSPLUS&& \
1317         echo #endif)>> config.h
1318 .ELSE
1319         @(echo #undef USE_CPLUSPLUS&& \
1320         echo #endif)>> config.h
1321 .ENDIF
1322 #separate line since this is sentinal that this target is done
1323         rem. > $(MINIDIR)\.exists
1324
1325 $(MINICORE_OBJ) : $(CORE_NOCFG_H)
1326         $(CC) -c $(CFLAGS) $(MINIBUILDOPT) -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL $(OBJOUT_FLAG)$@ $(PDBOUT) ..\$(*B).c
1327
1328 $(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
1329         $(CC) -c $(CFLAGS) $(MINIBUILDOPT) -DPERL_IS_MINIPERL $(OBJOUT_FLAG)$@ $(PDBOUT) $(*B).c
1330
1331 # -DPERL_IMPLICIT_SYS needs C++ for perllib.c
1332 # rules wrapped in .IFs break Win9X build (we end up with unbalanced []s unless
1333 # unless the .IF is true), so instead we use a .ELSE with the default.
1334 # This is the only file that depends on perlhost.h, vmem.h, and vdir.h
1335
1336 perllib$(o)     : perllib.c perllibst.h .\perlhost.h .\vdir.h .\vmem.h
1337 .IF "$(USE_IMP_SYS)" == "define"
1338         $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ $(PDBOUT) perllib.c
1339 .ELSE
1340         $(CC) -c -I. $(CFLAGS_O) $(OBJOUT_FLAG)$@ $(PDBOUT) perllib.c
1341 .ENDIF
1342
1343 # 1. we don't want to rebuild miniperl.exe when config.h changes
1344 # 2. we don't want to rebuild miniperl.exe with non-default config.h
1345 # 3. we can't have miniperl.exe depend on git_version.h, as miniperl creates it
1346 $(MINI_OBJ)     : $(MINIDIR)\.exists $(CORE_NOCFG_H)
1347
1348 $(WIN32_OBJ)    : $(CORE_H)
1349
1350 $(CORE_OBJ)     : $(CORE_H)
1351
1352 $(DLL_OBJ)      : $(CORE_H)
1353
1354
1355 perllibst.h : $(HAVEMINIPERL) $(CONFIGPM) create_perllibst_h.pl
1356         $(MINIPERL) -I..\lib create_perllibst_h.pl
1357
1358 perldll.def : $(HAVEMINIPERL) $(CONFIGPM) ..\embed.fnc ..\makedef.pl
1359         $(MINIPERL) -I..\lib -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) \
1360         $(BUILDOPT) CCTYPE=$(CCTYPE) TARG_DIR=..\ > perldll.def
1361
1362 $(PERLEXPLIB) $(PERLIMPLIB) .UPDATEALL : perldll.def
1363 .IF "$(CCTYPE)" == "GCC"
1364         $(IMPLIB) -k -d perldll.def -l $(PERLIMPLIB) -e $(PERLEXPLIB)
1365 .ELSE #VC family
1366         lib -def:perldll.def -machine:$(ARCHITECTURE) /OUT:$(PERLIMPLIB)
1367 .ENDIF
1368
1369 $(PERLDLL): $(PERLEXPLIB) $(PERLDLL_OBJ) $(PERLDLL_RES) Extensions_static
1370 .IF "$(CCTYPE)" == "GCC"
1371         $(LINK32) -mdll -o $@ $(BLINK_FLAGS) \
1372            $(PERLDLL_OBJ) $(shell @type Extensions_static) $(LIBFILES) $(PERLEXPLIB)
1373 .ELSE
1374         $(LINK32) -dll -out:$@ $(BLINK_FLAGS) \
1375             @Extensions_static \
1376             @$(mktmp -base:0x28000000 $(DELAYLOAD) $(LIBFILES) \
1377                 $(PERLDLL_RES) $(PERLDLL_OBJ) $(PERLEXPLIB))
1378         $(EMBED_DLL_MANI)
1379 .ENDIF
1380
1381 $(PERLSTATICLIB): $(PERLDLL_OBJ) Extensions_static
1382 .IF "$(CCTYPE)" == "GCC"
1383         $(LIB32) $(LIB_FLAGS) $@ $(PERLDLL_OBJ)
1384         if exist $(STATICDIR) rmdir /s /q $(STATICDIR)
1385         for %i in ($(shell @type Extensions_static)) do \
1386                 @mkdir $(STATICDIR) && cd $(STATICDIR) && \
1387                 $(ARCHPREFIX)ar x ..\%i && \
1388                 $(ARCHPREFIX)ar q ..\$@ *$(o) && \
1389                 cd .. && rmdir /s /q $(STATICDIR)
1390 .ELSE
1391         $(LIB32) $(LIB_FLAGS) -out:$@ @Extensions_static \
1392             @$(mktmp $(PERLDLL_OBJ))
1393 .ENDIF
1394         $(XCOPY) $(PERLSTATICLIB) $(COREDIR)\$(NULL)
1395
1396 $(PERLEXE_RES): perlexe.rc $(PERLEXE_MANIFEST) $(PERLEXE_ICO)
1397
1398 $(MINIDIR)\globals$(o) : $(GENERATED_HEADERS)
1399
1400 $(GENUUDMAP) $(GENERATED_HEADERS) .UPDATEALL : ..\mg_raw.h
1401 .IF "$(CCTYPE)" == "GCC"
1402         $(LINK32) $(CFLAGS_O) -o..\generate_uudmap.exe ..\generate_uudmap.c \
1403         $(BLINK_FLAGS) -x $(mktmp $(LKPRE) $(LIBFILES) $(LKPOST))
1404 .ELSE
1405         $(CC) $(CFLAGS_O) $(PDBOUT) -Fe..\generate_uudmap.exe ..\generate_uudmap.c @$(mktmp -link $(LIBFILES)) -link $(BLINK_FLAGS)
1406         $(EMBED_EXE_MANI:s/$@/..\generate_uudmap.exe/)
1407 .ENDIF
1408         $(GENUUDMAP) $(GENERATED_HEADERS)
1409
1410 MakePPPort : $(HAVEMINIPERL) $(CONFIGPM)
1411         $(MINIPERL) -I..\lib ..\mkppport
1412
1413 # also known as $(HAVE_COREDIR)
1414 .\.coreheaders : $(CORE_H)
1415         $(XCOPY) *.h $(COREDIR)\*.* && $(RCOPY) include $(COREDIR)\*.* && $(XCOPY) ..\*.h $(COREDIR)\*.*
1416         rem. > $@
1417
1418 perlmain$(o) : runperl.c $(CONFIGPM)
1419         $(CC) $(CFLAGS_O:s,-DPERLDLL,-UPERLDLL,) $(OBJOUT_FLAG)$@ $(PDBOUT) -c runperl.c
1420
1421 perlmainst$(o) : runperl.c $(CONFIGPM)
1422         $(CC) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $(PDBOUT) -c runperl.c
1423
1424 $(PERLEXE): $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES) $(PERLIMPLIB)
1425 .IF "$(CCTYPE)" == "GCC"
1426         $(LINK32) -mconsole -o $@ $(BLINK_FLAGS)  \
1427             $(PERLEXE_OBJ) $(PERLEXE_RES) $(PERLIMPLIB) $(LIBFILES)
1428 .ELSE
1429         $(LINK32) -out:$@ $(BLINK_FLAGS) \
1430             $(PERLEXE_OBJ) $(PERLEXE_RES) $(PERLIMPLIB) $(LIBFILES) $(SETARGV_OBJ)
1431         $(EMBED_EXE_MANI)
1432 .ENDIF
1433         copy $(PERLEXE) $(WPERLEXE)
1434         $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS
1435
1436 $(PERLEXESTATIC): $(PERLSTATICLIB) $(CONFIGPM) $(PERLEXEST_OBJ) $(PERLEXE_RES)
1437 .IF "$(CCTYPE)" == "GCC"
1438         $(LINK32) -mconsole -o $@ $(BLINK_FLAGS) \
1439             $(PERLEXEST_OBJ) $(PERLEXE_RES) $(PERLSTATICLIB) $(LIBFILES)
1440 .ELSE
1441         $(LINK32) -out:$@ $(BLINK_FLAGS) \
1442             $(PERLEXEST_OBJ) $(PERLEXE_RES) $(PERLSTATICLIB) $(LIBFILES) $(SETARGV_OBJ)
1443         $(EMBED_EXE_MANI)
1444 .ENDIF
1445
1446 #-------------------------------------------------------------------------------
1447 # There's no direct way to mark a dependency on
1448 # DynaLoader.pm, so this will have to do
1449
1450 #most of deps of this target are in DYNALOADER and therefore omitted here
1451 Extensions : $(PERLDEP) $(DYNALOADER) $(GLOBEXE) MakePPPort
1452         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic !Unicode/Normalize
1453
1454 Extensions_normalize : $(PERLDEP) $(DYNALOADER) $(GLOBEXE) $(UNIDATAFILES)
1455         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +Unicode/Normalize
1456
1457 Extensions_reonly : $(PERLDEP) $(DYNALOADER)
1458         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +re
1459
1460 Extensions_static : ..\make_ext.pl list_static_libs.pl $(CONFIGPM) $(GLOBEXE) $(HAVE_COREDIR) MakePPPort
1461         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static
1462         $(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static
1463
1464 Extensions_nonxs : ..\make_ext.pl ..\pod\perlfunc.pod $(CONFIGPM) $(GLOBEXE)
1465         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --nonxs !libs
1466
1467 #lib must be built, it can't be buildcustomize.pl-ed, and is required for XS building
1468 $(DYNALOADER) : ..\make_ext.pl $(CONFIGPM) $(HAVE_COREDIR)
1469         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(EXTDIR) --dir=$(DISTDIR) --dynaloader lib
1470
1471 Extensions_clean :
1472         -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=clean
1473
1474 Extensions_realclean :
1475         -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=realclean
1476
1477 # all PE files need to be built by the time this target runs, PP files can still
1478 # be running in parallel like UNIDATAFILES, this target a placeholder for the
1479 # future
1480 .IF "$(BUILD_STATIC)"=="define"
1481 rebasePE : Extensions $(PERLDLL) Extensions_normalize $(PERLEXE) $(PERLEXESTATIC)
1482 .ELSE
1483 rebasePE : Extensions $(PERLDLL) Extensions_normalize $(PERLEXE)
1484 .ENDIF
1485         $(NOOP)
1486
1487 #-------------------------------------------------------------------------------
1488
1489
1490 doc: $(PERLEXE) $(PERLDLL) ..\pod\perltoc.pod
1491         $(PERLEXE) ..\installhtml --podroot=.. --htmldir=$(HTMLDIR) \
1492             --podpath=pod:lib:utils --htmlroot="file://$(INST_HTML:s,:,|,)"\
1493             --recurse
1494
1495 ..\utils\Makefile: $(CONFIGPM) ..\utils\Makefile.PL
1496         $(MINIPERL) -I..\lib ..\utils\Makefile.PL ..
1497
1498 # Note that this next section is parsed (and regenerated) by pod/buildtoc
1499 # so please check that script before making structural changes here
1500 utils: $(HAVEMINIPERL) ..\utils\Makefile
1501         cd ..\utils && $(PLMAKE) PERL=$(MINIPERL)
1502         copy ..\README.aix      ..\pod\perlaix.pod
1503         copy ..\README.amiga    ..\pod\perlamiga.pod
1504         copy ..\README.android  ..\pod\perlandroid.pod
1505         copy ..\README.bs2000   ..\pod\perlbs2000.pod
1506         copy ..\README.ce       ..\pod\perlce.pod
1507         copy ..\README.cn       ..\pod\perlcn.pod
1508         copy ..\README.cygwin   ..\pod\perlcygwin.pod
1509         copy ..\README.dos      ..\pod\perldos.pod
1510         copy ..\README.freebsd  ..\pod\perlfreebsd.pod
1511         copy ..\README.haiku    ..\pod\perlhaiku.pod
1512         copy ..\README.hpux     ..\pod\perlhpux.pod
1513         copy ..\README.hurd     ..\pod\perlhurd.pod
1514         copy ..\README.irix     ..\pod\perlirix.pod
1515         copy ..\README.jp       ..\pod\perljp.pod
1516         copy ..\README.ko       ..\pod\perlko.pod
1517         copy ..\README.linux    ..\pod\perllinux.pod
1518         copy ..\README.macos    ..\pod\perlmacos.pod
1519         copy ..\README.macosx   ..\pod\perlmacosx.pod
1520         copy ..\README.netware  ..\pod\perlnetware.pod
1521         copy ..\README.openbsd  ..\pod\perlopenbsd.pod
1522         copy ..\README.os2      ..\pod\perlos2.pod
1523         copy ..\README.os390    ..\pod\perlos390.pod
1524         copy ..\README.os400    ..\pod\perlos400.pod
1525         copy ..\README.plan9    ..\pod\perlplan9.pod
1526         copy ..\README.qnx      ..\pod\perlqnx.pod
1527         copy ..\README.riscos   ..\pod\perlriscos.pod
1528         copy ..\README.solaris  ..\pod\perlsolaris.pod
1529         copy ..\README.symbian  ..\pod\perlsymbian.pod
1530         copy ..\README.synology ..\pod\perlsynology.pod
1531         copy ..\README.tru64    ..\pod\perltru64.pod
1532         copy ..\README.tw       ..\pod\perltw.pod
1533         copy ..\README.vos      ..\pod\perlvos.pod
1534         copy ..\README.win32    ..\pod\perlwin32.pod
1535         copy ..\pod\perldelta.pod ..\pod\perl5257delta.pod
1536         $(MINIPERL) -I..\lib $(PL2BAT) $(UTILS)
1537         $(MINIPERL) -I..\lib ..\autodoc.pl ..
1538         $(MINIPERL) -I..\lib ..\pod\perlmodlib.PL -q ..
1539
1540 ..\pod\perltoc.pod: $(PERLEXE) $(PERLDLL) Extensions Extensions_nonxs Extensions_normalize utils
1541         $(PERLEXE) -f ..\pod\buildtoc -q
1542
1543 # Note that the pod cleanup in this next section is parsed (and regenerated
1544 # by pod/buildtoc so please check that script before making changes here
1545
1546 distclean: realclean
1547         -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \
1548                 $(PERLIMPLIB) ..\miniperl$(a) $(PERLEXESTATIC) $(PERLSTATICLIB)
1549         -del /f $(LIBDIR)\Encode.pm $(LIBDIR)\encoding.pm $(LIBDIR)\Errno.pm
1550         -del /f $(LIBDIR)\Config.pod $(LIBDIR)\POSIX.pod $(LIBDIR)\threads.pm
1551         -del /f $(LIBDIR)\.exists $(LIBDIR)\attributes.pm $(LIBDIR)\DynaLoader.pm
1552         -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
1553         -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm
1554         -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
1555         -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
1556         -del /f $(LIBDIR)\File\Glob.pm
1557         -del /f $(LIBDIR)\Storable.pm
1558         -del /f $(LIBDIR)\Sys\Hostname.pm
1559         -del /f $(LIBDIR)\Time\HiRes.pm
1560         -del /f $(LIBDIR)\Unicode\Normalize.pm
1561         -del /f $(LIBDIR)\Math\BigInt\FastCalc.pm
1562         -del /f $(LIBDIR)\Win32.pm
1563         -del /f $(LIBDIR)\Win32CORE.pm
1564         -del /f $(LIBDIR)\Win32API\File.pm
1565         -del /f $(LIBDIR)\Win32API\File\cFile.pc
1566         -del /f $(LIBDIR)\buildcustomize.pl
1567         -del /f $(DISTDIR)\XSLoader\XSLoader.pm
1568         -del /f *.def *.map
1569         -if exist $(LIBDIR)\Amiga rmdir /s /q $(LIBDIR)\Amiga
1570         -if exist $(LIBDIR)\App rmdir /s /q $(LIBDIR)\App
1571         -if exist $(LIBDIR)\Archive rmdir /s /q $(LIBDIR)\Archive
1572         -if exist $(LIBDIR)\Attribute rmdir /s /q $(LIBDIR)\Attribute
1573         -if exist $(LIBDIR)\autodie rmdir /s /q $(LIBDIR)\autodie
1574         -if exist $(LIBDIR)\Carp rmdir /s /q $(LIBDIR)\Carp
1575         -if exist $(LIBDIR)\Compress rmdir /s /q $(LIBDIR)\Compress
1576         -if exist $(LIBDIR)\Config\Perl rmdir /s /q $(LIBDIR)\Config\Perl
1577         -if exist $(LIBDIR)\CPAN rmdir /s /q $(LIBDIR)\CPAN
1578         -if exist $(LIBDIR)\Data rmdir /s /q $(LIBDIR)\Data
1579         -if exist $(LIBDIR)\Devel rmdir /s /q $(LIBDIR)\Devel
1580         -if exist $(LIBDIR)\Digest rmdir /s /q $(LIBDIR)\Digest
1581         -if exist $(LIBDIR)\Encode rmdir /s /q $(LIBDIR)\Encode
1582         -if exist $(LIBDIR)\encoding rmdir /s /q $(LIBDIR)\encoding
1583         -if exist $(LIBDIR)\Exporter rmdir /s /q $(LIBDIR)\Exporter
1584         -if exist $(LIBDIR)\ExtUtils\CBuilder rmdir /s /q $(LIBDIR)\ExtUtils\CBuilder
1585         -if exist $(LIBDIR)\ExtUtils\Command rmdir /s /q $(LIBDIR)\ExtUtils\Command
1586         -if exist $(LIBDIR)\ExtUtils\Constant rmdir /s /q $(LIBDIR)\ExtUtils\Constant
1587         -if exist $(LIBDIR)\ExtUtils\Liblist rmdir /s /q $(LIBDIR)\ExtUtils\Liblist
1588         -if exist $(LIBDIR)\ExtUtils\MakeMaker rmdir /s /q $(LIBDIR)\ExtUtils\MakeMaker
1589         -if exist $(LIBDIR)\ExtUtils\ParseXS rmdir /s /q $(LIBDIR)\ExtUtils\ParseXS
1590         -if exist $(LIBDIR)\ExtUtils\Typemaps rmdir /s /q $(LIBDIR)\ExtUtils\Typemaps
1591         -if exist $(LIBDIR)\File\Spec rmdir /s /q $(LIBDIR)\File\Spec
1592         -if exist $(LIBDIR)\Filter rmdir /s /q $(LIBDIR)\Filter
1593         -if exist $(LIBDIR)\Hash rmdir /s /q $(LIBDIR)\Hash
1594         -if exist $(LIBDIR)\HTTP rmdir /s /q $(LIBDIR)\HTTP
1595         -if exist $(LIBDIR)\I18N rmdir /s /q $(LIBDIR)\I18N
1596         -if exist $(LIBDIR)\inc rmdir /s /q $(LIBDIR)\inc
1597         -if exist $(LIBDIR)\IO rmdir /s /q $(LIBDIR)\IO
1598         -if exist $(LIBDIR)\IPC rmdir /s /q $(LIBDIR)\IPC
1599         -if exist $(LIBDIR)\JSON rmdir /s /q $(LIBDIR)\JSON
1600         -if exist $(LIBDIR)\List rmdir /s /q $(LIBDIR)\List
1601         -if exist $(LIBDIR)\Locale rmdir /s /q $(LIBDIR)\Locale
1602         -if exist $(LIBDIR)\Math rmdir /s /q $(LIBDIR)\Math
1603         -if exist $(LIBDIR)\Memoize rmdir /s /q $(LIBDIR)\Memoize
1604         -if exist $(LIBDIR)\MIME rmdir /s /q $(LIBDIR)\MIME
1605         -if exist $(LIBDIR)\Module rmdir /s /q $(LIBDIR)\Module
1606         -if exist $(LIBDIR)\Net\FTP rmdir /s /q $(LIBDIR)\Net\FTP
1607         -if exist $(LIBDIR)\Params rmdir /s /q $(LIBDIR)\Params
1608         -if exist $(LIBDIR)\Parse rmdir /s /q $(LIBDIR)\Parse
1609         -if exist $(LIBDIR)\Perl rmdir /s /q $(LIBDIR)\Perl
1610         -if exist $(LIBDIR)\PerlIO rmdir /s /q $(LIBDIR)\PerlIO
1611         -if exist $(LIBDIR)\Pod\Perldoc rmdir /s /q $(LIBDIR)\Pod\Perldoc
1612         -if exist $(LIBDIR)\Pod\Simple rmdir /s /q $(LIBDIR)\Pod\Simple
1613         -if exist $(LIBDIR)\Pod\Text rmdir /s /q $(LIBDIR)\Pod\Text
1614         -if exist $(LIBDIR)\Scalar rmdir /s /q $(LIBDIR)\Scalar
1615         -if exist $(LIBDIR)\Search rmdir /s /q $(LIBDIR)\Search
1616         -if exist $(LIBDIR)\Sub rmdir /s /q $(LIBDIR)\Sub
1617         -if exist $(LIBDIR)\Sys rmdir /s /q $(LIBDIR)\Sys
1618         -if exist $(LIBDIR)\TAP rmdir /s /q $(LIBDIR)\TAP
1619         -if exist $(LIBDIR)\Term rmdir /s /q $(LIBDIR)\Term
1620         -if exist $(LIBDIR)\Test rmdir /s /q $(LIBDIR)\Test
1621         -if exist $(LIBDIR)\Test2 rmdir /s /q $(LIBDIR)\Test2
1622         -if exist $(LIBDIR)\Text rmdir /s /q $(LIBDIR)\Text
1623         -if exist $(LIBDIR)\Thread rmdir /s /q $(LIBDIR)\Thread
1624         -if exist $(LIBDIR)\threads rmdir /s /q $(LIBDIR)\threads
1625         -if exist $(LIBDIR)\Tie\Hash rmdir /s /q $(LIBDIR)\Tie\Hash
1626         -if exist $(LIBDIR)\Unicode\Collate rmdir /s /q $(LIBDIR)\Unicode\Collate
1627         -if exist $(LIBDIR)\Unicode\Collate\Locale rmdir /s /q $(LIBDIR)\Unicode\Collate\Locale
1628         -if exist $(LIBDIR)\version rmdir /s /q $(LIBDIR)\version
1629         -if exist $(LIBDIR)\VMS rmdir /s /q $(LIBDIR)\VMS
1630         -if exist $(LIBDIR)\Win32API rmdir /s /q $(LIBDIR)\Win32API
1631         -if exist $(LIBDIR)\XS rmdir /s /q $(LIBDIR)\XS
1632         -cd $(PODDIR) && del /f *.html *.bat roffitall \
1633             perl5257delta.pod perlaix.pod perlamiga.pod perlandroid.pod \
1634             perlapi.pod perlbs2000.pod perlce.pod perlcn.pod perlcygwin.pod \
1635             perldos.pod perlfreebsd.pod perlhaiku.pod perlhpux.pod \
1636             perlhurd.pod perlintern.pod perlirix.pod perljp.pod perlko.pod \
1637             perllinux.pod perlmacos.pod perlmacosx.pod perlmodlib.pod \
1638             perlnetware.pod perlopenbsd.pod perlos2.pod perlos390.pod \
1639             perlos400.pod perlplan9.pod perlqnx.pod perlriscos.pod \
1640             perlsolaris.pod perlsymbian.pod perlsynology.pod perltoc.pod \
1641             perltru64.pod perltw.pod perluniprops.pod perlvos.pod \
1642             perlwin32.pod
1643         -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph pstruct h2xs \
1644             perldoc perlivp libnetcfg enc2xs encguess piconv cpan *.bat \
1645             xsubpp pod2html instmodsh json_pp prove ptar ptardiff ptargrep shasum corelist zipdetails
1646         -del /f ..\config.sh perlmain.c dlutils.c config.h.new \
1647             perlmainst.c
1648         -del /f $(CONFIGPM)
1649         -del /f ..\lib\Config_git.pl
1650         -del /f bin\*.bat
1651         -del /f perllibst.h
1652         -del /f $(PERLEXE_RES) perl.base
1653         -cd .. && del /s *$(a) *.map *.pdb *.ilk *.bs *$(o) .exists pm_to_blib ppport.h
1654         -cd $(EXTDIR) && del /s *.def Makefile Makefile.old
1655         -cd $(DISTDIR) && del /s *.def Makefile Makefile.old
1656         -cd $(CPANDIR) && del /s *.def Makefile Makefile.old
1657         -del /s ..\utils\Makefile
1658         -if exist $(AUTODIR) rmdir /s /q $(AUTODIR)
1659         -if exist $(COREDIR) rmdir /s /q $(COREDIR)
1660         -if exist pod2htmd.tmp del pod2htmd.tmp
1661         -if exist $(HTMLDIR) rmdir /s /q $(HTMLDIR)
1662         -del /f ..\t\test_state
1663
1664 install : all installbare installhtml
1665
1666 installbare : utils ..\pod\perltoc.pod
1667         $(PERLEXE) ..\installperl
1668         if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\*.*
1669         if exist $(PERLEXESTATIC) $(XCOPY) $(PERLEXESTATIC) $(INST_BIN)\*.*
1670         $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
1671         if exist ..\perl*.pdb $(XCOPY) ..\perl*.pdb $(INST_BIN)\*.*
1672         $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.*
1673
1674 installhtml : doc
1675         $(RCOPY) $(HTMLDIR)\*.* $(INST_HTML)\*.*
1676
1677 inst_lib : $(CONFIGPM)
1678         $(RCOPY) ..\lib $(INST_LIB)\*.*
1679
1680 $(UNIDATAFILES) ..\pod\perluniprops.pod .UPDATEALL : ..\lib\unicore\mktables $(CONFIGPM)
1681         $(MINIPERL) -I..\lib ..\lib\unicore\mktables -C ..\lib\unicore -P ..\pod -maketest -makelist -p
1682
1683 minitest : .\config.h $(HAVEMINIPERL) ..\git_version.h $(GLOBEXE) $(CONFIGPM) $(UNIDATAFILES) $(TESTPREPGCC)
1684         $(XCOPY) $(MINIPERL) ..\t\$(NULL)
1685         if exist ..\t\perl.exe del /f ..\t\perl.exe
1686         rename ..\t\miniperl.exe perl.exe
1687         $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1688 # Note this perl.exe is miniperl
1689         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
1690
1691 test-prep : all utils ..\pod\perltoc.pod $(TESTPREPGCC)
1692         $(XCOPY) $(PERLEXE) ..\t\$(NULL) && $(XCOPY) $(PERLDLL) ..\t\$(NULL) \
1693         && $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1694
1695 # If building with gcc versions 4.x.x or greater, then
1696 # the GCC helper DLL will also need copied to the test directory.
1697 # The name of the dll can change, depending upon which vendor has supplied
1698 # your compiler, and upon the values of "x".
1699 # libstdc++-6.dll is copied if it exists as it, too, may then be needed.
1700 # Without this copying, the op/taint.t test script will fail.
1701
1702 .IF "$(CCTYPE)" == "GCC"
1703
1704 test-prep-gcc :
1705         if exist $(CCDLLDIR)\libgcc_s_seh-1.dll $(XCOPY) $(CCDLLDIR)\libgcc_s_seh-1.dll ..\t\$(NULL)
1706         if exist $(CCDLLDIR)\libgcc_s_sjlj-1.dll $(XCOPY) $(CCDLLDIR)\libgcc_s_sjlj-1.dll ..\t\$(NULL)
1707         if exist $(CCDLLDIR)\libgcc_s_dw2-1.dll $(XCOPY) $(CCDLLDIR)\libgcc_s_dw2-1.dll ..\t\$(NULL)
1708         if exist $(CCDLLDIR)\libstdc++-6.dll $(XCOPY) $(CCDLLDIR)\libstdc++-6.dll ..\t\$(NULL)
1709         if exist $(CCDLLDIR)\libwinpthread-1.dll $(XCOPY) $(CCDLLDIR)\libwinpthread-1.dll ..\t\$(NULL)
1710
1711 .ENDIF
1712
1713 test : test-prep
1714         set PERL_STATIC_EXT=$(STATIC_EXT) && \
1715             cd ..\t && perl.exe harness $(TEST_SWITCHES) $(TEST_FILES)
1716
1717 test_porting : test-prep
1718         set PERL_STATIC_EXT=$(STATIC_EXT) && \
1719             cd ..\t && perl.exe harness $(TEST_SWITCHES) porting\*.t ..\lib\diagnostics.t
1720
1721 test-reonly : reonly utils
1722         $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1723         $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1724         $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1725         cd ..\t && perl.exe harness $(OPT) -re \bpat\\/ $(EXTRA)
1726
1727 regen :
1728         cd .. && regen.pl
1729
1730 test-notty : test-prep
1731         set PERL_STATIC_EXT=$(STATIC_EXT) && \
1732             set PERL_SKIP_TTY_TEST=1 && \
1733             cd ..\t && perl.exe harness $(TEST_SWITCHES) $(TEST_FILES)
1734
1735 _test :
1736         $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1737         $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1738         $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1739         set PERL_STATIC_EXT=$(STATIC_EXT) && \
1740             cd ..\t && perl.exe harness $(TEST_SWITCHES) $(TEST_FILES)
1741
1742 _clean :
1743         -@erase miniperlmain$(o)
1744         -@erase $(MINIPERL)
1745         -@erase perlglob$(o)
1746         -@erase perlmain$(o)
1747         -@erase perlmainst$(o)
1748         -@erase /f config.h
1749         -@erase /f ..\git_version.h
1750         -@erase $(GLOBEXE)
1751         -@erase $(PERLEXE)
1752         -@erase $(WPERLEXE)
1753         -@erase $(PERLEXESTATIC)
1754         -@erase $(PERLSTATICLIB)
1755         -@erase $(PERLDLL)
1756         -@erase $(CORE_OBJ)
1757         -@erase $(GENUUDMAP) $(GENUUDMAP_OBJ) $(GENERATED_HEADERS)
1758         -@erase .coreheaders
1759         -if exist $(MINIDIR) rmdir /s /q $(MINIDIR)
1760         -if exist $(UNIDATADIR1) rmdir /s /q $(UNIDATADIR1)
1761         -if exist $(UNIDATADIR2) rmdir /s /q $(UNIDATADIR2)
1762         -@erase $(UNIDATAFILES)
1763         -@erase $(WIN32_OBJ)
1764         -@erase $(DLL_OBJ)
1765         -@erase ..\*$(o) ..\*$(a) ..\*.exp *$(o) *$(a) *.exp *.res
1766         -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
1767         -@erase *.ilk
1768         -@erase *.pdb ..\*.pdb
1769         -@erase Extensions_static
1770
1771 clean : Extensions_clean _clean
1772
1773 realclean : Extensions_realclean _clean
1774
1775 # Handy way to run perlbug -ok without having to install and run the
1776 # installed perlbug. We don't re-run the tests here - we trust the user.
1777 # Please *don't* use this unless all tests pass.
1778 # If you want to report test failures, use "dmake nok" instead.
1779 ok: utils $(PERLEXE) $(PERLDLL) Extensions_nonxs Extensions
1780         $(PERLEXE) ..\utils\perlbug -ok -s "(UNINSTALLED)"
1781
1782 okfile: utils $(PERLEXE) $(PERLDLL) Extensions_nonxs Extensions
1783         $(PERLEXE) ..\utils\perlbug -ok -s "(UNINSTALLED)" -F perl.ok
1784
1785 nok: utils $(PERLEXE) $(PERLDLL) Extensions_nonxs Extensions
1786         $(PERLEXE) ..\utils\perlbug -nok -s "(UNINSTALLED)"
1787
1788 nokfile: utils $(PERLEXE) $(PERLDLL) Extensions_nonxs Extensions
1789         $(PERLEXE) ..\utils\perlbug -nok -s "(UNINSTALLED)" -F perl.nok
1790