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