This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
better perl version output in corelist-diff
[perl5.git] / win32 / Makefile
1 #
2 # Makefile to build perl on Windows NT using Microsoft NMAKE.
3 # Supported compilers:
4 #       Visual C++ 2.0 or later
5 #       MS Platform SDK 64-bit compiler and tools
6 #
7 # This is set up to build a perl.exe that runs off a shared library
8 # (perl511.dll).  Also makes individual DLLs for the XS extensions.
9 #
10
11 ##
12 ## Make sure you read README.win32 *before* you mess with anything here!
13 ##
14
15 ##
16 ## Build configuration.  Edit the values below to suit your needs.
17 ##
18
19 #
20 # Set these to wherever you want "nmake install" to put your
21 # newly built perl.
22 #
23 INST_DRV        = c:
24 INST_TOP        = $(INST_DRV)\perl
25
26 #
27 # Uncomment if you want to build a 32-bit Perl using a 32-bit compiler
28 # on a 64-bit version of Windows.
29 #WIN64          = undef
30
31 #
32 # Comment this out if you DON'T want your perl installation to be versioned.
33 # This means that the new installation will overwrite any files from the
34 # old installation at the same INST_TOP location.  Leaving it enabled is
35 # the safest route, as perl adds the extra version directory to all the
36 # locations it installs files to.  If you disable it, an alternative
37 # versioned installation can be obtained by setting INST_TOP above to a
38 # path that includes an arbitrary version string.
39 #
40 #INST_VER       = \5.11.5
41
42 #
43 # Comment this out if you DON'T want your perl installation to have
44 # architecture specific components.  This means that architecture-
45 # specific files will be installed along with the architecture-neutral
46 # files.  Leaving it enabled is safer and more flexible, in case you
47 # want to build multiple flavors of perl and install them together in
48 # the same location.  Commenting it out gives you a simpler
49 # installation that is easier to understand for beginners.
50 #
51 #INST_ARCH      = \$(ARCHNAME)
52
53 #
54 # Uncomment this if you want perl to run
55 #       $Config{sitelibexp}\sitecustomize.pl
56 # before anything else.  This script can then be set up, for example,
57 # to add additional entries to @INC.
58 #
59 #USE_SITECUST   = define
60
61 #
62 # uncomment to enable multiple interpreters.  This is need for fork()
63 # emulation and for thread support.
64 #
65 USE_MULTI       = define
66
67 #
68 # Beginnings of interpreter cloning/threads; now reasonably complete.
69 # This should be enabled to get the fork() emulation.  This needs
70 # USE_MULTI as well.
71 #
72 USE_ITHREADS    = define
73
74 #
75 # uncomment to enable the implicit "host" layer for all system calls
76 # made by perl.  This needs USE_MULTI above.  This is also needed to
77 # get fork().
78 #
79 USE_IMP_SYS     = define
80
81 #
82 # Comment out next assign to disable perl's I/O subsystem and use compiler's 
83 # stdio for IO - depending on your compiler vendor and run time library you may 
84 # then get a number of fails from make test i.e. bugs - complain to them not us ;-). 
85 # You will also be unable to take full advantage of perl5.8's support for multiple 
86 # encodings and may see lower IO performance. You have been warned.
87 USE_PERLIO      = define
88
89 #
90 # Comment this out if you don't want to enable large file support for
91 # some reason.  Should normally only be changed to maintain compatibility
92 # with an older release of perl.
93 USE_LARGE_FILES = define
94
95 #
96 # uncomment exactly one of the following
97 #
98 # Visual C++ 2.x
99 #CCTYPE         = MSVC20
100 # Visual C++ > 2.x and < 6.x
101 #CCTYPE         = MSVC
102 # Visual C++ 6.x (aka Visual C++ 98)
103 CCTYPE          = MSVC60
104 # Visual C++ Toolkit 2003 (aka Visual C++ 7.x) (free command-line tools)
105 #CCTYPE         = MSVC70FREE
106 # Visual C++ .NET 2003 (aka Visual C++ 7.x) (full version)
107 #CCTYPE         = MSVC70
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
117 #
118 # uncomment next line if you want debug version of perl (big,slow)
119 # If not enabled, we automatically try to use maximum optimization
120 # with all compilers that are known to have a working optimizer.
121 #
122 #CFG            = Debug
123
124 #
125 # uncomment to enable use of PerlCRT.DLL when using the Visual C compiler.
126 # It has patches that fix known bugs in older versions of MSVCRT.DLL.
127 # This currently requires VC 5.0 with Service Pack 3 or later.
128 # Get it from CPAN at http://www.cpan.org/authors/id/D/DO/DOUGL/
129 # and follow the directions in the package to install.
130 #
131 # Not recommended if you have VC 6.x and you're not running Windows 9x.
132 #
133 #USE_PERLCRT    = define
134
135 #
136 # uncomment to enable linking with setargv.obj under the Visual C
137 # compiler. Setting this options enables perl to expand wildcards in
138 # arguments, but it may be harder to use alternate methods like
139 # File::DosGlob that are more powerful.  This option is supported only with
140 # Visual C.
141 #
142 #USE_SETARGV    = define
143
144 #
145 # if you want to have the crypt() builtin function implemented, leave this or
146 # CRYPT_LIB uncommented.  The fcrypt.c file named here contains a suitable
147 # version of des_fcrypt().
148 #
149 CRYPT_SRC       = fcrypt.c
150
151 #
152 # if you didn't set CRYPT_SRC and if you have des_fcrypt() available in a
153 # library, uncomment this, and make sure the library exists (see README.win32)
154 # Specify the full pathname of the library.
155 #
156 #CRYPT_LIB      = fcrypt.lib
157
158 #
159 # set this if you wish to use perl's malloc
160 # WARNING: Turning this on/off WILL break binary compatibility with extensions
161 # you may have compiled with/without it.  Be prepared to recompile all
162 # extensions if you change the default.  Currently, this cannot be enabled
163 # if you ask for USE_IMP_SYS above.
164 #
165 #PERL_MALLOC    = define
166
167 #
168 # set this to enable debugging mstats
169 # This must be enabled to use the Devel::Peek::mstat() function.  This cannot
170 # be enabled without PERL_MALLOC as well.
171 #
172 #DEBUG_MSTATS   = define
173
174 #
175 # set this to additionally provide a statically linked perl-static.exe.
176 # Note that dynamic loading will not work with this perl, so you must
177 # include required modules statically using the STATIC_EXT or ALL_STATIC
178 # variables below. A static library perl511s.lib will also be created.
179 # Ordinary perl.exe is not affected by this option.
180 #
181 #BUILD_STATIC   = define
182
183 #
184 # in addition to BUILD_STATIC the option ALL_STATIC makes *every*
185 # extension get statically built
186 # This will result in a very large perl executable, but the main purpose
187 # is to have proper linking set so as to be able to create miscellaneous
188 # executables with different built-in extensions
189 #
190 #ALL_STATIC     = define
191
192 #
193 #
194 # set the install locations of the compiler include/libraries
195 # Running VCVARS32.BAT is *required* when using Visual C.
196 # Some versions of Visual C don't define MSVCDIR in the environment,
197 # so you may have to set CCHOME explicitly (spaces in the path name should
198 # not be quoted)
199 #
200 #CCHOME         = f:\msvc20
201 CCHOME          = $(MSVCDIR)
202 CCINCDIR        = $(CCHOME)\include
203 CCLIBDIR        = $(CCHOME)\lib
204
205 #
206 # Additional compiler flags can be specified here.
207 #
208 BUILDOPT        = $(BUILDOPTEXTRA)
209
210 #
211 # Adding -DPERL_HASH_SEED_EXPLICIT will disable randomization of Perl's
212 # internal hash function unless the PERL_HASH_SEED environment variable is set.
213 # Alternatively, adding -DNO_HASH_SEED will completely disable the
214 # randomization feature. 
215 # The latter is required to maintain binary compatibility with Perl 5.8.0.
216 #
217 #BUILDOPT       = $(BUILDOPT) -DPERL_HASH_SEED_EXPLICIT
218 #BUILDOPT       = $(BUILDOPT) -DNO_HASH_SEED
219
220 #
221 # This should normally be disabled.  Adding -DPERL_POLLUTE enables support
222 # for old symbols by default, at the expense of extreme pollution.  You most
223 # probably just want to build modules that won't compile with
224 #         perl Makefile.PL POLLUTE=1
225 # instead of enabling this.  Please report such modules to the respective
226 # authors.
227 #
228 #BUILDOPT       = $(BUILDOPT) -DPERL_POLLUTE
229
230 #
231 # This should normally be disabled.  Enabling it will disable the File::Glob
232 # implementation of CORE::glob.
233 #
234 #BUILDOPT       = $(BUILDOPT) -DPERL_EXTERNAL_GLOB
235
236 #
237 # This should normally be disabled.  Enabling it causes perl to read scripts
238 # in text mode (which is the 5.005 behavior) and will break ByteLoader.
239 #
240 #BUILDOPT       = $(BUILDOPT) -DPERL_TEXTMODE_SCRIPTS
241
242 #
243 # specify semicolon-separated list of extra directories that modules will
244 # look for libraries (spaces in path names need not be quoted)
245 #
246 EXTRALIBDIRS    =
247
248 #
249 # set this to your email address (perl will guess a value from
250 # from your loginname and your hostname, which may not be right)
251 #
252 #EMAIL          =
253
254 ##
255 ## Build configuration ends.
256 ##
257
258 ##################### CHANGE THESE ONLY IF YOU MUST #####################
259
260 !IF "$(CRYPT_SRC)$(CRYPT_LIB)" == ""
261 D_CRYPT         = undef
262 !ELSE
263 D_CRYPT         = define
264 CRYPT_FLAG      = -DHAVE_DES_FCRYPT
265 !ENDIF
266
267 !IF "$(USE_IMP_SYS)" == "define"
268 PERL_MALLOC     = undef
269 DEBUG_MSTATS    = undef
270 !ENDIF
271
272 !IF "$(PERL_MALLOC)" == ""
273 PERL_MALLOC     = undef
274 DEBUG_MSTATS    = undef
275 !ENDIF
276
277 !IF "$(DEBUG_MSTATS)" == ""
278 DEBUG_MSTATS    = undef
279 !ENDIF
280
281 !IF "$(DEBUG_MSTATS)" == "define"
282 BUILDOPT        = $(BUILDOPT) -DPERL_DEBUGGING_MSTATS
283 !ENDIF
284
285 !IF "$(USE_SITECUST)" == ""
286 USE_SITECUST    = undef
287 !ENDIF
288
289 !IF "$(USE_MULTI)" == ""
290 USE_MULTI       = undef
291 !ENDIF
292
293 !IF "$(USE_ITHREADS)" == ""
294 USE_ITHREADS    = undef
295 !ENDIF
296
297 !IF "$(USE_IMP_SYS)" == ""
298 USE_IMP_SYS     = undef
299 !ENDIF
300
301 !IF "$(USE_PERLIO)" == ""
302 USE_PERLIO      = undef
303 !ENDIF
304
305 !IF "$(USE_LARGE_FILES)" == ""
306 USE_LARGE_FILES = undef
307 !ENDIF
308
309 !IF "$(USE_PERLCRT)" == ""
310 USE_PERLCRT     = undef
311 !ENDIF
312
313 !IF "$(USE_IMP_SYS)$(USE_MULTI)" == "defineundef"
314 USE_MULTI       = define
315 !ENDIF
316
317 !IF "$(USE_ITHREADS)$(USE_MULTI)" == "defineundef"
318 USE_MULTI       = define
319 !ENDIF
320
321 !IF "$(USE_SITECUST)" == "define"
322 BUILDOPT        = $(BUILDOPT) -DUSE_SITECUSTOMIZE
323 !ENDIF
324
325 !IF "$(USE_MULTI)" != "undef"
326 BUILDOPT        = $(BUILDOPT) -DPERL_IMPLICIT_CONTEXT
327 !ENDIF
328
329 !IF "$(USE_IMP_SYS)" != "undef"
330 BUILDOPT        = $(BUILDOPT) -DPERL_IMPLICIT_SYS
331 !ENDIF
332
333 !IF "$(PROCESSOR_ARCHITECTURE)" == ""
334 PROCESSOR_ARCHITECTURE  = x86
335 !ENDIF
336
337 !IF "$(WIN64)" == ""
338 # When we are running from a 32bit cmd.exe on AMD64 then
339 # PROCESSOR_ARCHITECTURE is set to x86 and PROCESSOR_ARCHITEW6432
340 # is set to AMD64
341 !IF "$(PROCESSOR_ARCHITEW6432)" != ""
342 PROCESSOR_ARCHITECTURE  = $(PROCESSOR_ARCHITEW6432)
343 WIN64                   = define
344 !ELSE
345 !IF "$(PROCESSOR_ARCHITECTURE)" == "AMD64" || "$(PROCESSOR_ARCHITECTURE)" == "IA64"
346 WIN64                   = define
347 !ELSE
348 WIN64                   = undef
349 !ENDIF
350 !ENDIF
351 !ENDIF
352
353 ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
354 !IF "$(ARCHITECTURE)" == "AMD64"
355 ARCHITECTURE    = x64
356 !ENDIF
357 !IF "$(ARCHITECTURE)" == "IA64"
358 ARCHITECTURE    = ia64
359 !ENDIF
360
361 !IF "$(USE_MULTI)" == "define"
362 ARCHNAME        = MSWin32-$(ARCHITECTURE)-multi
363 !ELSE
364 !IF "$(USE_PERLIO)" == "define"
365 ARCHNAME        = MSWin32-$(ARCHITECTURE)-perlio
366 !ELSE
367 ARCHNAME        = MSWin32-$(ARCHITECTURE)
368 !ENDIF
369 !ENDIF
370
371 !IF "$(USE_PERLIO)" == "define"
372 BUILDOPT        = $(BUILDOPT) -DUSE_PERLIO
373 !ENDIF
374
375 !IF "$(USE_ITHREADS)" == "define"
376 ARCHNAME        = $(ARCHNAME)-thread
377 !ENDIF
378
379 # Visual C++ 98, .NET 2003, 2005 and 2008 specific.
380 # VC++ 6.x, 7.x, 8.x and 9.x can load DLL's on demand.  Makes the test suite run
381 # in about 10% less time.  (The free version of 7.x can't do this, but the free
382 # versions of 8.x and 9.x can.)
383 !IF "$(CCTYPE)" == "MSVC60" || "$(CCTYPE)" == "MSVC70"     || \
384     "$(CCTYPE)" == "MSVC80" || "$(CCTYPE)" == "MSVC80FREE" || \
385     "$(CCTYPE)" == "MSVC90" || "$(CCTYPE)" == "MSVC90FREE"
386 DELAYLOAD       = -DELAYLOAD:ws2_32.dll delayimp.lib
387 !ENDIF
388
389 # Visual C++ 2005 and 2008 (VC++ 8.x and 9.x) create manifest files for EXEs and
390 # DLLs. These either need copying everywhere with the binaries, or else need
391 # embedding in them otherwise MSVCR80.dll or MSVCR90.dll won't be found. For
392 # simplicity, embed them if they exist (and delete them afterwards so that they
393 # don't get installed too).
394 EMBED_EXE_MANI  = if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1 && \
395                   if exist $@.manifest del $@.manifest
396 EMBED_DLL_MANI  = if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2 && \
397                   if exist $@.manifest del $@.manifest
398
399 ARCHDIR         = ..\lib\$(ARCHNAME)
400 COREDIR         = ..\lib\CORE
401 AUTODIR         = ..\lib\auto
402 LIBDIR          = ..\lib
403 EXTDIR          = ..\ext
404 DISTDIR         = ..\dist
405 CPANDIR         = ..\cpan
406 PODDIR          = ..\pod
407 EXTUTILSDIR     = $(LIBDIR)\ExtUtils
408 HTMLDIR         = .\html
409
410 #
411 INST_SCRIPT     = $(INST_TOP)$(INST_VER)\bin
412 INST_BIN        = $(INST_SCRIPT)$(INST_ARCH)
413 INST_LIB        = $(INST_TOP)$(INST_VER)\lib
414 INST_ARCHLIB    = $(INST_LIB)$(INST_ARCH)
415 INST_COREDIR    = $(INST_ARCHLIB)\CORE
416 INST_HTML       = $(INST_TOP)$(INST_VER)\html
417
418 #
419 # Programs to compile, build .lib files and link
420 #
421
422 CC              = cl
423 LINK32          = link
424 LIB32           = $(LINK32) -lib
425 RSC             = rc
426
427 #
428 # Options
429 #
430
431 INCLUDES        = -I$(COREDIR) -I.\include -I. -I..
432 #PCHFLAGS       = -Fpc:\temp\vcmoduls.pch -YX
433 DEFINES         = -DWIN32 -D_CONSOLE -DNO_STRICT $(CRYPT_FLAG)
434 LOCDEFS         = -DPERLDLL -DPERL_CORE
435 SUBSYS          = console
436 CXX_FLAG        = -TP -EHsc
437
438 !IF "$(USE_PERLCRT)" != "define"
439 LIBC    = msvcrt.lib
440 !ELSE
441 LIBC    = PerlCRT.lib
442 !ENDIF
443
444 !IF  "$(CFG)" == "Debug"
445 !  IF "$(CCTYPE)" == "MSVC20"
446 OPTIMIZE        = -Od -MD -Z7 -DDEBUGGING
447 !  ELSE
448 OPTIMIZE        = -Od -MD -Zi -DDEBUGGING
449 !  ENDIF
450 LINK_DBG        = -debug
451 !ELSE
452 OPTIMIZE        = -MD -Zi -DNDEBUG
453 # we enable debug symbols in release builds also
454 LINK_DBG        = -debug -opt:ref,icf
455 # you may want to enable this if you want COFF symbols in the executables
456 # in addition to the PDB symbols.  The default Dr. Watson that ships with
457 # Windows can use the the former but not latter.  The free WinDbg can be
458 # installed to get better stack traces from just the PDB symbols, so we
459 # avoid the bloat of COFF symbols by default.
460 #LINK_DBG       = $(LINK_DBG) -debugtype:both
461 !  IF "$(WIN64)" == "define"
462 # enable Whole Program Optimizations (WPO) and Link Time Code Generation (LTCG)
463 OPTIMIZE        = $(OPTIMIZE) -Ox -GL
464 LINK_DBG        = $(LINK_DBG) -ltcg
465 !  ELSE
466 # -O1 yields smaller code, which turns out to be faster than -O2 on x86
467 OPTIMIZE        = $(OPTIMIZE) -O1
468 #OPTIMIZE       = $(OPTIMIZE) -O2
469 !  ENDIF
470 !ENDIF
471
472 !IF "$(WIN64)" == "define"
473 DEFINES         = $(DEFINES) -DWIN64 -DCONSERVATIVE
474 OPTIMIZE        = $(OPTIMIZE) -Wp64 -fp:precise
475 !ENDIF
476
477 # For now, silence VC++ 8.x's and 9.x's warnings about "unsafe" CRT functions
478 # and POSIX CRT function names being deprecated.
479 !IF "$(CCTYPE)" == "MSVC80" || "$(CCTYPE)" == "MSVC80FREE" || \
480     "$(CCTYPE)" == "MSVC90" || "$(CCTYPE)" == "MSVC90FREE"
481 DEFINES         = $(DEFINES) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
482 !ENDIF
483
484 # Use the MSVCRT read() fix if the PerlCRT was not chosen, but only when using
485 # VC++ 6.x or earlier. Later versions use MSVCR70.dll, MSVCR71.dll, etc, which
486 # do not require the fix.
487 !IF "$(CCTYPE)" == "MSVC20" || "$(CCTYPE)" == "MSVC" || "$(CCTYPE)" == "MSVC60" 
488 !  IF "$(USE_PERLCRT)" != "define"
489 BUILDOPT        = $(BUILDOPT) -DPERL_MSVCRT_READFIX
490 !  ENDIF
491 !ENDIF
492
493 LIBBASEFILES    = $(CRYPT_LIB) \
494                 oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
495                 comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
496                 netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib \
497                 version.lib odbc32.lib odbccp32.lib comctl32.lib
498
499 # The 64 bit Platform SDK compilers contain a runtime library that doesn't
500 # include the buffer overrun verification code used by the /GS switch.
501 # Since the code links against libraries that are compiled with /GS, this
502 # "security cookie verification" must be included via bufferoverlow.lib.
503 !IF "$(WIN64)" == "define"
504 LIBBASEFILES    = $(LIBBASEFILES) bufferoverflowU.lib
505 !ENDIF
506
507 # we add LIBC here, since we may be using PerlCRT.dll
508 LIBFILES        = $(LIBBASEFILES) $(LIBC)
509
510 #EXTRACFLAGS    = -nologo -GF -W4 -wd4127 -wd4706
511 EXTRACFLAGS     = -nologo -GF -W3
512 CFLAGS          = $(EXTRACFLAGS) $(INCLUDES) $(DEFINES) $(LOCDEFS) \
513                 $(PCHFLAGS) $(OPTIMIZE)
514 LINK_FLAGS      = -nologo -nodefaultlib $(LINK_DBG) \
515                 -libpath:"$(INST_COREDIR)" \
516                 -machine:$(PROCESSOR_ARCHITECTURE)
517 LIB_FLAGS       = -nologo
518 OBJOUT_FLAG     = -Fo
519 EXEOUT_FLAG     = -Fe
520
521 CFLAGS_O        = $(CFLAGS) $(BUILDOPT)
522
523 !IF "$(CCTYPE)" == "MSVC80" || "$(CCTYPE)" == "MSVC80FREE" || \
524     "$(CCTYPE)" == "MSVC90" || "$(CCTYPE)" == "MSVC90FREE"
525 LINK_FLAGS      = $(LINK_FLAGS) "/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"
526 !ELSE
527 RSC_FLAGS       = -DINCLUDE_MANIFEST
528 !ENDIF
529
530
531 #################### do not edit below this line #######################
532 ############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
533
534 o = .obj
535
536 #
537 # Rules
538 #
539
540 .SUFFIXES : .c $(o) .dll .lib .exe .rc .res
541
542 .c$(o):
543         $(CC) -c -I$(<D) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $<
544
545 .y.c:
546         $(NOOP)
547
548 $(o).dll:
549         $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
550             -out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
551         $(EMBED_DLL_MANI)
552
553 .rc.res:
554         $(RSC) -i.. $(RSC_FLAGS) $<
555
556 #
557 # various targets
558
559 # makedef.pl must be updated if this changes, and this should normally
560 # only change when there is an incompatible revision of the public API.
561 PERLIMPLIB      = ..\perl511.lib
562 PERLSTATICLIB   = ..\perl511s.lib
563 PERLDLL         = ..\perl511.dll
564
565 MINIPERL        = ..\miniperl.exe
566 MINIDIR         = .\mini
567 PERLEXE         = ..\perl.exe
568 WPERLEXE        = ..\wperl.exe
569 PERLEXESTATIC   = ..\perl-static.exe
570 GLOBEXE         = ..\perlglob.exe
571 CONFIGPM        = ..\lib\Config.pm ..\lib\Config_heavy.pl
572 MINIMOD         = ..\lib\ExtUtils\Miniperl.pm
573 X2P             = ..\x2p\a2p.exe
574 GENUUDMAP       = ..\generate_uudmap.exe
575 !IF "$(BUILD_STATIC)" == "define"
576 PERLSTATIC      = static
577 !ELSE
578 PERLSTATIC      = 
579 !ENDIF
580   
581 # Unicode data files generated by mktables
582 FIRSTUNIFILE     = ..\lib\unicore\Decomposition.pl
583 UNIDATAFILES     = ..\lib\unicore\Decomposition.pl \
584                    ..\lib\unicore\CombiningClass.pl ..\lib\unicore\Name.pl \
585                    ..\lib\unicore\Heavy.pl ..\lib\unicore\mktables.lst \
586                    ..\lib\unicore\TestProp.pl
587
588 # Directories of Unicode data files generated by mktables
589 UNIDATADIR1     = ..\lib\unicore\To
590 UNIDATADIR2     = ..\lib\unicore\lib
591
592 PERLEXE_MANIFEST= .\perlexe.manifest
593 PERLEXE_ICO     = .\perlexe.ico
594 PERLEXE_RES     = .\perlexe.res
595 PERLDLL_RES     =
596
597 # Nominate a target which causes extensions to be re-built
598 # This used to be $(PERLEXE), but at worst it is the .dll that they depend
599 # on and really only the interface - i.e. the .def file used to export symbols
600 # from the .dll
601 PERLDEP         = perldll.def
602
603 PL2BAT          = bin\pl2bat.pl
604 GLOBBAT         = bin\perlglob.bat
605
606 UTILS           =                       \
607                 ..\utils\h2ph           \
608                 ..\utils\splain         \
609                 ..\utils\dprofpp        \
610                 ..\utils\perlbug        \
611                 ..\utils\pl2pm          \
612                 ..\utils\c2ph           \
613                 ..\utils\pstruct        \
614                 ..\utils\h2xs           \
615                 ..\utils\perldoc        \
616                 ..\utils\perlivp        \
617                 ..\utils\libnetcfg      \
618                 ..\utils\enc2xs         \
619                 ..\utils\piconv         \
620                 ..\utils\config_data    \
621                 ..\utils\corelist       \
622                 ..\utils\cpan           \
623                 ..\utils\xsubpp         \
624                 ..\utils\prove          \
625                 ..\utils\ptar           \
626                 ..\utils\ptardiff       \
627                 ..\utils\cpanp-run-perl \
628                 ..\utils\cpanp  \
629                 ..\utils\cpan2dist      \
630                 ..\utils\shasum         \
631                 ..\utils\instmodsh      \
632                 ..\pod\pod2html         \
633                 ..\pod\pod2latex        \
634                 ..\pod\pod2man          \
635                 ..\pod\pod2text         \
636                 ..\pod\pod2usage        \
637                 ..\pod\podchecker       \
638                 ..\pod\podselect        \
639                 ..\x2p\find2perl        \
640                 ..\x2p\psed             \
641                 ..\x2p\s2p              \
642                 bin\exetype.pl          \
643                 bin\runperl.pl          \
644                 bin\pl2bat.pl           \
645                 bin\perlglob.pl         \
646                 bin\search.pl
647
648 MAKE            = nmake -nologo
649 MAKE_BARE       = nmake
650
651 !IF "$(WIN64)" == "define"
652 CFGSH_TMPL      = config.vc64
653 CFGH_TMPL       = config_H.vc64
654 !ELSE
655 CFGSH_TMPL      = config.vc
656 CFGH_TMPL       = config_H.vc
657 !ENDIF
658
659 XCOPY           = xcopy /f /r /i /d /y
660 RCOPY           = xcopy /f /r /i /e /d /y
661 NOOP            = @rem
662 NULL            =
663
664 DEL             = del
665
666 MICROCORE_SRC   =               \
667                 ..\av.c         \
668                 ..\deb.c        \
669                 ..\doio.c       \
670                 ..\doop.c       \
671                 ..\dump.c       \
672                 ..\globals.c    \
673                 ..\gv.c         \
674                 ..\mro.c        \
675                 ..\hv.c         \
676                 ..\locale.c     \
677                 ..\mathoms.c    \
678                 ..\mg.c         \
679                 ..\numeric.c    \
680                 ..\op.c         \
681                 ..\pad.c        \
682                 ..\perl.c       \
683                 ..\perlapi.c    \
684                 ..\perly.c      \
685                 ..\pp.c         \
686                 ..\pp_ctl.c     \
687                 ..\pp_hot.c     \
688                 ..\pp_pack.c    \
689                 ..\pp_sort.c    \
690                 ..\pp_sys.c     \
691                 ..\reentr.c     \
692                 ..\regcomp.c    \
693                 ..\regexec.c    \
694                 ..\run.c        \
695                 ..\scope.c      \
696                 ..\sv.c         \
697                 ..\taint.c      \
698                 ..\toke.c       \
699                 ..\universal.c  \
700                 ..\utf8.c       \
701                 ..\util.c
702
703 EXTRACORE_SRC   = $(EXTRACORE_SRC) perllib.c
704
705 !IF "$(PERL_MALLOC)" == "define"
706 EXTRACORE_SRC   = $(EXTRACORE_SRC) ..\malloc.c
707 !ENDIF
708
709 EXTRACORE_SRC   = $(EXTRACORE_SRC) ..\perlio.c
710
711 WIN32_SRC       =               \
712                 .\win32.c       \
713                 .\win32sck.c    \
714                 .\win32thread.c
715
716 # We need this for miniperl build unless we override canned 
717 # config.h #define building mini\*
718 #!IF "$(USE_PERLIO)" == "define"
719 WIN32_SRC       = $(WIN32_SRC) .\win32io.c
720 #!ENDIF
721
722 !IF "$(CRYPT_SRC)" != ""
723 WIN32_SRC       = $(WIN32_SRC) .\$(CRYPT_SRC)
724 !ENDIF
725
726 X2P_SRC         =               \
727                 ..\x2p\a2p.c    \
728                 ..\x2p\hash.c   \
729                 ..\x2p\str.c    \
730                 ..\x2p\util.c   \
731                 ..\x2p\walk.c
732
733 CORE_NOCFG_H    =               \
734                 ..\av.h         \
735                 ..\cop.h        \
736                 ..\cv.h         \
737                 ..\dosish.h     \
738                 ..\embed.h      \
739                 ..\form.h       \
740                 ..\gv.h         \
741                 ..\handy.h      \
742                 ..\hv.h         \
743                 ..\iperlsys.h   \
744                 ..\mg.h         \
745                 ..\nostdio.h    \
746                 ..\op.h         \
747                 ..\opcode.h     \
748                 ..\perl.h       \
749                 ..\perlapi.h    \
750                 ..\perlsdio.h   \
751                 ..\perlsfio.h   \
752                 ..\perly.h      \
753                 ..\pp.h         \
754                 ..\proto.h      \
755                 ..\regcomp.h    \
756                 ..\regexp.h     \
757                 ..\scope.h      \
758                 ..\sv.h         \
759                 ..\thread.h     \
760                 ..\unixish.h    \
761                 ..\utf8.h       \
762                 ..\util.h       \
763                 ..\warnings.h   \
764                 ..\XSUB.h       \
765                 ..\EXTERN.h     \
766                 ..\perlvars.h   \
767                 ..\intrpvar.h   \
768                 .\include\dirent.h      \
769                 .\include\netdb.h       \
770                 .\include\sys\socket.h  \
771                 .\win32.h
772
773 CORE_H          = $(CORE_NOCFG_H) .\config.h ..\git_version.h
774
775 UUDMAP_H        = ..\uudmap.h
776 BITCOUNT_H      = ..\bitcount.h
777
778 MICROCORE_OBJ   = $(MICROCORE_SRC:.c=.obj)
779 CORE_OBJ        = $(MICROCORE_OBJ) $(EXTRACORE_SRC:.c=.obj)
780 WIN32_OBJ       = $(WIN32_SRC:.c=.obj)
781 MINICORE_OBJ    = $(MICROCORE_OBJ:..\=.\mini\)  \
782                   $(MINIDIR)\miniperlmain$(o)   \
783                   $(MINIDIR)\perlio$(o)
784 MINIWIN32_OBJ   = $(WIN32_OBJ:.\=.\mini\)
785 MINI_OBJ        = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
786 DLL_OBJ         = $(DYNALOADER)
787 X2P_OBJ         = $(X2P_SRC:.c=.obj)
788 GENUUDMAP_OBJ   = $(GENUUDMAP:.exe=.obj)
789
790 PERLDLL_OBJ     = $(CORE_OBJ)
791 PERLEXE_OBJ     = perlmain$(o)
792 PERLEXEST_OBJ   = perlmainst$(o)
793
794 PERLDLL_OBJ     = $(PERLDLL_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
795
796 !IF "$(USE_SETARGV)" != ""
797 SETARGV_OBJ     = setargv$(o)
798 !ENDIF
799
800 !IF "$(ALL_STATIC)" == "define"
801 # some exclusions, unfortunately, until fixed:
802 #  - Win32 extension contains overlapped symbols with win32.c (BUG!)
803 #  - MakeMaker isn't capable enough for SDBM_File (smaller bug)
804 #  - Encode (encoding search algorithm relies on shared library?)
805 STATIC_EXT      = * !Win32 !SDBM_File !Encode
806 !ELSE
807 # specify static extensions here, for example:
808 #STATIC_EXT     = Cwd Compress/Raw/Zlib
809 STATIC_EXT      = Win32CORE
810 !ENDIF
811
812 DYNALOADER      = ..\DynaLoader$(o)
813
814 CFG_VARS        =                                       \
815                 "INST_DRV=$(INST_DRV)"                  \
816                 "INST_TOP=$(INST_TOP)"                  \
817                 "INST_VER=$(INST_VER)"                  \
818                 "INST_ARCH=$(INST_ARCH)"                \
819                 "archname=$(ARCHNAME)"                  \
820                 "cc=$(CC)"                              \
821                 "ld=$(LINK32)"                          \
822                 "ccflags=$(EXTRACFLAGS) $(OPTIMIZE:"=\") $(DEFINES) $(BUILDOPT)"        \
823                 "cf_email=$(EMAIL)"                     \
824                 "d_crypt=$(D_CRYPT)"                    \
825                 "d_mymalloc=$(PERL_MALLOC)"             \
826                 "libs=$(LIBFILES)"                      \
827                 "incpath=$(CCINCDIR:"=\")"              \
828                 "libperl=$(PERLIMPLIB:..\=)"            \
829                 "libpth=$(CCLIBDIR:"=\");$(EXTRALIBDIRS:"=\")"  \
830                 "libc=$(LIBC)"                          \
831                 "make=$(MAKE_BARE)"                             \
832                 "static_ext=$(STATIC_EXT)"              \
833                 "usethreads=$(USE_ITHREADS)"            \
834                 "useithreads=$(USE_ITHREADS)"           \
835                 "usemultiplicity=$(USE_MULTI)"          \
836                 "useperlio=$(USE_PERLIO)"               \
837                 "uselargefiles=$(USE_LARGE_FILES)"      \
838                 "usesitecustomize=$(USE_SITECUST)"      \
839                 "LINK_FLAGS=$(LINK_FLAGS:"=\")"         \
840                 "optimize=$(OPTIMIZE:"=\")"
841
842 ICWD = -I..\cpan\Cwd -I..\cpan\Cwd\lib
843
844 #
845 # Top targets
846 #
847
848 all : .\config.h ..\git_version.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) \
849         $(UNIDATAFILES) MakePPPort $(PERLEXE) $(X2P) Extensions_nonxs Extensions $(PERLSTATIC)
850         @echo   Everything is up to date. '$(MAKE_BARE) test' to run test suite.
851
852 ..\regcharclass.h : ..\Porting\regcharclass.pl
853         cd ..
854         miniperl Porting\regcharclass.pl
855         cd win32
856
857 regnodes : ..\regnodes.h
858
859 ..\regcomp$(o) : ..\regnodes.h ..\regcharclass.h        
860
861 ..\regexec$(o) : ..\regnodes.h ..\regcharclass.h
862
863 reonly : regnodes .\config.h ..\git_version.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) \
864         $(UNIDATAFILES) $(PERLEXE) $(X2P) Extensions_reonly
865         @echo   Perl and 're' are up to date.
866
867 static: $(PERLEXESTATIC)
868
869 #------------------------------------------------------------
870
871 $(GLOBEXE) : perlglob$(o)
872         $(LINK32) $(LINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
873             perlglob$(o) setargv$(o)
874         $(EMBED_EXE_MANI)
875
876 perlglob$(o)  : perlglob.c
877
878 config.w32 : $(CFGSH_TMPL)
879         copy $(CFGSH_TMPL) config.w32
880
881 .\config.h : $(CFGH_TMPL)
882         -del /f config.h
883         copy $(CFGH_TMPL) config.h
884
885 ..\git_version.h : $(MINIPERL) ..\make_patchnum.pl
886         cd ..
887         miniperl -Ilib make_patchnum.pl
888         cd win32
889
890 # make sure that we recompile perl.c if the git version changes
891 ..\perl$(o) : ..\git_version.h
892
893 ..\config.sh : config.w32 $(MINIPERL) config_sh.PL
894         $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) config.w32 > ..\config.sh
895
896 # this target is for when changes to the main config.sh happen.
897 # edit config.vc, then make perl in a minimal configuration (i.e. with MULTI,
898 # ITHREADS, IMP_SYS, LARGE_FILES, PERLIO and CRYPT off), then make this target
899 # to regenerate config_H.vc.
900 # repeat for config.vc64 and config_H.vc64 if you have a suitable build
901 # environment, otherwise hand-edit them to maintain the same differences with
902 # config.vc and config_H.vc as before.
903 # unfortunately, some further manual editing is also then required to restore all
904 # the special __GNUC__ handling that is otherwise lost.
905 regen_config_h:
906         $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) $(CFGSH_TMPL) > ..\config.sh
907         $(MINIPERL) -I..\lib ..\configpm --chdir=..
908         -del /f $(CFGH_TMPL)
909         -$(MINIPERL) -I..\lib $(ICWD) config_h.PL "INST_VER=$(INST_VER)"
910         rename config.h $(CFGH_TMPL)
911
912 $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
913         $(MINIPERL) -I..\lib ..\configpm --chdir=..
914         if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
915         $(XCOPY) ..\*.h $(COREDIR)\*.*
916         $(XCOPY) *.h $(COREDIR)\*.*
917         $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.*
918         $(RCOPY) include $(COREDIR)\*.*
919         -$(MINIPERL) -I..\lib $(ICWD) config_h.PL "INST_VER=$(INST_VER)"
920         if errorlevel 1 $(MAKE) /$(MAKEFLAGS) $(CONFIGPM)
921
922 $(MINIPERL) : $(MINIDIR) $(MINI_OBJ)
923         $(LINK32) -subsystem:console -out:$@ @<<
924         $(LINK_FLAGS) $(LIBFILES) $(MINI_OBJ)
925 <<
926         $(EMBED_EXE_MANI)
927
928 $(MINIDIR) :
929         if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
930
931 $(MINICORE_OBJ) : $(CORE_NOCFG_H)
932         $(CC) -c $(CFLAGS) -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL $(OBJOUT_FLAG)$@ ..\$(*F).c
933
934 $(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
935         $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*F).c
936
937 # -DPERL_IMPLICIT_SYS needs C++ for perllib.c
938 # This is the only file that depends on perlhost.h, vmem.h, and vdir.h
939 !IF "$(USE_IMP_SYS)" == "define"
940 perllib$(o)     : perllib.c .\perlhost.h .\vdir.h .\vmem.h
941         $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
942 !ENDIF
943
944 # 1. we don't want to rebuild miniperl.exe when config.h changes
945 # 2. we don't want to rebuild miniperl.exe with non-default config.h
946 # 3. we can't have miniperl.exe depend on git_version.h, as miniperl creates it
947 $(MINI_OBJ)     : $(CORE_NOCFG_H)
948
949 $(WIN32_OBJ)    : $(CORE_H)
950 $(CORE_OBJ)     : $(CORE_H)
951 $(DLL_OBJ)      : $(CORE_H)
952 $(X2P_OBJ)      : $(CORE_H)
953
954 perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl create_perllibst_h.pl
955         $(MINIPERL) -I..\lib create_perllibst_h.pl
956         $(MINIPERL) -I..\lib -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \
957             CCTYPE=$(CCTYPE) > perldll.def
958
959 $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES) Extensions_static
960         $(LINK32) -dll -def:perldll.def -base:0x28000000 -out:$@ @Extensions_static @<<
961                 $(LINK_FLAGS) $(DELAYLOAD) $(LIBFILES) $(PERLDLL_OBJ) $(PERLDLL_RES)
962 <<
963         $(EMBED_DLL_MANI)
964         $(XCOPY) $(PERLIMPLIB) $(COREDIR)
965
966 $(PERLSTATICLIB): Extensions_static
967         $(LIB32) $(LIB_FLAGS) -out:$@ @Extensions_static @<<
968                 $(PERLDLL_OBJ)
969 <<
970         $(XCOPY) $(PERLSTATICLIB) $(COREDIR)
971
972 $(PERLEXE_RES): perlexe.rc $(PERLEXE_MANIFEST) $(PERLEXE_ICO)
973
974 $(MINIMOD) : $(MINIPERL) ..\minimod.pl
975         cd ..
976         miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
977         cd win32
978
979 ..\x2p\a2p$(o) : ..\x2p\a2p.c
980         $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\a2p.c
981
982 ..\x2p\hash$(o) : ..\x2p\hash.c
983         $(CC) -I..\x2p  $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\hash.c
984
985 ..\x2p\str$(o) : ..\x2p\str.c
986         $(CC) -I..\x2p  $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\str.c
987
988 ..\x2p\util$(o) : ..\x2p\util.c
989         $(CC) -I..\x2p  $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\util.c
990
991 ..\x2p\walk$(o) : ..\x2p\walk.c
992         $(CC) -I..\x2p  $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\walk.c
993
994 $(X2P) : $(MINIPERL) $(X2P_OBJ) Extensions
995         $(MINIPERL) -I..\lib ..\x2p\find2perl.PL
996         $(MINIPERL) -I..\lib ..\x2p\s2p.PL
997         $(LINK32) -subsystem:console -out:$@ @<<
998                 $(LINK_FLAGS) $(LIBFILES) $(X2P_OBJ)
999 <<
1000         $(EMBED_EXE_MANI)
1001
1002 $(MINIDIR)\globals$(o) : $(UUDMAP_H) $(BITCOUNT_H)
1003
1004 $(UUDMAP_H) $(BITCOUNT_H) : $(GENUUDMAP)
1005         $(GENUUDMAP) $(UUDMAP_H) $(BITCOUNT_H)
1006
1007 $(GENUUDMAP) : $(GENUUDMAP_OBJ)
1008         $(LINK32) -subsystem:console -out:$@ @<<
1009                 $(LINK_FLAGS) $(LIBFILES) $(GENUUDMAP_OBJ)
1010 <<
1011         $(EMBED_EXE_MANI)
1012
1013 perlmain.c : runperl.c
1014         copy runperl.c perlmain.c
1015
1016 perlmain$(o) : perlmain.c
1017         $(CC) $(CFLAGS_O:-DPERLDLL=-UPERLDLL) $(OBJOUT_FLAG)$@ -c perlmain.c
1018
1019 perlmainst.c : runperl.c
1020         copy runperl.c perlmainst.c
1021
1022 perlmainst$(o) : perlmainst.c
1023         $(CC) $(CFLAGS_O) $(OBJOUT_FLAG)$@ -c perlmainst.c
1024
1025 $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES)
1026         $(LINK32) -subsystem:console -out:$@ -stack:0x1000000 $(LINK_FLAGS) \
1027             $(LIBFILES) $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES)
1028         $(EMBED_EXE_MANI)
1029         copy $(PERLEXE) $(WPERLEXE)
1030         $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS
1031
1032 $(PERLEXESTATIC): $(PERLSTATICLIB) $(CONFIGPM) $(PERLEXEST_OBJ) $(PERLEXE_RES)
1033         $(LINK32) -subsystem:console -out:$@ -stack:0x1000000 $(LINK_FLAGS) \
1034             @Extensions_static $(PERLSTATICLIB) /PDB:NONE \
1035             $(LIBFILES) $(PERLEXEST_OBJ) $(SETARGV_OBJ) $(PERLEXE_RES)
1036         $(EMBED_EXE_MANI)
1037
1038 MakePPPort: $(MINIPERL) $(CONFIGPM) Extensions_nonxs
1039         $(MINIPERL) -I..\lib $(ICWD) ..\mkppport
1040
1041 #-------------------------------------------------------------------------------
1042 # There's no direct way to mark a dependency on
1043 # DynaLoader.pm, so this will have to do
1044 Extensions: ..\make_ext.pl $(PERLDEP) $(CONFIGPM) $(DYNALOADER)
1045         $(XCOPY) ..\*.h $(COREDIR)\*.*
1046         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic
1047
1048 Extensions_reonly: ..\make_ext.pl $(PERLDEP) $(CONFIGPM) $(DYNALOADER)
1049         $(XCOPY) ..\*.h $(COREDIR)\*.*
1050         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +re
1051
1052 Extensions_static : ..\make_ext.pl list_static_libs.pl $(PERLDEP) $(CONFIGPM)
1053         $(XCOPY) ..\*.h $(COREDIR)\*.*
1054         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static
1055         $(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static
1056
1057 Extensions_nonxs: ..\make_ext.pl $(PERLDEP) $(CONFIGPM)
1058         $(XCOPY) ..\*.h $(COREDIR)\*.*
1059         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --nonxs
1060
1061 $(DYNALOADER) : ..\make_ext.pl $(PERLDEP) $(CONFIGPM) Extensions_nonxs
1062         $(XCOPY) ..\*.h $(COREDIR)\*.*
1063         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(EXTDIR) --dynaloader
1064
1065 Extensions_clean: 
1066         -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=clean
1067
1068 Extensions_realclean: 
1069         -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=realclean
1070
1071 #-------------------------------------------------------------------------------
1072
1073 doc: $(PERLEXE) ..\pod\perltoc.pod
1074         $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=$(HTMLDIR) \
1075             --podpath=pod:lib:ext:utils --htmlroot="file://$(INST_HTML::=|)" \
1076             --libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse
1077
1078 # Note that this next section is parsed (and regenerated) by pod/buildtoc
1079 # so please check that script before making structural changes here
1080
1081 utils: $(PERLEXE) $(X2P)
1082         cd ..\utils
1083         $(MAKE) PERL=$(MINIPERL)
1084         cd ..\pod
1085         copy ..\README.aix      ..\pod\perlaix.pod
1086         copy ..\README.amiga    ..\pod\perlamiga.pod
1087         copy ..\README.apollo   ..\pod\perlapollo.pod
1088         copy ..\README.beos     ..\pod\perlbeos.pod
1089         copy ..\README.bs2000   ..\pod\perlbs2000.pod
1090         copy ..\README.ce       ..\pod\perlce.pod
1091         copy ..\README.cn       ..\pod\perlcn.pod
1092         copy ..\README.cygwin   ..\pod\perlcygwin.pod
1093         copy ..\README.dgux     ..\pod\perldgux.pod
1094         copy ..\README.dos      ..\pod\perldos.pod
1095         copy ..\README.epoc     ..\pod\perlepoc.pod
1096         copy ..\README.freebsd  ..\pod\perlfreebsd.pod
1097         copy ..\README.haiku    ..\pod\perlhaiku.pod
1098         copy ..\README.hpux     ..\pod\perlhpux.pod
1099         copy ..\README.hurd     ..\pod\perlhurd.pod
1100         copy ..\README.irix     ..\pod\perlirix.pod
1101         copy ..\README.jp       ..\pod\perljp.pod
1102         copy ..\README.ko       ..\pod\perlko.pod
1103         copy ..\README.linux    ..\pod\perllinux.pod
1104         copy ..\README.macos    ..\pod\perlmacos.pod
1105         copy ..\README.macosx   ..\pod\perlmacosx.pod
1106         copy ..\README.mpeix    ..\pod\perlmpeix.pod
1107         copy ..\README.netware  ..\pod\perlnetware.pod
1108         copy ..\README.openbsd  ..\pod\perlopenbsd.pod
1109         copy ..\README.os2      ..\pod\perlos2.pod
1110         copy ..\README.os390    ..\pod\perlos390.pod
1111         copy ..\README.os400    ..\pod\perlos400.pod
1112         copy ..\README.plan9    ..\pod\perlplan9.pod
1113         copy ..\README.qnx      ..\pod\perlqnx.pod
1114         copy ..\README.riscos   ..\pod\perlriscos.pod
1115         copy ..\README.solaris  ..\pod\perlsolaris.pod
1116         copy ..\README.symbian  ..\pod\perlsymbian.pod
1117         copy ..\README.tru64    ..\pod\perltru64.pod
1118         copy ..\README.tw       ..\pod\perltw.pod
1119         copy ..\README.uts      ..\pod\perluts.pod
1120         copy ..\README.vmesa    ..\pod\perlvmesa.pod
1121         copy ..\README.vos      ..\pod\perlvos.pod
1122         copy ..\README.win32    ..\pod\perlwin32.pod
1123         copy ..\pod\perl5116delta.pod ..\pod\perldelta.pod
1124         $(MAKE) -f ..\win32\pod.mak converters
1125         cd ..\win32
1126         $(PERLEXE) $(PL2BAT) $(UTILS)
1127         $(PERLEXE) $(ICWD) ..\autodoc.pl ..
1128         $(PERLEXE) $(ICWD) ..\pod\perlmodlib.pl -q
1129
1130 ..\pod\perltoc.pod: $(PERLEXE) Extensions Extensions_nonxs
1131         $(PERLEXE) -f ..\pod\buildtoc --build-toc -q
1132
1133 # Note that the pod cleanup in this next section is parsed (and regenerated
1134 # by pod/buildtoc so please check that script before making changes here
1135
1136 distclean: realclean
1137         -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \
1138                 $(PERLIMPLIB) ..\miniperl.lib $(MINIMOD) \
1139                 $(PERLEXESTATIC) $(PERLSTATICLIB)
1140         -del /f *.def *.map
1141         -del /f $(LIBDIR)\Encode.pm $(LIBDIR)\encoding.pm $(LIBDIR)\Errno.pm
1142         -del /f $(LIBDIR)\Config.pod $(LIBDIR)\POSIX.pod $(LIBDIR)\threads.pm
1143         -del /f $(LIBDIR)\.exists $(LIBDIR)\attributes.pm $(LIBDIR)\DynaLoader.pm
1144         -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
1145         -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm
1146         -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
1147         -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
1148         -del /f $(LIBDIR)\File\Glob.pm
1149         -del /f $(LIBDIR)\Storable.pm
1150         -del /f $(LIBDIR)\Sys\Hostname.pm
1151         -del /f $(LIBDIR)\Time\HiRes.pm
1152         -del /f $(LIBDIR)\Unicode\Normalize.pm
1153         -del /f $(LIBDIR)\Math\BigInt\FastCalc.pm
1154         -del /f $(LIBDIR)\Win32.pm
1155         -del /f $(LIBDIR)\Win32CORE.pm
1156         -del /f $(LIBDIR)\Win32API\File.pm
1157         -del /f $(LIBDIR)\Win32API\File\cFile.pc
1158         -del /f $(DISTDIR)\XSLoader\XSLoader.pm
1159         -if exist $(LIBDIR)\App rmdir /s /q $(LIBDIR)\App
1160         -if exist $(LIBDIR)\Archive rmdir /s /q $(LIBDIR)\Archive
1161         -if exist $(LIBDIR)\Attribute rmdir /s /q $(LIBDIR)\Attribute
1162         -if exist $(LIBDIR)\autodie rmdir /s /q $(LIBDIR)\autodie
1163         -if exist $(LIBDIR)\B rmdir /s /q $(LIBDIR)\B
1164         -if exist $(LIBDIR)\CGI rmdir /s /q $(LIBDIR)\CGI
1165         -if exist $(LIBDIR)\CPAN rmdir /s /q $(LIBDIR)\CPAN
1166         -if exist $(LIBDIR)\CPANPLUS rmdir /s /q $(LIBDIR)\CPANPLUS
1167         -if exist $(LIBDIR)\Compress rmdir /s /q $(LIBDIR)\Compress
1168         -if exist $(LIBDIR)\Data rmdir /s /q $(LIBDIR)\Data
1169         -if exist $(LIBDIR)\Devel rmdir /s /q $(LIBDIR)\Devel
1170         -if exist $(LIBDIR)\Digest rmdir /s /q $(LIBDIR)\Digest
1171         -if exist $(LIBDIR)\Encode rmdir /s /q $(LIBDIR)\Encode
1172         -if exist $(LIBDIR)\encoding rmdir /s /q $(LIBDIR)\encoding
1173         -if exist $(LIBDIR)\ExtUtils\CBuilder rmdir /s /q $(LIBDIR)\ExtUtils\CBuilder
1174         -if exist $(LIBDIR)\ExtUtils\Command rmdir /s /q $(LIBDIR)\ExtUtils\Command
1175         -if exist $(LIBDIR)\ExtUtils\Constant rmdir /s /q $(LIBDIR)\ExtUtils\Constant
1176         -if exist $(LIBDIR)\ExtUtils\Liblist rmdir /s /q $(LIBDIR)\ExtUtils\Liblist
1177         -if exist $(LIBDIR)\ExtUtils\MakeMaker rmdir /s /q $(LIBDIR)\ExtUtils\MakeMaker
1178         -if exist $(LIBDIR)\File\Spec rmdir /s /q $(LIBDIR)\File\Spec
1179         -if exist $(LIBDIR)\Filter rmdir /s /q $(LIBDIR)\Filter
1180         -if exist $(LIBDIR)\Hash rmdir /s /q $(LIBDIR)\Hash
1181         -if exist $(LIBDIR)\I18N\LangTags rmdir /s /q $(LIBDIR)\I18N\LangTags
1182         -if exist $(LIBDIR)\inc rmdir /s /q $(LIBDIR)\inc
1183         -if exist $(LIBDIR)\Module\Pluggable rmdir /s /q $(LIBDIR)\Module\Pluggable
1184         -if exist $(LIBDIR)\IO rmdir /s /q $(LIBDIR)\IO
1185         -if exist $(LIBDIR)\IPC rmdir /s /q $(LIBDIR)\IPC
1186         -if exist $(LIBDIR)\List rmdir /s /q $(LIBDIR)\List
1187         -if exist $(LIBDIR)\Locale rmdir /s /q $(LIBDIR)\Locale
1188         -if exist $(LIBDIR)\Log rmdir /s /q $(LIBDIR)\Log
1189         -if exist $(LIBDIR)\Math rmdir /s /q $(LIBDIR)\Math
1190         -if exist $(LIBDIR)\Memoize rmdir /s /q $(LIBDIR)\Memoize
1191         -if exist $(LIBDIR)\MIME rmdir /s /q $(LIBDIR)\MIME
1192         -if exist $(LIBDIR)\Module rmdir /s /q $(LIBDIR)\Module
1193         -if exist $(LIBDIR)\mro rmdir /s /q $(LIBDIR)\mro
1194         -if exist $(LIBDIR)\Net\FTP rmdir /s /q $(LIBDIR)\Net\FTP
1195         -if exist $(LIBDIR)\Object rmdir /s /q $(LIBDIR)\Object
1196         -if exist $(LIBDIR)\Package rmdir /s /q $(LIBDIR)\Package
1197         -if exist $(LIBDIR)\Params rmdir /s /q $(LIBDIR)\Params
1198         -if exist $(LIBDIR)\Parse rmdir /s /q $(LIBDIR)\Parse
1199         -if exist $(LIBDIR)\PerlIO rmdir /s /q $(LIBDIR)\PerlIO
1200         -if exist $(LIBDIR)\Pod\Perldoc rmdir /s /q $(LIBDIR)\Pod\Perldoc
1201         -if exist $(LIBDIR)\Pod\Simple rmdir /s /q $(LIBDIR)\Pod\Simple
1202         -if exist $(LIBDIR)\Pod\Text rmdir /s /q $(LIBDIR)\Pod\Text
1203         -if exist $(LIBDIR)\re rmdir /s /q $(LIBDIR)\re
1204         -if exist $(LIBDIR)\Scalar rmdir /s /q $(LIBDIR)\Scalar
1205         -if exist $(LIBDIR)\Sys rmdir /s /q $(LIBDIR)\Sys
1206         -if exist $(LIBDIR)\TAP rmdir /s /q $(LIBDIR)\TAP
1207         -if exist $(LIBDIR)\Term\UI rmdir /s /q $(LIBDIR)\Term\UI
1208         -if exist $(LIBDIR)\Test rmdir /s /q $(LIBDIR)\Test
1209         -if exist $(LIBDIR)\Thread rmdir /s /q $(LIBDIR)\Thread
1210         -if exist $(LIBDIR)\threads rmdir /s /q $(LIBDIR)\threads
1211         -if exist $(LIBDIR)\Unicode\Collate rmdir /s /q $(LIBDIR)\Unicode\Collate
1212         -if exist $(LIBDIR)\XS rmdir /s /q $(LIBDIR)\XS
1213         -if exist $(LIBDIR)\Win32API rmdir /s /q $(LIBDIR)\Win32API
1214         -cd $(PODDIR) && del /f *.html *.bat \
1215             perlaix.pod perlamiga.pod perlapi.pod perlapollo.pod \
1216             perlbeos.pod perlbs2000.pod perlce.pod perlcn.pod \
1217             perlcygwin.pod perldelta.pod perldgux.pod perldos.pod \
1218             perlepoc.pod perlfreebsd.pod perlhaiku.pod perlhpux.pod \
1219             perlhurd.pod perlintern.pod perlirix.pod perljp.pod perlko.pod \
1220             perllinux.pod perlmacos.pod perlmacosx.pod perlmodlib.pod \
1221             perlmpeix.pod perlnetware.pod perlopenbsd.pod perlos2.pod \
1222             perlos390.pod perlos400.pod perlplan9.pod perlqnx.pod \
1223             perlriscos.pod perlsolaris.pod perlsymbian.pod perltoc.pod \
1224             perltru64.pod perltw.pod perluniprops.pod perluts.pod \
1225             perlvmesa.pod perlvos.pod perlwin32.pod \
1226             pod2html pod2latex pod2man pod2text pod2usage \
1227             podchecker podselect
1228         -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph pstruct h2xs \
1229             perldoc perlivp dprofpp libnetcfg enc2xs piconv cpan *.bat \
1230             xsubpp instmodsh prove ptar ptardiff cpanp-run-perl cpanp cpan2dist shasum corelist config_data
1231         -cd ..\x2p && del /f find2perl s2p psed *.bat
1232         -del /f ..\config.sh perlmain.c dlutils.c config.h.new \
1233                 perlmainst.c
1234         -del /f $(CONFIGPM)
1235         -del /f ..\lib\Config_git.pl
1236         -del /f bin\*.bat
1237         -del /f perllibst.h
1238         -del /f $(PERLEXE_RES) perl.base
1239         -cd .. && del /s *.lib *.map *.pdb *.ilk *.bs *$(o) .exists pm_to_blib ppport.h
1240         -cd $(EXTDIR) && del /s *.def Makefile Makefile.old
1241         -cd $(DISTDIR) && del /s *.def Makefile Makefile.old
1242         -cd $(CPANDIR) && del /s *.def Makefile Makefile.old
1243         -if exist $(AUTODIR) rmdir /s /q $(AUTODIR)
1244         -if exist $(COREDIR) rmdir /s /q $(COREDIR)
1245         -if exist pod2htmd.tmp del pod2htmd.tmp
1246         -if exist pod2htmi.tmp del pod2htmi.tmp
1247         -if exist $(HTMLDIR) rmdir /s /q $(HTMLDIR)
1248         -del /f ..\t\test_state
1249
1250 install : all installbare installhtml
1251
1252 installbare : utils ..\pod\perltoc.pod
1253         $(PERLEXE) ..\installperl
1254         if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\*.*
1255         if exist $(PERLEXESTATIC) $(XCOPY) $(PERLEXESTATIC) $(INST_BIN)\*.*
1256         $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
1257         if exist ..\perl*.pdb $(XCOPY) ..\perl*.pdb $(INST_BIN)\*.*
1258         if exist ..\x2p\a2p.pdb $(XCOPY) ..\x2p\a2p.pdb $(INST_BIN)\*.*
1259         $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.*
1260
1261 installhtml : doc
1262         $(RCOPY) $(HTMLDIR)\*.* $(INST_HTML)\*.*
1263
1264 inst_lib : $(CONFIGPM)
1265         $(RCOPY) ..\lib $(INST_LIB)\*.*
1266
1267 $(UNIDATAFILES) ..\pod\perluniprops.pod : $(MINIPERL) $(CONFIGPM) ..\lib\unicore\mktables Extensions_nonxs
1268         cd ..\lib\unicore && \
1269         ..\$(MINIPERL) -I.. -I..\..\cpan\Cwd\lib -I..\..\cpan\Cwd mktables -P ..\..\pod -maketest -makelist -p -check $@ $(FIRSTUNIFILE)
1270
1271 minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) utils $(UNIDATAFILES)
1272         $(XCOPY) $(MINIPERL) ..\t\$(NULL)
1273         if exist ..\t\perl.exe del /f ..\t\perl.exe
1274         rename ..\t\miniperl.exe perl.exe
1275         $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1276         attrib -r ..\t\*.*
1277         cd ..\t && \
1278         $(MINIPERL) -I..\lib harness base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t
1279
1280 test-prep : all utils
1281         $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1282         $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1283         $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1284
1285 test : test-prep
1286         cd ..\t
1287         $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
1288         cd ..\win32
1289
1290 test-reonly : reonly utils
1291         $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1292         $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1293         $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1294         cd ..\t
1295         $(PERLEXE) -I..\lib harness $(OPT) -re \bre\\/ $(EXTRA)
1296         cd ..\win32
1297
1298 regen :
1299         cd ..
1300         regen.pl
1301         cd win32
1302
1303 test-notty : test-prep
1304         set PERL_SKIP_TTY_TEST=1
1305         cd ..\t
1306         $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
1307         cd ..\win32
1308
1309 _test : 
1310        $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1311        $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1312        $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1313        cd ..\t
1314        $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
1315        cd ..\win32
1316
1317 _clean :
1318         -@$(DEL) miniperlmain$(o)
1319         -@$(DEL) $(MINIPERL)
1320         -@$(DEL) perlglob$(o)
1321         -@$(DEL) perlmain$(o)
1322         -@$(DEL) perlmainst$(o)
1323         -@$(DEL) config.w32
1324         -@$(DEL) config.h
1325         -@$(DEL) ..\git_version.h
1326         -@$(DEL) $(GLOBEXE)
1327         -@$(DEL) $(PERLEXE)
1328         -@$(DEL) $(WPERLEXE)
1329         -@$(DEL) $(PERLEXESTATIC)
1330         -@$(DEL) $(PERLSTATICLIB)
1331         -@$(DEL) $(PERLDLL)
1332         -@$(DEL) $(CORE_OBJ)
1333         -@$(DEL) $(GENUUDMAP) $(GENUUDMAP_OBJ) $(UUDMAP_H) $(BITCOUNT_H)
1334         -if exist $(MINIDIR) rmdir /s /q $(MINIDIR)
1335         -if exist $(UNIDATADIR1) rmdir /s /q $(UNIDATADIR1)
1336         -if exist $(UNIDATADIR2) rmdir /s /q $(UNIDATADIR2)
1337         -@$(DEL) $(UNIDATAFILES)
1338         -@$(DEL) $(WIN32_OBJ)
1339         -@$(DEL) $(DLL_OBJ)
1340         -@$(DEL) $(X2P_OBJ)
1341         -@$(DEL) ..\*$(o) ..\*.lib ..\*.exp *$(o) *.lib *.exp *.res
1342         -@$(DEL) ..\t\*.exe ..\t\*.dll ..\t\*.bat
1343         -@$(DEL) ..\x2p\*.exe ..\x2p\*.bat
1344         -@$(DEL) *.ilk
1345         -@$(DEL) *.pdb
1346         -@$(DEL) Extensions_static
1347
1348 clean : Extensions_clean _clean
1349
1350 realclean : Extensions_realclean _clean
1351
1352 # Handy way to run perlbug -ok without having to install and run the
1353 # installed perlbug. We don't re-run the tests here - we trust the user.
1354 # Please *don't* use this unless all tests pass.
1355 # If you want to report test failures, use "nmake nok" instead.
1356 ok: utils
1357         $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)"
1358
1359 okfile: utils
1360         $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)" -F perl.ok
1361
1362 nok: utils
1363         $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)"
1364
1365 nokfile: utils
1366         $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)" -F perl.nok