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