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