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