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