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