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