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