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