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