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