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