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