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