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