Debian Codegraph @

win32/GNUmakefile

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