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