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