This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate:
[perl5.git] / win32 / makefile.mk
1 #
2 # Makefile to build perl on Windows NT using DMAKE.
3 # Supported compilers:
4 #       Visual C++ 2.0 through 6.0 (and possibly newer versions)
5 #       Borland C++ 5.02
6 #       Mingw32 with gcc-2.95.2 or better  **experimental**
7 #       MS Platform SDK 64-bit compiler and tools **experimental**
8 #
9 # This is set up to build a perl.exe that runs off a shared library
10 # (perl58.dll).  Also makes individual DLLs for the XS extensions.
11 #
12
13 ##
14 ## Make sure you read README.win32 *before* you mess with anything here!
15 ##
16
17 ##
18 ## Build configuration.  Edit the values below to suit your needs.
19 ##
20
21 #
22 # Set these to wherever you want "dmake install" to put your
23 # newly built perl.
24 #
25 INST_DRV        *= c:
26 INST_TOP        *= $(INST_DRV)\perl
27
28 #
29 # Comment this out if you DON'T want your perl installation to be versioned.
30 # This means that the new installation will overwrite any files from the
31 # old installation at the same INST_TOP location.  Leaving it enabled is
32 # the safest route, as perl adds the extra version directory to all the
33 # locations it installs files to.  If you disable it, an alternative
34 # versioned installation can be obtained by setting INST_TOP above to a
35 # path that includes an arbitrary version string.
36 #
37 #INST_VER       *= \5.8.5
38
39 #
40 # Comment this out if you DON'T want your perl installation to have
41 # architecture specific components.  This means that architecture-
42 # specific files will be installed along with the architecture-neutral
43 # files.  Leaving it enabled is safer and more flexible, in case you
44 # want to build multiple flavors of perl and install them together in
45 # the same location.  Commenting it out gives you a simpler
46 # installation that is easier to understand for beginners.
47 #
48 #INST_ARCH      *= \$(ARCHNAME)
49
50 #
51 # uncomment to enable multiple interpreters.  This is need for fork()
52 # emulation and for thread support.
53 #
54 USE_MULTI       *= define
55
56 #
57 # Interpreter cloning/threads; now reasonably complete.
58 # This should be enabled to get the fork() emulation.  
59 # This needs USE_MULTI above.
60 #
61 USE_ITHREADS    *= define
62
63 #
64 # uncomment to enable the implicit "host" layer for all system calls
65 # made by perl.  This needs USE_MULTI above.  
66 # This is also needed to get fork().
67 #
68 USE_IMP_SYS     *= define
69
70 #
71 # Comment out next assign to disable perl's I/O subsystem and use compiler's 
72 # stdio for IO - depending on your compiler vendor and run time library you may 
73 # then get a number of fails from make test i.e. bugs - complain to them not us ;-). 
74 # You will also be unable to take full advantage of perl5.8's support for multiple 
75 # encodings and may see lower IO performance. You have been warned.
76 USE_PERLIO      *= define
77
78 #
79 # Comment this out if you don't want to enable large file support for
80 # some reason.  Should normally only be changed to maintain compatibility
81 # with an older release of perl.
82 USE_LARGE_FILES *= define
83
84 #
85 # WARNING! This option is deprecated and will eventually go away (enable
86 # USE_ITHREADS instead).
87 #
88 # uncomment to enable threads-capabilities.  This is incompatible with
89 # USE_ITHREADS, and is only here for people who may have come to rely
90 # on the experimental Thread support that was in 5.005.
91 #
92 #USE_5005THREADS        *= define
93
94 #
95 # uncomment exactly one of the following
96 #
97 # Visual C++ 2.x
98 #CCTYPE         *= MSVC20
99 # Visual C++ > 2.x and < 6.x
100 #CCTYPE         *= MSVC
101 # Visual C++ >= 6.x
102 #CCTYPE         *= MSVC60
103 # Borland 5.02 or later
104 #CCTYPE         *= BORLAND
105 # MinGW with gcc-2.95.2 or later
106 CCTYPE          *= GCC
107
108 #
109 # uncomment this if your Borland compiler is older than v5.4.
110 #BCCOLD = define
111 #
112 # uncomment this if you want to use Borland's VCL as your CRT
113 #BCCVCL = define
114
115 #
116 # uncomment this if you are compiling under Windows 95/98 and command.com
117 # (not needed if you're running under 4DOS/NT 6.01 or later)
118 #IS_WIN95       *= define
119
120 #
121 # uncomment next line if you want debug version of perl (big,slow)
122 # If not enabled, we automatically try to use maximum optimization
123 # with all compilers that are known to have a working optimizer.
124 #
125 #CFG            *= Debug
126
127 #
128 # uncomment to enable use of PerlCRT.DLL when using the Visual C compiler.
129 # It has patches that fix known bugs in older versions of MSVCRT.DLL.
130 # This currently requires VC 5.0 with Service Pack 3 or later.
131 # Get it from CPAN at http://www.cpan.org/authors/id/D/DO/DOUGL/
132 # and follow the directions in the package to install.
133 #
134 # Not recommended if you have VC 6.x and you're not running Windows 9x.
135 #
136 #USE_PERLCRT    *= define
137
138 #
139 # uncomment to enable linking with setargv.obj under the Visual C
140 # compiler. Setting this options enables perl to expand wildcards in
141 # arguments, but it may be harder to use alternate methods like
142 # File::DosGlob that are more powerful.  This option is supported only with
143 # Visual C.
144 #
145 #USE_SETARGV    *= define
146
147 #
148 # if you want to have the crypt() builtin function implemented, leave this or
149 # CRYPT_LIB uncommented.  The fcrypt.c file named here contains a suitable
150 # version of des_fcrypt().
151 #
152 CRYPT_SRC       *= fcrypt.c
153
154 #
155 # if you didn't set CRYPT_SRC and if you have des_fcrypt() available in a
156 # library, uncomment this, and make sure the library exists (see README.win32)
157 # Specify the full pathname of the library.
158 #
159 #CRYPT_LIB      *= fcrypt.lib
160
161 #
162 # set this if you wish to use perl's malloc
163 # WARNING: Turning this on/off WILL break binary compatibility with extensions
164 # you may have compiled with/without it.  Be prepared to recompile all
165 # extensions if you change the default.  Currently, this cannot be enabled
166 # if you ask for USE_IMP_SYS above.
167 #
168 PERL_MALLOC     *= define
169
170 #
171 # set this to enable debugging mstats
172 # This must be enabled to use the Devel::Peek::mstat() function.  This cannot
173 # be enabled without PERL_MALLOC as well.
174 #
175 DEBUG_MSTATS  = define
176
177 #
178 # set the install locations of the compiler include/libraries
179 # Running VCVARS32.BAT is *required* when using Visual C.
180 # Some versions of Visual C don't define MSVCDIR in the environment,
181 # so you may have to set CCHOME explicitly (spaces in the path name should
182 # not be quoted)
183 #
184 .IF "$(CCTYPE)" == "BORLAND"
185 CCHOME          *= C:\borland\bcc55
186 .ELIF "$(CCTYPE)" == "GCC"
187 CCHOME          *= C:\MinGW
188 .ELSE
189 CCHOME          *= $(MSVCDIR)
190 .ENDIF
191 CCINCDIR        *= $(CCHOME)\include
192 CCLIBDIR        *= $(CCHOME)\lib
193
194 #
195 # Additional compiler flags can be specified here.
196 #
197
198 #
199 # This should normally be disabled.  Adding -DPERL_POLLUTE enables support
200 # for old symbols by default, at the expense of extreme pollution.  You most
201 # probably just want to build modules that won't compile with
202 #         perl Makefile.PL POLLUTE=1
203 # instead of enabling this.  Please report such modules to the respective
204 # authors.
205 #
206 #BUILDOPT       += -DPERL_POLLUTE
207
208 #
209 # This should normally be disabled.  Enabling it will disable the File::Glob
210 # implementation of CORE::glob.
211 #
212 #BUILDOPT       += -DPERL_EXTERNAL_GLOB
213
214 #
215 # This should normally be disabled.  Enabling it causes perl to read scripts
216 # in text mode (which is the 5.005 behavior) and will break ByteLoader.
217 #BUILDOPT       += -DPERL_TEXTMODE_SCRIPTS
218
219 #
220 # specify semicolon-separated list of extra directories that modules will
221 # look for libraries (spaces in path names need not be quoted)
222 #
223 EXTRALIBDIRS    *=
224
225 #
226 # set this to point to cmd.exe (only needed if you use some
227 # alternate shell that doesn't grok cmd.exe style commands)
228 #
229 #SHELL          *= g:\winnt\system32\cmd.exe
230
231 #
232 # set this to your email address (perl will guess a value from
233 # from your loginname and your hostname, which may not be right)
234 #
235 #EMAIL          *=
236
237 ##
238 ## Build configuration ends.
239 ##
240
241 ##################### CHANGE THESE ONLY IF YOU MUST #####################
242
243 .IF "$(CRYPT_SRC)$(CRYPT_LIB)" == ""
244 D_CRYPT         = undef
245 .ELSE
246 D_CRYPT         = define
247 CRYPT_FLAG      = -DHAVE_DES_FCRYPT
248 .ENDIF
249
250 PERL_MALLOC     *= undef
251
252 USE_5005THREADS *= undef
253
254 .IF "$(USE_5005THREADS)" == "define"
255 USE_ITHREADS    != undef
256 .ENDIF
257
258 USE_MULTI       *= undef
259 USE_ITHREADS    *= undef
260 USE_IMP_SYS     *= undef
261 USE_PERLIO      *= undef
262 USE_LARGE_FILES *= undef
263 USE_PERLCRT     *= undef
264
265 .IF "$(PERL_MALLOC)" == "undef"
266 PERL_MALLOC     = undef
267 DEBUG_MSTATS   = undef
268 .ENDIF
269
270 .IF "$(DEBUG_MSTATS)" == "undef"
271 DEBUG_MSTATS   = undef
272 .ENDIF
273
274 .IF "$(DEBUG_MSTATS)" == "define"
275 BUILDOPT       += -DPERL_DEBUGGING_MSTATS
276 .ENDIF
277
278 .IF "$(USE_IMP_SYS)$(USE_MULTI)$(USE_5005THREADS)" == "defineundefundef"
279 USE_MULTI       != define
280 .ENDIF
281
282 .IF "$(USE_ITHREADS)$(USE_MULTI)" == "defineundef"
283 USE_MULTI       != define
284 USE_5005THREADS != undef
285 .ENDIF
286
287 .IF "$(USE_MULTI)$(USE_5005THREADS)" != "undefundef"
288 BUILDOPT        += -DPERL_IMPLICIT_CONTEXT
289 .ENDIF
290
291 .IF "$(USE_IMP_SYS)" != "undef"
292 BUILDOPT        += -DPERL_IMPLICIT_SYS
293 .ENDIF
294
295 .IMPORT .IGNORE : PROCESSOR_ARCHITECTURE PROCESSOR_ARCHITEW6432
296
297 PROCESSOR_ARCHITECTURE *= x86
298
299 .IF "$(WIN64)" == ""
300 .IF "$(PROCESSOR_ARCHITEW6432)" != ""
301 PROCESSOR_ARCHITECTURE  != $(PROCESSOR_ARCHITEW6432)
302 WIN64                   = define
303 .ELIF "$(PROCESSOR_ARCHITECTURE)" == "IA64"
304 WIN64                   = define
305 .ELSE
306 WIN64                   = undef
307 .ENDIF
308 .ENDIF
309
310 .IF "$(USE_5005THREADS)" == "define"
311 ARCHNAME        = MSWin32-$(PROCESSOR_ARCHITECTURE)-thread
312 .ELIF "$(USE_MULTI)" == "define"
313 ARCHNAME        = MSWin32-$(PROCESSOR_ARCHITECTURE)-multi
314 .ELSE
315 .IF "$(USE_PERLIO)" == "define"
316 ARCHNAME        = MSWin32-$(PROCESSOR_ARCHITECTURE)-perlio
317 .ELSE
318 ARCHNAME        = MSWin32-$(PROCESSOR_ARCHITECTURE)
319 .ENDIF
320 ARCHNAME        = MSWin32-$(PROCESSOR_ARCHITECTURE)
321 .ENDIF
322
323 .IF "$(USE_ITHREADS)" == "define"
324 ARCHNAME        !:= $(ARCHNAME)-thread
325 .ENDIF
326
327 # Visual Studio 98 specific
328 .IF "$(CCTYPE)" == "MSVC60"
329
330 # VC 6.0 can load the socket dll on demand.  Makes the test suite
331 # run in about 10% less time.
332 DELAYLOAD       *= -DELAYLOAD:ws2_32.dll -DELAYLOAD:shell32.dll delayimp.lib
333
334 .IF "$(CFG)" == "Debug"
335 .ELSE
336 # VC 6.0 seems capable of compiling perl correctly with optimizations
337 # enabled.  Anything earlier fails tests.
338 CFG             *= Optimize
339 .ENDIF
340 .ENDIF
341
342 ARCHDIR         = ..\lib\$(ARCHNAME)
343 COREDIR         = ..\lib\CORE
344 AUTODIR         = ..\lib\auto
345 LIBDIR          = ..\lib
346 EXTDIR          = ..\ext
347 PODDIR          = ..\pod
348 EXTUTILSDIR     = $(LIBDIR)\ExtUtils
349
350 #
351 INST_SCRIPT     = $(INST_TOP)$(INST_VER)\bin
352 INST_BIN        = $(INST_SCRIPT)$(INST_ARCH)
353 INST_LIB        = $(INST_TOP)$(INST_VER)\lib
354 INST_ARCHLIB    = $(INST_LIB)$(INST_ARCH)
355 INST_COREDIR    = $(INST_ARCHLIB)\CORE
356 INST_POD        = $(INST_LIB)\pod
357 INST_HTML       = $(INST_TOP)$(INST_VER)\html
358
359 #
360 # Programs to compile, build .lib files and link
361 #
362
363 .USESHELL :
364
365 .IF "$(CCTYPE)" == "BORLAND"
366
367 CC              = bcc32
368 .IF "$(BCCOLD)" != "define"
369 LINK32          = ilink32
370 .ELSE
371 LINK32          = tlink32
372 .ENDIF
373 LIB32           = tlib /P128
374 IMPLIB          = implib -c
375 RSC             = rc
376
377 #
378 # Options
379 #
380 INCLUDES        = -I$(COREDIR) -I.\include -I. -I.. -I"$(CCINCDIR)"
381 #PCHFLAGS       = -H -Hc -H=c:\temp\bcmoduls.pch
382 DEFINES         = -DWIN32 $(CRYPT_FLAG)
383 LOCDEFS         = -DPERLDLL -DPERL_CORE
384 SUBSYS          = console
385 CXX_FLAG        = -P
386
387 LIBC            = cw32mti.lib
388 LIBFILES        = $(CRYPT_LIB) import32.lib $(LIBC)
389
390 .IF  "$(CFG)" == "Debug"
391 OPTIMIZE        = -v -D_RTLDLL -DDEBUGGING
392 LINK_DBG        = -v
393 .ELSE
394 OPTIMIZE        = -O2 -D_RTLDLL
395 LINK_DBG        =
396 .ENDIF
397
398 CFLAGS          = -w -g0 -tWM -tWD $(INCLUDES) $(DEFINES) $(LOCDEFS) \
399                 $(PCHFLAGS) $(OPTIMIZE)
400 LINK_FLAGS      = $(LINK_DBG) -L"$(INST_COREDIR)"  -L"$(CCLIBDIR)"
401 OBJOUT_FLAG     = -o
402 EXEOUT_FLAG     = -e
403 LIBOUT_FLAG     =
404 .IF "$(BCCOLD)" != "define"
405 LINK_FLAGS      += -Gn
406 DEFINES  += -D_MT -D__USELOCALES__ -D_WIN32_WINNT=0x0410
407 .END
408 .IF "$(BCCVCL)" == "define"
409 LIBC            = cp32mti.lib vcl.lib vcl50.lib vclx50.lib vcle50.lib
410 LINK_FLAGS      += -L"$(CCLIBDIR)\Release"
411 .END
412
413
414 .ELIF "$(CCTYPE)" == "GCC"
415
416 CC              = gcc
417 LINK32          = g++
418 LIB32           = ar rc
419 IMPLIB          = dlltool
420 RSC             = windres
421
422 i = .i
423 o = .o
424 a = .a
425
426 #
427 # Options
428 #
429
430 INCLUDES        = -I.\include -I. -I.. -I$(COREDIR)
431 DEFINES         = -DWIN32 $(CRYPT_FLAG)
432 LOCDEFS         = -DPERLDLL -DPERL_CORE
433 SUBSYS          = console
434 CXX_FLAG        = -xc++
435
436 LIBC            = -lmsvcrt
437
438 # same libs as MSVC
439 LIBFILES        = $(CRYPT_LIB) $(LIBC) \
440                   -lmoldname -lkernel32 -luser32 -lgdi32 \
441                   -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 \
442                   -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr \
443                   -lwinmm -lversion -lodbc32
444
445 .IF  "$(CFG)" == "Debug"
446 OPTIMIZE        = -g -O2 -DDEBUGGING
447 LINK_DBG        = -g
448 .ELSE
449 OPTIMIZE        = -s -O2
450 LINK_DBG        = -s
451 .ENDIF
452
453 CFLAGS          = $(INCLUDES) $(DEFINES) $(LOCDEFS) $(OPTIMIZE)
454 LINK_FLAGS      = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)"
455 OBJOUT_FLAG     = -o
456 EXEOUT_FLAG     = -o
457 LIBOUT_FLAG     =
458
459 # NOTE: we assume that GCC uses MSVCRT.DLL
460 BUILDOPT        += -fno-strict-aliasing -DPERL_MSVCRT_READFIX
461
462 .ELSE
463
464 CC              = cl
465 LINK32          = link
466 LIB32           = $(LINK32) -lib
467 RSC             = rc
468
469 #
470 # Options
471 #
472
473 INCLUDES        = -I$(COREDIR) -I.\include -I. -I..
474 #PCHFLAGS       = -Fpc:\temp\vcmoduls.pch -YX
475 DEFINES         = -DWIN32 -D_CONSOLE -DNO_STRICT $(CRYPT_FLAG)
476 LOCDEFS         = -DPERLDLL -DPERL_CORE
477 SUBSYS          = console
478 CXX_FLAG        = -TP -GX
479
480 .IF "$(USE_PERLCRT)" != "define"
481 LIBC    = msvcrt.lib
482 .ELSE
483 LIBC    = PerlCRT.lib
484 .ENDIF
485
486 .IF  "$(CFG)" == "Debug"
487 .IF "$(CCTYPE)" == "MSVC20"
488 OPTIMIZE        = -Od -MD -Z7 -DDEBUGGING
489 .ELSE
490 OPTIMIZE        = -O1 -MD -Zi -DDEBUGGING
491 .ENDIF
492 LINK_DBG        = -debug
493 .ELSE
494 OPTIMIZE        = -MD -Zi -DNDEBUG
495 # we enable debug symbols in release builds also
496 LINK_DBG        = -debug -opt:ref,icf
497 # you may want to enable this if you want COFF symbols in the executables
498 # in addition to the PDB symbols.  The default Dr. Watson that ships with
499 # Windows can use the the former but not latter.  The free WinDbg can be
500 # installed to get better stack traces from just the PDB symbols, so we
501 # avoid the bloat of COFF symbols by default.
502 #LINK_DBG       = $(LINK_DBG) -debugtype:both
503 .IF "$(WIN64)" == "define"
504 # enable Whole Program Optimizations (WPO) and Link Time Code Generation (LTCG)
505 OPTIMIZE        += -Ox -GL
506 LINK_DBG        += -ltcg
507 .ELSE
508 # -O1 yields smaller code, which turns out to be faster than -O2 on x86
509 OPTIMIZE        += -O1
510 #OPTIMIZE       += -O2
511 .ENDIF
512 .ENDIF
513
514 .IF "$(WIN64)" == "define"
515 DEFINES         += -DWIN64 -DCONSERVATIVE
516 OPTIMIZE        += -Wp64 -Op
517 .ENDIF
518
519 .IF "$(USE_PERLCRT)" != "define"
520 BUILDOPT        += -DPERL_MSVCRT_READFIX
521 .ENDIF
522
523 LIBBASEFILES    = $(CRYPT_LIB) \
524                 oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
525                 comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
526                 netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib \
527                 version.lib
528
529 # win64 doesn't have some libs
530 .IF "$(WIN64)" != "define"
531 LIBBASEFILES    += odbc32.lib odbccp32.lib
532 .ENDIF
533
534 # we add LIBC here, since we may be using PerlCRT.dll
535 LIBFILES        = $(LIBBASEFILES) $(LIBC)
536
537 CFLAGS          = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) \
538                 $(PCHFLAGS) $(OPTIMIZE)
539 LINK_FLAGS      = -nologo -nodefaultlib $(LINK_DBG) \
540                 -libpath:"$(INST_COREDIR)" \
541                 -machine:$(PROCESSOR_ARCHITECTURE)
542 OBJOUT_FLAG     = -Fo
543 EXEOUT_FLAG     = -Fe
544 LIBOUT_FLAG     = /out:
545
546 .ENDIF
547
548 CFLAGS_O        = $(CFLAGS) $(BUILDOPT)
549
550 # used to allow local linking flags that are not propogated into Config.pm,
551 # currently unused
552 #   -- BKS, 12-12-1999
553 PRIV_LINK_FLAGS *=
554 BLINK_FLAGS     = $(PRIV_LINK_FLAGS) $(LINK_FLAGS)
555
556 #################### do not edit below this line #######################
557 ############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
558
559 o *= .obj
560 a *= .lib
561
562 LKPRE           = INPUT (
563 LKPOST          = )
564
565 #
566 # Rules
567 #
568
569 .SUFFIXES : .c .i $(o) .dll $(a) .exe .rc .res
570
571 .c$(o):
572         $(CC) -c $(null,$(<:d) $(NULL) -I$(<:d)) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $<
573
574 .c.i:
575         $(CC) -c $(null,$(<:d) $(NULL) -I$(<:d)) $(CFLAGS_O) -E $< >$@
576
577 .y.c:
578         $(NOOP)
579
580 $(o).dll:
581 .IF "$(CCTYPE)" == "BORLAND"
582         $(LINK32) -Tpd -ap $(BLINK_FLAGS) c0d32$(o) $<,$@,,$(LIBFILES),$(*B).def
583         $(IMPLIB) $(*B).lib $@
584 .ELIF "$(CCTYPE)" == "GCC"
585         $(LINK32) -o $@ $(BLINK_FLAGS) $< $(LIBFILES)
586         $(IMPLIB) --input-def $(*B).def --output-lib $(*B).a $@
587 .ELSE
588         $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
589             -out:$@ $(BLINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
590 .ENDIF
591
592 .rc.res:
593 .IF "$(CCTYPE)" == "GCC"
594         $(RSC) --use-temp-file -i $< -o $@
595 .ELSE
596         $(RSC) -i.. $<
597 .ENDIF
598
599 #
600 # various targets
601 MINIPERL        = ..\miniperl.exe
602 MINIDIR         = .\mini
603 PERLEXE         = ..\perl.exe
604 WPERLEXE        = ..\wperl.exe
605 GLOBEXE         = ..\perlglob.exe
606 CONFIGPM        = ..\lib\Config.pm
607 MINIMOD         = ..\lib\ExtUtils\Miniperl.pm
608 X2P             = ..\x2p\a2p.exe
609
610 # Unicode data files generated by mktables
611 UNIDATAFILES     = ..\lib\unicore\Canonical.pl ..\lib\unicore\Exact.pl \
612                    ..\lib\unicore\Properties ..\lib\unicore\Decomposition.pl \
613                    ..\lib\unicore\CombiningClass.pl ..\lib\unicore\Name.pl \
614                    ..\lib\unicore\PVA.pl
615
616 # Directories of Unicode data files generated by mktables
617 UNIDATADIR1     = ..\lib\unicore\To
618 UNIDATADIR2     = ..\lib\unicore\lib
619
620 PERLEXE_ICO     = .\perlexe.ico
621 PERLEXE_RES     = .\perlexe.res
622 PERLDLL_RES     =
623
624 # Nominate a target which causes extensions to be re-built
625 # This used to be $(PERLEXE), but at worst it is the .dll that they depend
626 # on and really only the interface - i.e. the .def file used to export symbols
627 # from the .dll
628 PERLDEP = perldll.def
629
630
631 PL2BAT          = bin\pl2bat.pl
632 GLOBBAT         = bin\perlglob.bat
633
634 UTILS           =                       \
635                 ..\utils\h2ph           \
636                 ..\utils\splain         \
637                 ..\utils\dprofpp        \
638                 ..\utils\perlbug        \
639                 ..\utils\pl2pm          \
640                 ..\utils\c2ph           \
641                 ..\utils\pstruct        \
642                 ..\utils\h2xs           \
643                 ..\utils\perldoc        \
644                 ..\utils\perlcc         \
645                 ..\utils\perlivp        \
646                 ..\utils\libnetcfg      \
647                 ..\utils\enc2xs         \
648                 ..\utils\piconv         \
649                 ..\utils\cpan           \
650                 ..\utils\xsubpp         \
651                 ..\utils\prove          \
652                 ..\utils\instmodsh      \
653                 ..\pod\checkpods        \
654                 ..\pod\pod2html         \
655                 ..\pod\pod2latex        \
656                 ..\pod\pod2man          \
657                 ..\pod\pod2text         \
658                 ..\pod\pod2usage        \
659                 ..\pod\podchecker       \
660                 ..\pod\podselect        \
661                 ..\x2p\find2perl        \
662                 ..\x2p\psed             \
663                 ..\x2p\s2p              \
664                 bin\exetype.pl          \
665                 bin\runperl.pl          \
666                 bin\pl2bat.pl           \
667                 bin\perlglob.pl         \
668                 bin\search.pl
669
670 .IF "$(CCTYPE)" == "BORLAND"
671
672 CFGSH_TMPL      = config.bc
673 CFGH_TMPL       = config_H.bc
674
675 .ELIF "$(CCTYPE)" == "GCC"
676
677 CFGSH_TMPL      = config.gc
678 CFGH_TMPL       = config_H.gc
679 PERLIMPLIB      = ..\libperl58$(a)
680
681 .ELSE
682
683 .IF "$(WIN64)" == "define"
684 CFGSH_TMPL      = config.vc64
685 CFGH_TMPL       = config_H.vc64
686 .ELSE
687 CFGSH_TMPL      = config.vc
688 CFGH_TMPL       = config_H.vc
689 .ENDIF
690
691 .ENDIF
692
693 # makedef.pl must be updated if this changes, and this should normally
694 # only change when there is an incompatible revision of the public API.
695 PERLIMPLIB      *= ..\perl58$(a)
696 PERLDLL         = ..\perl58.dll
697
698 XCOPY           = xcopy /f /r /i /d
699 RCOPY           = xcopy /f /r /i /e /d
700 NOOP            = @echo
701
702 #
703 # filenames given to xsubpp must have forward slashes (since it puts
704 # full pathnames in #line strings)
705 XSUBPP          = ..\$(MINIPERL) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp \
706                 -C++ -prototypes
707
708 MICROCORE_SRC   =               \
709                 ..\av.c         \
710                 ..\deb.c        \
711                 ..\doio.c       \
712                 ..\doop.c       \
713                 ..\dump.c       \
714                 ..\globals.c    \
715                 ..\gv.c         \
716                 ..\hv.c         \
717                 ..\locale.c     \
718                 ..\mg.c         \
719                 ..\numeric.c    \
720                 ..\op.c         \
721                 ..\pad.c        \
722                 ..\perl.c       \
723                 ..\perlapi.c    \
724                 ..\perly.c      \
725                 ..\pp.c         \
726                 ..\pp_ctl.c     \
727                 ..\pp_hot.c     \
728                 ..\pp_pack.c    \
729                 ..\pp_sort.c    \
730                 ..\pp_sys.c     \
731                 ..\reentr.c     \
732                 ..\regcomp.c    \
733                 ..\regexec.c    \
734                 ..\run.c        \
735                 ..\scope.c      \
736                 ..\sv.c         \
737                 ..\taint.c      \
738                 ..\toke.c       \
739                 ..\universal.c  \
740                 ..\utf8.c       \
741                 ..\util.c       \
742                 ..\xsutils.c
743
744 EXTRACORE_SRC   += perllib.c
745
746 .IF "$(PERL_MALLOC)" == "define"
747 EXTRACORE_SRC   += ..\malloc.c
748 .ENDIF
749
750 EXTRACORE_SRC   += ..\perlio.c
751
752 WIN32_SRC       =               \
753                 .\win32.c       \
754                 .\win32sck.c    \
755                 .\win32thread.c
756
757 # We need this for miniperl build unless we override canned 
758 # config.h #define building mini\*
759 #.IF "$(USE_PERLIO)" == "define"
760 WIN32_SRC       += .\win32io.c
761 #.ENDIF
762
763 .IF "$(CRYPT_SRC)" != ""
764 WIN32_SRC       += .\$(CRYPT_SRC)
765 .ENDIF
766
767 DLL_SRC         = $(DYNALOADER).c
768
769 X2P_SRC         =               \
770                 ..\x2p\a2p.c    \
771                 ..\x2p\hash.c   \
772                 ..\x2p\str.c    \
773                 ..\x2p\util.c   \
774                 ..\x2p\walk.c
775
776 CORE_NOCFG_H    =               \
777                 ..\av.h         \
778                 ..\cop.h        \
779                 ..\cv.h         \
780                 ..\dosish.h     \
781                 ..\embed.h      \
782                 ..\form.h       \
783                 ..\gv.h         \
784                 ..\handy.h      \
785                 ..\hv.h         \
786                 ..\iperlsys.h   \
787                 ..\mg.h         \
788                 ..\nostdio.h    \
789                 ..\op.h         \
790                 ..\opcode.h     \
791                 ..\perl.h       \
792                 ..\perlapi.h    \
793                 ..\perlsdio.h   \
794                 ..\perlsfio.h   \
795                 ..\perly.h      \
796                 ..\pp.h         \
797                 ..\proto.h      \
798                 ..\regexp.h     \
799                 ..\scope.h      \
800                 ..\sv.h         \
801                 ..\thread.h     \
802                 ..\unixish.h    \
803                 ..\utf8.h       \
804                 ..\util.h       \
805                 ..\warnings.h   \
806                 ..\XSUB.h       \
807                 ..\EXTERN.h     \
808                 ..\perlvars.h   \
809                 ..\intrpvar.h   \
810                 ..\thrdvar.h    \
811                 .\include\dirent.h      \
812                 .\include\netdb.h       \
813                 .\include\sys\socket.h  \
814                 .\win32.h
815
816 CORE_H          = $(CORE_NOCFG_H) .\config.h
817
818 MICROCORE_OBJ   = $(MICROCORE_SRC:db:+$(o))
819 CORE_OBJ        = $(MICROCORE_OBJ) $(EXTRACORE_SRC:db:+$(o))
820 WIN32_OBJ       = $(WIN32_SRC:db:+$(o))
821 MINICORE_OBJ    = $(MINIDIR)\{$(MICROCORE_OBJ:f) miniperlmain$(o) perlio$(o)}
822 MINIWIN32_OBJ   = $(MINIDIR)\{$(WIN32_OBJ:f)}
823 MINI_OBJ        = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
824 DLL_OBJ         = $(DLL_SRC:db:+$(o))
825 X2P_OBJ         = $(X2P_SRC:db:+$(o))
826
827 PERLDLL_OBJ     = $(CORE_OBJ)
828 PERLEXE_OBJ     = perlmain$(o)
829
830 PERLDLL_OBJ     += $(WIN32_OBJ) $(DLL_OBJ)
831
832 .IF "$(USE_SETARGV)" != ""
833 SETARGV_OBJ     = setargv$(o)
834 .ENDIF
835
836 DYNAMIC_EXT     = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
837                 Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob \
838                 Sys/Hostname Storable Filter/Util/Call Encode \
839                 Digest/MD5 PerlIO/scalar MIME/Base64 Time/HiRes \
840                 Unicode/Normalize Win32
841 STATIC_EXT      = DynaLoader
842 NONXS_EXT       = Errno
843
844 DYNALOADER      = $(EXTDIR)\DynaLoader\DynaLoader
845
846 POD2HTML        = $(PODDIR)\pod2html
847 POD2MAN         = $(PODDIR)\pod2man
848 POD2LATEX       = $(PODDIR)\pod2latex
849 POD2TEXT        = $(PODDIR)\pod2text
850
851 # vars must be separated by "\t+~\t+", since we're using the tempfile
852 # version of config_sh.pl (we were overflowing someone's buffer by
853 # trying to fit them all on the command line)
854 #       -- BKS 10-17-1999
855 CFG_VARS        =                                       \
856                 INST_DRV=$(INST_DRV)            ~       \
857                 INST_TOP=$(INST_TOP:s/\/\\/)    ~       \
858                 INST_VER=$(INST_VER:s/\/\\/)    ~       \
859                 INST_ARCH=$(INST_ARCH)          ~       \
860                 archname=$(ARCHNAME)            ~       \
861                 cc=$(CC)                        ~       \
862                 ld=$(LINK32)                    ~       \
863                 ccflags=$(OPTIMIZE) $(DEFINES) $(BUILDOPT)      ~       \
864                 cf_email=$(EMAIL)               ~       \
865                 d_crypt=$(D_CRYPT)              ~       \
866                 d_mymalloc=$(PERL_MALLOC)       ~       \
867                 libs=$(LIBFILES:f)              ~       \
868                 incpath=$(CCINCDIR:s/\/\\/)     ~       \
869                 libperl=$(PERLIMPLIB:f)         ~       \
870                 libpth=$(CCLIBDIR:s/\/\\/);$(EXTRALIBDIRS:s/\/\\/)      ~       \
871                 libc=$(LIBC)                    ~       \
872                 make=dmake                      ~       \
873                 _o=$(o)                         ~       \
874                 obj_ext=$(o)                    ~       \
875                 _a=$(a)                         ~       \
876                 lib_ext=$(a)                    ~       \
877                 static_ext=$(STATIC_EXT)        ~       \
878                 usethreads=$(USE_ITHREADS)      ~       \
879                 use5005threads=$(USE_5005THREADS)       ~       \
880                 useithreads=$(USE_ITHREADS)     ~       \
881                 usemultiplicity=$(USE_MULTI)    ~       \
882                 useperlio=$(USE_PERLIO)         ~       \
883                 uselargefiles=$(USE_LARGE_FILES)        ~       \
884                 LINK_FLAGS=$(LINK_FLAGS:s/\/\\/)        ~       \
885                 optimize=$(OPTIMIZE)
886
887 #
888 # set up targets varying between Win95 and WinNT builds
889 #
890
891 .IF "$(IS_WIN95)" == "define"
892 MK2             = .\makefile.95
893 RIGHTMAKE       = __switch_makefiles
894 NOOP            = @rem
895 .ELSE
896 MK2             = __not_needed
897 RIGHTMAKE       =
898 .ENDIF
899
900 #
901 # Top targets
902 #
903
904 all : .\config.h $(GLOBEXE) $(MINIPERL) $(MK2)          \
905         $(RIGHTMAKE) $(MINIMOD) $(CONFIGPM) $(UNIDATAFILES) $(PERLEXE)  \
906         $(X2P) Extensions
907
908 $(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
909
910 #----------------------------------------------------------------
911
912 #-------------------- BEGIN Win95 SPECIFIC ----------------------
913
914 # this target is a jump-off point for Win95
915 #  1. it switches to the Win95-specific makefile if it exists
916 #     (__do_switch_makefiles)
917 #  2. it prints a message when the Win95-specific one finishes (__done)
918 #  3. it then kills this makefile by trying to make __no_such_target
919
920 __switch_makefiles: __do_switch_makefiles __done __no_such_target
921
922 __do_switch_makefiles:
923 .IF "$(NOTFIRST)" != "true"
924         if exist $(MK2) $(MAKE:s/-S//) -f $(MK2) $(MAKETARGETS) NOTFIRST=true
925 .ELSE
926         $(NOOP)
927 .ENDIF
928
929 .IF "$(NOTFIRST)" != "true"
930 __done:
931         @echo Build process complete. Ignore any errors after this message.
932         @echo Run "dmake test" to test and "dmake install" to install
933
934 .ELSE
935 # dummy targets for Win95-specific makefile
936
937 __done:
938         $(NOOP)
939
940 __no_such_target:
941         $(NOOP)
942
943 .ENDIF
944
945 # This target is used to generate the new makefile (.\makefile.95) for Win95
946
947 .\makefile.95: .\makefile.mk
948         $(MINIPERL) genmk95.pl makefile.mk $(MK2)
949
950 #--------------------- END Win95 SPECIFIC ---------------------
951
952 # a blank target for when builds don't need to do certain things
953 # this target added for Win95 port but used to keep the WinNT port able to
954 # use this file
955 __not_needed:
956         $(NOOP)
957
958 $(GLOBEXE) : perlglob$(o)
959 .IF "$(CCTYPE)" == "BORLAND"
960         $(CC) -c -w -v -tWM -I"$(CCINCDIR)" perlglob.c
961         $(LINK32) -Tpe -ap $(BLINK_FLAGS) c0x32$(o) perlglob$(o) \
962             "$(CCLIBDIR)\32BIT\wildargs$(o)",$@,,import32.lib cw32mt.lib,
963 .ELIF "$(CCTYPE)" == "GCC"
964         $(LINK32) $(BLINK_FLAGS) -mconsole -o $@ perlglob$(o) $(LIBFILES)
965 .ELSE
966         $(LINK32) $(BLINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
967             perlglob$(o) setargv$(o)
968 .ENDIF
969
970 perlglob$(o)  : perlglob.c
971
972 config.w32 : $(CFGSH_TMPL)
973         copy $(CFGSH_TMPL) config.w32
974
975 .\config.h : $(CFGH_TMPL) $(CORE_NOCFG_H)
976         -del /f config.h
977         copy $(CFGH_TMPL) config.h
978
979 ..\config.sh : config.w32 $(MINIPERL) config_sh.PL FindExt.pm
980         $(MINIPERL) -I..\lib config_sh.PL --cfgsh-option-file \
981             $(mktmp $(CFG_VARS)) config.w32 > ..\config.sh
982
983 # this target is for when changes to the main config.sh happen
984 # edit config.{b,v,g}c and make this target once for each supported
985 # compiler (e.g. `dmake CCTYPE=BORLAND regen_config_h`)
986 regen_config_h:
987         perl config_sh.PL --cfgsh-option-file $(mktmp $(CFG_VARS)) \
988             $(CFGSH_TMPL) > ..\config.sh
989         -cd .. && del /f perl.exe
990         -cd .. && del /f perl*.dll
991         cd .. && perl configpm
992         -del /f $(CFGH_TMPL)
993         -mkdir $(COREDIR)
994         -perl config_h.PL "INST_VER=$(INST_VER)"
995         rename config.h $(CFGH_TMPL)
996
997 $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
998         cd .. && miniperl configpm
999         if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
1000         $(XCOPY) ..\*.h $(COREDIR)\*.*
1001         $(XCOPY) ..\*.inc $(COREDIR)\*.*
1002         $(XCOPY) *.h $(COREDIR)\*.*
1003         $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.*
1004         $(RCOPY) include $(COREDIR)\*.*
1005         $(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \
1006             || $(MAKE) $(MAKEMACROS) $(CONFIGPM) $(MAKEFILE)
1007
1008 $(MINIPERL) : $(MINIDIR) $(MINI_OBJ) $(CRTIPMLIBS)
1009 .IF "$(CCTYPE)" == "BORLAND"
1010         $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
1011             @$(mktmp c0x32$(o) $(MINI_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
1012 .ELIF "$(CCTYPE)" == "GCC"
1013         $(LINK32) -v -mconsole -o $@ $(BLINK_FLAGS) \
1014             $(mktmp $(LKPRE) $(MINI_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
1015 .ELSE
1016         $(LINK32) -subsystem:console -out:$@ \
1017             @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(MINI_OBJ:s,\,\\))
1018 .ENDIF
1019
1020 $(MINIDIR) :
1021         if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
1022
1023 $(MINICORE_OBJ) : $(CORE_NOCFG_H)
1024         $(CC) -c $(CFLAGS) -DPERL_EXTERNAL_GLOB $(OBJOUT_FLAG)$@ ..\$(*B).c
1025
1026 $(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
1027         $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*B).c
1028
1029 # -DPERL_IMPLICIT_SYS needs C++ for perllib.c
1030 # rules wrapped in .IFs break Win9X build (we end up with unbalanced []s unless
1031 # unless the .IF is true), so instead we use a .ELSE with the default.
1032 # This is the only file that depends on perlhost.h, vmem.h, and vdir.h
1033
1034 perllib$(o)     : perllib.c .\perlhost.h .\vdir.h .\vmem.h
1035 .IF "$(USE_IMP_SYS)" == "define"
1036         $(CC) -c -I. -DWITH_STATIC $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
1037 .ELSE
1038         $(CC) -c -I. -DWITH_STATIC $(CFLAGS_O) $(OBJOUT_FLAG)$@ perllib.c
1039 .ENDIF
1040
1041 # 1. we don't want to rebuild miniperl.exe when config.h changes
1042 # 2. we don't want to rebuild miniperl.exe with non-default config.h
1043 $(MINI_OBJ)     : $(CORE_NOCFG_H)
1044
1045 $(WIN32_OBJ)    : $(CORE_H)
1046
1047 $(CORE_OBJ)     : $(CORE_H)
1048
1049 $(DLL_OBJ)      : $(CORE_H)
1050
1051 $(X2P_OBJ)      : $(CORE_H)
1052
1053 perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl
1054         $(MINIPERL) -I..\lib buildext.pl --create-perllibst-h $(STATIC_EXT)
1055         $(MINIPERL) -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) \
1056         $(BUILDOPT) CCTYPE=$(CCTYPE) > perldll.def
1057
1058 $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES) Extensions_static
1059 .IF "$(CCTYPE)" == "BORLAND"
1060         $(LINK32) -Tpd -ap $(BLINK_FLAGS) \
1061             @$(mktmp c0d32$(o) $(PERLDLL_OBJ:s,\,\\)\n \
1062                 $@,\n \
1063                 $(LIBFILES)\n \
1064                 perldll.def\n)
1065         $(IMPLIB) $*.lib $@
1066 .ELIF "$(CCTYPE)" == "GCC"
1067         $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(BLINK_FLAGS) \
1068             $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
1069         dlltool --output-lib $(PERLIMPLIB) \
1070                 --dllname $(PERLDLL:b).dll \
1071                 --def perldll.def \
1072                 --base-file perl.base \
1073                 --output-exp perl.exp
1074         $(LINK32) -mdll -o $@ $(BLINK_FLAGS) \
1075             $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) \
1076                 perl.exp $(LKPOST))
1077 .ELSE
1078         $(LINK32) -dll -def:perldll.def -out:$@ \
1079             $(shell $(MINIPERL) -I..\lib buildext.pl --list-static-libs) \
1080             @$(mktmp -base:0x28000000 $(BLINK_FLAGS) $(DELAYLOAD) $(LIBFILES) \
1081                 $(PERLDLL_RES) $(PERLDLL_OBJ:s,\,\\))
1082 .ENDIF
1083         $(XCOPY) $(PERLIMPLIB) $(COREDIR)
1084
1085
1086 $(PERLEXE_ICO): $(MINIPERL) makeico.pl
1087         $(MINIPERL) makeico.pl > $@
1088
1089 $(PERLEXE_RES): perlexe.rc $(PERLEXE_ICO)
1090
1091 $(MINIMOD) : $(MINIPERL) ..\minimod.pl
1092         cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
1093
1094 ..\x2p\a2p$(o) : ..\x2p\a2p.c
1095         $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\a2p.c
1096
1097 ..\x2p\hash$(o) : ..\x2p\hash.c
1098         $(CC) -I..\x2p  $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\hash.c
1099
1100 ..\x2p\str$(o) : ..\x2p\str.c
1101         $(CC) -I..\x2p  $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\str.c
1102
1103 ..\x2p\util$(o) : ..\x2p\util.c
1104         $(CC) -I..\x2p  $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\util.c
1105
1106 ..\x2p\walk$(o) : ..\x2p\walk.c
1107         $(CC) -I..\x2p  $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\walk.c
1108
1109 $(X2P) : $(MINIPERL) $(X2P_OBJ)
1110         $(MINIPERL) ..\x2p\find2perl.PL
1111         $(MINIPERL) ..\x2p\s2p.PL
1112 .IF "$(CCTYPE)" == "BORLAND"
1113         $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
1114             @$(mktmp c0x32$(o) $(X2P_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
1115 .ELIF "$(CCTYPE)" == "GCC"
1116         $(LINK32) -v -o $@ $(BLINK_FLAGS) \
1117             $(mktmp $(LKPRE) $(X2P_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
1118 .ELSE
1119         $(LINK32) -subsystem:console -out:$@ \
1120             @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(X2P_OBJ:s,\,\\))
1121 .ENDIF
1122
1123 perlmain.c : runperl.c
1124         copy runperl.c perlmain.c
1125
1126 perlmain$(o) : perlmain.c
1127         $(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c
1128
1129 $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES)
1130 .IF "$(CCTYPE)" == "BORLAND"
1131         $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
1132             @$(mktmp c0x32$(o) $(PERLEXE_OBJ:s,\,\\)\n \
1133             $(@:s,\,\\),\n \
1134             $(PERLIMPLIB) $(LIBFILES)\n)
1135 .ELIF "$(CCTYPE)" == "GCC"
1136         $(LINK32) -mconsole -o $@ $(BLINK_FLAGS)  \
1137             $(PERLEXE_OBJ) $(PERLIMPLIB) $(LIBFILES)
1138 .ELSE
1139         $(LINK32) -subsystem:console -out:$@ -stack:0x1000000 $(BLINK_FLAGS) \
1140             $(LIBFILES) $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES)
1141 .ENDIF
1142         copy $(PERLEXE) $(WPERLEXE)
1143         $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS
1144         copy splittree.pl ..
1145         $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
1146
1147 $(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
1148         if not exist $(AUTODIR) mkdir $(AUTODIR)
1149         cd $(EXTDIR)\$(*B) && ..\$(MINIPERL) -I..\..\lib $(*B)_pm.PL
1150         cd $(EXTDIR)\$(*B) && ..\$(MINIPERL) -I..\..\lib XSLoader_pm.PL
1151         $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
1152         $(XCOPY) $(EXTDIR)\$(*B)\XSLoader.pm $(LIBDIR)\$(NULL)
1153         cd $(EXTDIR)\$(*B) && $(XSUBPP) dl_win32.xs > $(*B).c
1154         $(XCOPY) $(EXTDIR)\$(*B)\dlutils.c .
1155
1156 $(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
1157         copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
1158
1159 #----------------------------------------------------------------------------------
1160 Extensions : buildext.pl $(PERLDEP) $(CONFIGPM)
1161         $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --dynamic
1162         $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic
1163
1164 Extensions_static : buildext.pl
1165         $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --static
1166         $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --static
1167
1168 # Note: The next two targets explicitly remove a "blibdirs.exists" file that
1169 # currerntly gets left behind, until CPAN RT Ticket #5616 is resolved.
1170
1171 Extensions_clean :
1172         -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) clean
1173         -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext clean
1174         -if exist $(EXTDIR)\SDBM_File\sdbm\blibdirs.exists del /f $(EXTDIR)\SDBM_File\sdbm\blibdirs.exists
1175
1176 Extensions_realclean :
1177         -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) realclean
1178         -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext realclean
1179         -if exist $(EXTDIR)\SDBM_File\sdbm\blibdirs.exists del /f $(EXTDIR)\SDBM_File\sdbm\blibdirs.exists
1180
1181 #----------------------------------------------------------------------------------
1182
1183
1184 doc: $(PERLEXE)
1185         $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=./html \
1186             --podpath=pod:lib:ext:utils --htmlroot="file://$(INST_HTML:s,:,|,)"\
1187             --libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse
1188
1189 # Note that this next section is parsed (and regenerated) by pod/buildtoc
1190 # so please check that script before making structural changes here
1191 utils: $(PERLEXE) $(X2P)
1192         cd ..\utils && $(MAKE) PERL=$(MINIPERL)
1193         copy ..\vms\perlvms.pod ..\pod\perlvms.pod
1194         copy ..\README.aix      ..\pod\perlaix.pod
1195         copy ..\README.amiga    ..\pod\perlamiga.pod
1196         copy ..\README.apollo   ..\pod\perlapollo.pod
1197         copy ..\README.beos     ..\pod\perlbeos.pod
1198         copy ..\README.bs2000   ..\pod\perlbs2000.pod
1199         copy ..\README.ce       ..\pod\perlce.pod
1200         copy ..\README.cn       ..\pod\perlcn.pod
1201         copy ..\README.cygwin   ..\pod\perlcygwin.pod
1202         copy ..\README.dgux     ..\pod\perldgux.pod
1203         copy ..\README.dos      ..\pod\perldos.pod
1204         copy ..\README.epoc     ..\pod\perlepoc.pod
1205         copy ..\README.freebsd  ..\pod\perlfreebsd.pod
1206         copy ..\README.hpux     ..\pod\perlhpux.pod
1207         copy ..\README.hurd     ..\pod\perlhurd.pod
1208         copy ..\README.irix     ..\pod\perlirix.pod
1209         copy ..\README.jp       ..\pod\perljp.pod
1210         copy ..\README.ko       ..\pod\perlko.pod
1211         copy ..\README.machten  ..\pod\perlmachten.pod
1212         copy ..\README.macos    ..\pod\perlmacos.pod
1213         copy ..\README.macosx   ..\pod\perlmacosx.pod
1214         copy ..\README.mint     ..\pod\perlmint.pod
1215         copy ..\README.mpeix    ..\pod\perlmpeix.pod
1216         copy ..\README.netware  ..\pod\perlnetware.pod
1217         copy ..\README.os2      ..\pod\perlos2.pod
1218         copy ..\README.os390    ..\pod\perlos390.pod
1219         copy ..\README.os400    ..\pod\perlos400.pod
1220         copy ..\README.plan9    ..\pod\perlplan9.pod
1221         copy ..\README.qnx      ..\pod\perlqnx.pod
1222         copy ..\README.solaris  ..\pod\perlsolaris.pod
1223         copy ..\README.tru64    ..\pod\perltru64.pod
1224         copy ..\README.tw       ..\pod\perltw.pod
1225         copy ..\README.uts      ..\pod\perluts.pod
1226         copy ..\README.vmesa    ..\pod\perlvmesa.pod
1227         copy ..\README.vms      ..\pod\perlvms.pod
1228         copy ..\README.vos      ..\pod\perlvos.pod
1229         copy ..\README.win32    ..\pod\perlwin32.pod
1230         copy ..\pod\perl586delta.pod ..\pod\perldelta.pod
1231         cd ..\pod && $(MAKE) -f ..\win32\pod.mak converters
1232         cd ..\lib && $(PERLEXE) lib_pm.PL
1233         $(PERLEXE) $(PL2BAT) $(UTILS)
1234
1235 # Note that the pod cleanup in this next section is parsed (and regenerated
1236 # by pod/buildtoc so please check that script before making changes here
1237
1238 # the doubled rmdir calls are needed because older cmd shells
1239 # don't understand /q
1240 distclean: realclean
1241         -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \
1242                 $(PERLIMPLIB) ..\miniperl$(a) $(MINIMOD)
1243         -del /f *.def *.map
1244         -del /f $(DYNALOADER).c
1245         -del /f $(EXTDIR)\DynaLoader\dl_win32.xs
1246         -del /f $(EXTDIR)\DynaLoader\DynaLoader.pm
1247         -del /f $(EXTDIR)\DynaLoader\XSLoader.pm
1248         -del /f $(LIBDIR)\Encode.pm $(LIBDIR)\encoding.pm $(LIBDIR)\Errno.pm
1249         -del /f $(LIBDIR)\Config.pod $(LIBDIR)\POSIX.pod $(LIBDIR)\threads.pm
1250         -del /f $(LIBDIR)\.exists $(LIBDIR)\attrs.pm $(LIBDIR)\DynaLoader.pm
1251         -del /f $(LIBDIR)\XSLoader.pm $(LIBDIR)\lib.pm
1252         -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
1253         -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm
1254         -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
1255         -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
1256         -del /f $(LIBDIR)\ByteLoader.pm
1257         -del /f $(LIBDIR)\Devel\Peek.pm $(LIBDIR)\Devel\DProf.pm
1258         -del /f $(LIBDIR)\Devel\PPPort.pm
1259         -del /f $(LIBDIR)\File\Glob.pm
1260         -del /f $(LIBDIR)\Storable.pm
1261         -del /f $(LIBDIR)\Digest\MD5.pm
1262         -del /f $(LIBDIR)\PerlIO\encoding.pm
1263         -del /f $(LIBDIR)\PerlIO\scalar.pm
1264         -del /f $(LIBDIR)\PerlIO\via.pm
1265         -del /f $(LIBDIR)\Sys\Hostname.pm
1266         -del /f $(LIBDIR)\Thread\Signal.pm $(LIBDIR)\Thread\Specific.pm
1267         -del /f $(LIBDIR)\threads\shared.pm
1268         -del /f $(LIBDIR)\Time\HiRes.pm
1269         -del /f $(LIBDIR)\Unicode\Normalize.pm
1270         -del /f $(LIBDIR)\Win32.pm
1271         -if exist $(LIBDIR)\IO rmdir /s /q $(LIBDIR)\IO
1272         -if exist $(LIBDIR)\IO rmdir /s $(LIBDIR)\IO
1273         -if exist $(LIBDIR)\B rmdir /s /q $(LIBDIR)\B
1274         -if exist $(LIBDIR)\B rmdir /s $(LIBDIR)\B
1275         -if exist $(LIBDIR)\Data rmdir /s /q $(LIBDIR)\Data
1276         -if exist $(LIBDIR)\Data rmdir /s $(LIBDIR)\Data
1277         -if exist $(LIBDIR)\Encode rmdir /s /q $(LIBDIR)\Encode
1278         -if exist $(LIBDIR)\Encode rmdir /s $(LIBDIR)\Encode
1279         -if exist $(LIBDIR)\Filter\Util rmdir /s /q $(LIBDIR)\Filter\Util
1280         -if exist $(LIBDIR)\Filter\Util rmdir /s $(LIBDIR)\Filter\Util
1281         -if exist $(LIBDIR)\MIME rmdir /s /q $(LIBDIR)\MIME
1282         -if exist $(LIBDIR)\MIME rmdir /s $(LIBDIR)\MIME
1283         -if exist $(LIBDIR)\List rmdir /s /q $(LIBDIR)\List
1284         -if exist $(LIBDIR)\List rmdir /s $(LIBDIR)\List
1285         -if exist $(LIBDIR)\Scalar rmdir /s /q $(LIBDIR)\Scalar
1286         -if exist $(LIBDIR)\Scalar rmdir /s $(LIBDIR)\Scalar
1287         -if exist $(LIBDIR)\XS rmdir /s /q $(LIBDIR)\XS
1288         -if exist $(LIBDIR)\XS rmdir /s $(LIBDIR)\XS
1289         -cd $(PODDIR) && del /f *.html *.bat checkpods \
1290             perlaix.pod perlamiga.pod perlapollo.pod perlbeos.pod \
1291             perlbs2000.pod perlce.pod perlcn.pod perlcygwin.pod \
1292             perldelta.pod perldgux.pod perldos.pod perlepoc.pod \
1293             perlfreebsd.pod perlhpux.pod perlhurd.pod perlirix.pod \
1294             perljp.pod perlko.pod perlmachten.pod perlmacos.pod \
1295             perlmacosx.pod perlmint.pod perlmpeix.pod perlnetware.pod \
1296             perlos2.pod perlos390.pod perlos400.pod perlplan9.pod \
1297             perlqnx.pod perlsolaris.pod perltru64.pod perltw.pod \
1298             perluts.pod perlvmesa.pod perlvms.pod perlvms.pod perlvos.pod \
1299             perlwin32.pod \
1300             pod2html pod2latex pod2man pod2text pod2usage \
1301             podchecker podselect
1302         -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph pstruct h2xs \
1303             perldoc perlivp dprofpp perlcc libnetcfg enc2xs piconv cpan *.bat \
1304             xsubpp instmodsh prove
1305         -cd ..\x2p && del /f find2perl s2p psed *.bat
1306         -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
1307         -del /f $(CONFIGPM)
1308         -del /f bin\*.bat
1309         -del /f perllibst.h
1310         -del /f $(PERLEXE_ICO) perl.base
1311         -cd .. && del /s *$(a) *.map *.pdb *.ilk *.bs *$(o) .exists pm_to_blib
1312         -cd $(EXTDIR) && del /s *.def Makefile Makefile.old
1313         -if exist $(AUTODIR) rmdir /s /q $(AUTODIR)
1314         -if exist $(AUTODIR) rmdir /s $(AUTODIR)
1315         -if exist $(COREDIR) rmdir /s /q $(COREDIR)
1316         -if exist $(COREDIR) rmdir /s $(COREDIR)
1317
1318 install : all installbare installhtml
1319
1320 installbare : $(RIGHTMAKE) utils
1321         $(PERLEXE) ..\installperl
1322         if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\*.*
1323         $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
1324         if exist ..\perl*.pdb $(XCOPY) ..\perl*.pdb $(INST_BIN)\*.*
1325         if exist ..\x2p\a2p.pdb $(XCOPY) ..\x2p\a2p.pdb $(INST_BIN)\*.*
1326         $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.*
1327
1328 installhtml : doc
1329         $(RCOPY) html\*.* $(INST_HTML)\*.*
1330
1331 inst_lib : $(CONFIGPM)
1332         copy splittree.pl ..
1333         $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
1334         $(RCOPY) ..\lib $(INST_LIB)\*.*
1335
1336 # Move the rule for making $(UNIDATAFILES) into a separate target and leave the
1337 # actual rule here blank because dmake runs the rule here once for each of the
1338 # files listed in $(UNIDATAFILES)
1339 $(UNIDATAFILES) : make_unidatafiles
1340
1341 make_unidatafiles : $(MINIPERL) $(CONFIGPM) ..\lib\unicore\mktables
1342         cd ..\lib\unicore && \
1343         ..\$(MINIPERL) -I.. mktables
1344
1345 minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) $(UNIDATAFILES) utils
1346         $(XCOPY) $(MINIPERL) ..\t\$(NULL)
1347         if exist ..\t\perl.exe del /f ..\t\perl.exe
1348         rename ..\t\miniperl.exe perl.exe
1349 .IF "$(CCTYPE)" == "BORLAND"
1350         $(XCOPY) $(GLOBBAT) ..\t\$(NULL)
1351 .ELSE
1352         $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1353 .ENDIF
1354         attrib -r ..\t\*.*
1355         cd ..\t && \
1356         $(MINIPERL) -I..\lib harness base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t
1357
1358 test-prep : all utils
1359         $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1360         $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1361 .IF "$(CCTYPE)" == "BORLAND"
1362         $(XCOPY) $(GLOBBAT) ..\t\$(NULL)
1363 .ELSE
1364         $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1365 .ENDIF
1366
1367 test : $(RIGHTMAKE) test-prep
1368         cd ..\t && $(PERLEXE) -I..\lib harness
1369
1370 test-notty : test-prep
1371         set PERL_SKIP_TTY_TEST=1 && \
1372             cd ..\t && $(PERLEXE) -I.\lib harness
1373
1374 _test : $(RIGHTMAKE)
1375         $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1376         $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1377 .IF "$(CCTYPE)" == "BORLAND"
1378         $(XCOPY) $(GLOBBAT) ..\t\$(NULL)
1379 .ELSE
1380         $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1381 .ENDIF
1382         cd ..\t && $(PERLEXE) -I..\lib harness
1383
1384 # the doubled rmdir calls are needed because older cmd shells
1385 # don't understand /q
1386 _clean :
1387         -@erase miniperlmain$(o)
1388         -@erase $(MINIPERL)
1389         -@erase perlglob$(o)
1390         -@erase perlmain$(o)
1391         -@erase config.w32
1392         -@erase /f config.h
1393         -@erase $(GLOBEXE)
1394         -@erase $(PERLEXE)
1395         -@erase $(WPERLEXE)
1396         -@erase $(PERLDLL)
1397         -@erase $(CORE_OBJ)
1398         -if exist $(MINIDIR) rmdir /s /q $(MINIDIR)
1399         -if exist $(MINIDIR) rmdir /s $(MINIDIR)
1400         -if exist $(UNIDATADIR1) rmdir /s /q $(UNIDATADIR1)
1401         -if exist $(UNIDATADIR1) rmdir /s $(UNIDATADIR1)
1402         -if exist $(UNIDATADIR2) rmdir /s /q $(UNIDATADIR2)
1403         -if exist $(UNIDATADIR2) rmdir /s $(UNIDATADIR2)
1404         -@erase $(UNIDATAFILES)
1405         -@erase $(WIN32_OBJ)
1406         -@erase $(DLL_OBJ)
1407         -@erase $(X2P_OBJ)
1408         -@erase ..\*$(o) ..\*$(a) ..\*.exp *$(o) *$(a) *.exp *.res
1409         -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
1410         -@erase ..\x2p\*.exe ..\x2p\*.bat
1411         -@erase *.ilk
1412         -@erase *.pdb
1413
1414 clean : Extensions_clean _clean
1415
1416 realclean : Extensions_realclean _clean
1417
1418 # Handy way to run perlbug -ok without having to install and run the
1419 # installed perlbug. We don't re-run the tests here - we trust the user.
1420 # Please *don't* use this unless all tests pass.
1421 # If you want to report test failures, use "dmake nok" instead.
1422 ok: utils
1423         $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)"
1424
1425 okfile: utils
1426         $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)" -F perl.ok
1427
1428 nok: utils
1429         $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)"
1430
1431 nokfile: utils
1432         $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)" -F perl.nok