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