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