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