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