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