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