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