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