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