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