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