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