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