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