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