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