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