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