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