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