This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
win32: remove support for disabling USE_LARGE_FILES
[perl5.git] / win32 / GNUmakefile
CommitLineData
342634f3 1#
b6e5775f
DD
2# Makefile to build perl on Windows using GMAKE.
3# Supported compilers:
7adf2470 4# Microsoft Visual C++ 7.0 or later
8a217c9a
SH
5# MinGW with gcc-3.4.5 or later with runtime < 3.21
6# MinGW64 with gcc-4.4.3 or later
b6e5775f 7# Windows SDK 64-bit compiler and tools
342634f3 8#
9# This is set up to build a perl.exe that runs off a shared library
f69f4f3b 10# (perl533.dll). Also makes individual DLLs for the XS extensions.
342634f3 11#
12# The easiest way to customize the build process is to use parameters like this:
13#
14# c:\dev\perlsrc\win32> gmake INST_TOP=c:\sw\perl CCHOME=c:\sw\mingw USE_64_BIT_INT=define
15
16
17##
18## Make sure you read README.win32 *before* you mess with anything here!
19##
20
21#
22# We set this to point to cmd.exe in case GNU Make finds sh.exe in the path.
23# Comment this line out if necessary
24#
25SHELL := cmd.exe
26
27# define whether you want to use native gcc compiler or cross-compiler
28# possible values: gcc
29# i686-w64-mingw32-gcc
30# x86_64-w64-mingw32-gcc
31GCCBIN := gcc
32
33ifeq ($(GCCBIN),x86_64-w64-mingw32-gcc)
34GCCCROSS := x86_64-w64-mingw32
35endif
36ifeq ($(GCCBIN),i686-w64-mingw32-gcc)
37GCCCROSS := i686-w64-mingw32
38endif
39
342634f3 40
342634f3 41##
42## Build configuration. Edit the values below to suit your needs.
43##
44
45#
46# Set these to wherever you want "gmake install" to put your
47# newly built perl.
48#
49INST_DRV := c:
50INST_TOP := $(INST_DRV)\perl
51
52#
b6e5775f
DD
53# Uncomment if you want to build a 32-bit Perl using a 32-bit compiler
54# on a 64-bit version of Windows.
55#
56#WIN64 := undef
57
58#
342634f3 59# Comment this out if you DON'T want your perl installation to be versioned.
60# This means that the new installation will overwrite any files from the
61# old installation at the same INST_TOP location. Leaving it enabled is
62# the safest route, as perl adds the extra version directory to all the
63# locations it installs files to. If you disable it, an alternative
64# versioned installation can be obtained by setting INST_TOP above to a
65# path that includes an arbitrary version string.
66#
790f2f66 67#INST_VER := \5.33.5
342634f3 68
69#
70# Comment this out if you DON'T want your perl installation to have
71# architecture specific components. This means that architecture-
72# specific files will be installed along with the architecture-neutral
73# files. Leaving it enabled is safer and more flexible, in case you
74# want to build multiple flavors of perl and install them together in
75# the same location. Commenting it out gives you a simpler
76# installation that is easier to understand for beginners.
77#
78#INST_ARCH := \$(ARCHNAME)
79
80#
81# Uncomment this if you want perl to run
82# $Config{sitelibexp}\sitecustomize.pl
83# before anything else. This script can then be set up, for example,
84# to add additional entries to @INC.
85#
86#USE_SITECUST := define
87
88#
89# uncomment to enable multiple interpreters. This is needed for fork()
90# emulation and for thread support, and is auto-enabled by USE_IMP_SYS
91# and USE_ITHREADS below.
92#
93USE_MULTI := define
94
95#
96# Interpreter cloning/threads; now reasonably complete.
97# This should be enabled to get the fork() emulation. This needs (and
98# will auto-enable) USE_MULTI above.
99#
100USE_ITHREADS := define
101
102#
103# uncomment to enable the implicit "host" layer for all system calls
104# made by perl. This is also needed to get fork(). This needs (and
105# will auto-enable) USE_MULTI above.
106#
107USE_IMP_SYS := define
108
109#
110# Comment out next assign to disable perl's I/O subsystem and use compiler's
111# stdio for IO - depending on your compiler vendor and run time library you may
112# then get a number of fails from make test i.e. bugs - complain to them not us ;-).
113# You will also be unable to take full advantage of perl5.8's support for multiple
114# encodings and may see lower IO performance. You have been warned.
115#
116USE_PERLIO := define
117
118#
342634f3 119# Uncomment this if you're building a 32-bit perl and want 64-bit integers.
120# (If you're building a 64-bit perl then you will have 64-bit integers whether
121# or not this is uncommented.)
342634f3 122#
123#USE_64_BIT_INT := define
124
125#
b6e5775f
DD
126# Uncomment this if you want to support the use of long doubles in GCC builds.
127# This option is not supported for MSVC builds.
342634f3 128#
f019f33b
SH
129#USE_LONG_DOUBLE := define
130
131#
132# Uncomment this if you want to build perl with __USE_MINGW_ANSI_STDIO defined.
133# (If you're building perl with USE_LONG_DOUBLE defined then
134# __USE_MINGW_ANSI_STDIO will be defined whether or not this is uncommented.)
135# This option is not supported for MSVC builds.
136#
137#USE_MINGW_ANSI_STDIO := define
342634f3 138
139#
458ea8f7
SH
140# Comment this out if you want the legacy default behavior of including '.' at
141# the end of @INC.
142#
143DEFAULT_INC_EXCLUDES_DOT := define
144
145#
bf543eaf
DD
146# Uncomment this if you want to disable looking up values from
147# HKEY_CURRENT_USER\Software\Perl and HKEY_LOCAL_MACHINE\Software\Perl in
148# the Registry.
149#
150#USE_NO_REGISTRY := define
151
152#
b6e5775f
DD
153# uncomment exactly one of the following
154#
b6e5775f
DD
155# Visual C++ .NET 2002/2003 (aka Visual C++ 7.0/7.1) (full version)
156#CCTYPE := MSVC70
157# Visual C++ Toolkit 2003 (aka Visual C++ 7.1) (free command-line tools)
158#CCTYPE := MSVC70FREE
b969270a 159# Windows Server 2003 SP1 Platform SDK (April 2005) (64-bit compiler and tools)
b6e5775f 160#CCTYPE := SDK2003SP1
3aa3d69a 161# Visual C++ 2005 (aka Visual C++ 8.0) (full version or Express Edition)
b6e5775f 162#CCTYPE := MSVC80
3aa3d69a 163# Visual C++ 2008 (aka Visual C++ 9.0) (full version or Express Edition)
b6e5775f 164#CCTYPE := MSVC90
3aa3d69a 165# Visual C++ 2010 (aka Visual C++ 10.0) (full version or Express Edition)
b6e5775f 166#CCTYPE := MSVC100
3aa3d69a 167# Visual C++ 2012 (aka Visual C++ 11.0) (full version or Express Edition)
b6e5775f 168#CCTYPE := MSVC110
3aa3d69a 169# Visual C++ 2013 (aka Visual C++ 12.0) (full version or Express Edition)
b6e5775f 170#CCTYPE := MSVC120
3aa3d69a 171# Visual C++ 2015 (aka Visual C++ 14.0) (full version or Express Edition)
1f664ef5 172#CCTYPE := MSVC140
3aa3d69a 173# Visual C++ 2017 (aka Visual C++ 14.1) (full version or Community Edition)
88b13658 174#CCTYPE := MSVC141
2a0cb97d
SH
175# Visual C++ 2019 (aka Visual C++ 14.2) (full version or Community Edition)
176#CCTYPE := MSVC142
b6e5775f 177# MinGW or mingw-w64 with gcc-3.4.5 or later
ca30c090 178#CCTYPE := GCC
b6e5775f
DD
179
180#
181# If you are using Intel C++ Compiler uncomment this
182#
183#__ICC := define
184
185#
cc1cf065
DD
186# Uncomment this if you want to build everything in C++ mode
187#
188#USE_CPLUSPLUS := define
189
190#
bf543eaf 191# uncomment next line if you want debug version of perl (big/slow)
342634f3 192# If not enabled, we automatically try to use maximum optimization
193# with all compilers that are known to have a working optimizer.
194#
195#CFG := Debug
196
197#
198# uncomment to enable linking with setargv.obj under the Visual C
199# compiler. Setting this options enables perl to expand wildcards in
200# arguments, but it may be harder to use alternate methods like
201# File::DosGlob that are more powerful. This option is supported only with
202# Visual C.
203#
204#USE_SETARGV := define
205
206#
207# set this if you wish to use perl's malloc
208# WARNING: Turning this on/off WILL break binary compatibility with extensions
209# you may have compiled with/without it. Be prepared to recompile all
210# extensions if you change the default. Currently, this cannot be enabled
211# if you ask for USE_IMP_SYS above.
212#
213#PERL_MALLOC := define
214
215#
216# set this to enable debugging mstats
217# This must be enabled to use the Devel::Peek::mstat() function. This cannot
218# be enabled without PERL_MALLOC as well.
219#
220#DEBUG_MSTATS := define
221
222#
223# set this to additionally provide a statically linked perl-static.exe.
224# Note that dynamic loading will not work with this perl, so you must
225# include required modules statically using the STATIC_EXT or ALL_STATIC
f69f4f3b 226# variables below. A static library perl533s.lib will also be created.
342634f3 227# Ordinary perl.exe is not affected by this option.
228#
229#BUILD_STATIC := define
230
231#
232# in addition to BUILD_STATIC the option ALL_STATIC makes *every*
d6444ca0 233# extension get statically built.
342634f3 234# This will result in a very large perl executable, but the main purpose
235# is to have proper linking set so as to be able to create miscellaneous
cd17fa28 236# executables with different built-in extensions. It implies BUILD_STATIC.
342634f3 237#
238#ALL_STATIC := define
239
240#
88b13658
SH
241# set the install locations of the compiler
242# Running VCVARS32.BAT, VCVARSALL.BAT or similar is *required* when using
243# Visual C++.
342634f3 244#
8f5d02f0
TC
245# For GCC builds this should be the directory containing the bin, include,
246# lib directories for your compiler.
247#
f82c7fdb 248#CCHOME := C:\MinGW
342634f3 249
250#
251# Additional compiler flags can be specified here.
252#
253BUILDOPT := $(BUILDOPTEXTRA)
254
255#
256# This should normally be disabled. Enabling it will disable the File::Glob
257# implementation of CORE::glob.
258#
259#BUILDOPT += -DPERL_EXTERNAL_GLOB
260
261#
262# Perl needs to read scripts in text mode so that the DATA filehandle
263# works correctly with seek() and tell(), or around auto-flushes of
264# all filehandles (e.g. by system(), backticks, fork(), etc).
265#
266# The current version on the ByteLoader module on CPAN however only
267# works if scripts are read in binary mode. But before you disable text
268# mode script reading (and break some DATA filehandle functionality)
269# please check first if an updated ByteLoader isn't available on CPAN.
270#
271BUILDOPT += -DPERL_TEXTMODE_SCRIPTS
272
273#
274# specify semicolon-separated list of extra directories that modules will
275# look for libraries (spaces in path names need not be quoted)
276#
277EXTRALIBDIRS :=
278
279#
280# set this to your email address (perl will guess a value from
a3815e44 281# your loginname and your hostname, which may not be right)
342634f3 282#
283#EMAIL :=
284
285##
286## Build configuration ends.
287##
288
289##################### CHANGE THESE ONLY IF YOU MUST #####################
290
291PERL_MALLOC ?= undef
292DEBUG_MSTATS ?= undef
293
294USE_SITECUST ?= undef
295USE_MULTI ?= undef
296USE_ITHREADS ?= undef
297USE_IMP_SYS ?= undef
298USE_PERLIO ?= undef
299USE_LARGE_FILES ?= undef
300USE_64_BIT_INT ?= undef
301USE_LONG_DOUBLE ?= undef
458ea8f7 302DEFAULT_INC_EXCLUDES_DOT ?= undef
bf543eaf 303USE_NO_REGISTRY ?= undef
342634f3 304
305ifeq ($(USE_IMP_SYS),define)
306PERL_MALLOC = undef
307endif
308
309ifeq ($(PERL_MALLOC),undef)
310DEBUG_MSTATS = undef
311endif
312
313ifeq ($(DEBUG_MSTATS),define)
314BUILDOPT += -DPERL_DEBUGGING_MSTATS
315endif
316
317ifeq ("$(USE_IMP_SYS) $(USE_MULTI)","define undef")
318USE_MULTI = define
319endif
320
321ifeq ("$(USE_ITHREADS) $(USE_MULTI)","define undef")
322USE_MULTI = define
323endif
324
325ifeq ($(USE_SITECUST),define)
326BUILDOPT += -DUSE_SITECUSTOMIZE
327endif
328
329ifneq ($(USE_MULTI),undef)
330BUILDOPT += -DPERL_IMPLICIT_CONTEXT
331endif
332
333ifneq ($(USE_IMP_SYS),undef)
334BUILDOPT += -DPERL_IMPLICIT_SYS
335endif
336
bf543eaf
DD
337ifeq ($(USE_NO_REGISTRY),define)
338BUILDOPT += -DWIN32_NO_REGISTRY
339endif
340
745dedb9 341ifeq ($(CCTYPE),GCC)
ca30c090
DD
342GCCTARGET := $(shell $(GCCBIN) -dumpmachine)
343endif
344
345#no explicit CCTYPE given, do auto detection
346ifeq ($(CCTYPE),)
347GCCTARGET := $(shell $(GCCBIN) -dumpmachine 2>NUL)
348#do we have a GCC?
349ifneq ($(GCCTARGET),)
350CCTYPE := GCC
351else
b2029beb
DD
352WIN64 := $(shell for /f "tokens=3 delims=.^ " \
353 %%i in ('cl ^2^>^&1') do @if "%%i" == "32-bit" echo undef)
354#major version of CL has diff position based on 32 vs 64
355#Microsoft (R) C/C++ Optimizing Compiler Version 15.00.30729.01 for x64
356#Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
ca30c090 357#use var to capture 1st line only, not 8th token of lines 2 & 3 in cl.exe output
b2029beb
DD
358#removing the cmd /c (extra scope) on the echo causes the env var to be undef
359#when echo executes but it isn't undef for the "set MSVCVER", gmake or
360#cmd.exe bug?
361ifeq ($(WIN64),undef)
362MSVCVER := $(shell (set MSVCVER=) & (for /f "tokens=8,9 delims=.^ " \
363 %%i in ('cl ^2^>^&1') do if not defined MSVCVER if %%i%% geq 19 \
364 (set /A "MSVCVER=((%%i-5)*10)+(%%j/10)") \
365 else (set /A "MSVCVER=(%%i-6)*10")) & cmd /c echo %%MSVCVER%%)
366else
367MSVCVER := $(shell (set MSVCVER=) & (for /f "tokens=7,8 delims=.^ " \
368 %%i in ('cl ^2^>^&1') do if not defined MSVCVER if %%i%% geq 19 \
369 (set /A "MSVCVER=((%%i-5)*10)+(%%j/10)") \
370 else (set /A "MSVCVER=(%%i-6)*10")) & cmd /c echo %%MSVCVER%%)
371endif
372#autodetect failed, reset to empty string
373ifeq ($(MSVCVER),-50)
374CCTYPE :=
375else
376CCTYPE := MSVC$(MSVCVER)
377endif
ca30c090
DD
378endif
379endif
380
88b13658
SH
381# Versions of Visual C++ up to VC++ 7.1 define $(MSVCDir); versions since then
382# define $(VCINSTALLDIR) instead, but for VC++ 14.1 we need the subfolder given
383# by $(VCToolsInstallDir).
f82c7fdb
DD
384ifeq ($(CCHOME),)
385ifeq ($(CCTYPE),GCC)
386CCHOME := C:\MinGW
88b13658
SH
387else ifeq ($(CCTYPE),MSVC70)
388CCHOME := $(MSVCDir)
389else ifeq ($(CCTYPE),MSVC70FREE)
390CCHOME := $(MSVCDir)
391else ifeq ($(CCTYPE),MSVC141)
392CCHOME := $(VCToolsInstallDir)
2a0cb97d
SH
393else ifeq ($(CCTYPE),MSVC142)
394CCHOME := $(VCToolsInstallDir)
f82c7fdb 395else
88b13658 396CCHOME := $(VCINSTALLDIR)
f82c7fdb
DD
397endif
398endif
399
ca30c090 400ifeq ($(CCTYPE),GCC)
745dedb9
DD
401ifeq ($(GCCTARGET),x86_64-w64-mingw32)
402WIN64 := define
ae146f54 403PROCESSOR_ARCHITECTURE := x64
745dedb9
DD
404endif
405ifeq ($(GCCTARGET),i686-w64-mingw32)
406WIN64 := undef
ae146f54 407PROCESSOR_ARCHITECTURE := x86
745dedb9
DD
408endif
409endif
410
b6e5775f
DD
411PROCESSOR_ARCHITECTURE ?= x86
412
413ifeq ($(WIN64),undef)
414PROCESSOR_ARCHITECTURE = x86
415endif
416
417ifeq ($(WIN64),)
418# When we are running from a 32bit cmd.exe on AMD64 then
419# PROCESSOR_ARCHITECTURE is set to x86 and PROCESSOR_ARCHITEW6432
420# is set to AMD64
421ifneq ($(PROCESSOR_ARCHITEW6432),)
422PROCESSOR_ARCHITECTURE = $(PROCESSOR_ARCHITEW6432)
423WIN64 = define
424else ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
425WIN64 = define
426else ifeq ($(PROCESSOR_ARCHITECTURE),IA64)
427WIN64 = define
428else
429WIN64 = undef
430endif
431endif
432
342634f3 433ifeq ($(WIN64),define)
434USE_64_BIT_INT = define
435endif
436
b6e5775f
DD
437# Disable the long double option for MSVC builds since that compiler
438# does not support it.
439ifneq ($(CCTYPE),GCC)
440USE_LONG_DOUBLE = undef
441endif
442
443ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
444ifeq ($(ARCHITECTURE),AMD64)
445ARCHITECTURE = x64
446endif
447ifeq ($(ARCHITECTURE),IA64)
448ARCHITECTURE = ia64
449endif
450
342634f3 451ifeq ($(USE_MULTI),define)
452ARCHNAME = MSWin32-$(ARCHITECTURE)-multi
453else
454ifeq ($(USE_PERLIO),define)
455ARCHNAME = MSWin32-$(ARCHITECTURE)-perlio
456else
457ARCHNAME = MSWin32-$(ARCHITECTURE)
458endif
459endif
460
461ifeq ($(USE_PERLIO),define)
462BUILDOPT += -DUSE_PERLIO
463endif
464
465ifeq ($(USE_ITHREADS),define)
466ARCHNAME := $(ARCHNAME)-thread
467endif
468
469ifneq ($(WIN64),define)
470ifeq ($(USE_64_BIT_INT),define)
471ARCHNAME := $(ARCHNAME)-64int
472endif
473endif
474
475ifeq ($(USE_LONG_DOUBLE),define)
476ARCHNAME := $(ARCHNAME)-ld
477endif
478
88b13658
SH
479# Set the install location of the compiler headers/libraries.
480# These are saved into $Config{incpath} and $Config{libpth}.
481ifneq ($(GCCCROSS),)
482CCINCDIR := $(CCHOME)\$(GCCCROSS)\include
483CCLIBDIR := $(CCHOME)\$(GCCCROSS)\lib
484ARCHPREFIX := $(GCCCROSS)-
6f669bf5
SH
485else ifeq ($(CCTYPE),GCC)
486CCINCDIR := $(CCHOME)\include
487CCLIBDIR := $(CCHOME)\lib
488ARCHPREFIX :=
88b13658
SH
489else
490CCINCDIR := $(CCHOME)\include
491ifeq ($(CCTYPE),MSVC141)
492ifeq ($(WIN64),define)
493CCLIBDIR := $(CCHOME)\lib\x64
494else
495CCLIBDIR := $(CCHOME)\lib\x86
496endif
2a0cb97d
SH
497else ifeq ($(CCTYPE),MSVC142)
498ifeq ($(WIN64),define)
499CCLIBDIR := $(CCHOME)\lib\x64
500else
501CCLIBDIR := $(CCHOME)\lib\x86
502endif
88b13658 503else
6f669bf5
SH
504ifeq ($(WIN64),define)
505CCLIBDIR := $(CCHOME)\lib\amd64
506else
88b13658
SH
507CCLIBDIR := $(CCHOME)\lib
508endif
6f669bf5 509endif
88b13658
SH
510ARCHPREFIX :=
511endif
512
513# Set DLL location for GCC compilers.
514ifeq ($(CCTYPE),GCC)
515ifneq ($(GCCCROSS),)
516CCDLLDIR := $(CCLIBDIR)
517else
518CCDLLDIR := $(CCHOME)\bin
519endif
520endif
521
342634f3 522ARCHDIR = ..\lib\$(ARCHNAME)
523COREDIR = ..\lib\CORE
524AUTODIR = ..\lib\auto
525LIBDIR = ..\lib
526EXTDIR = ..\ext
527DISTDIR = ..\dist
528CPANDIR = ..\cpan
529PODDIR = ..\pod
530HTMLDIR = .\html
531
342634f3 532INST_SCRIPT = $(INST_TOP)$(INST_VER)\bin
533INST_BIN = $(INST_SCRIPT)$(INST_ARCH)
534INST_LIB = $(INST_TOP)$(INST_VER)\lib
535INST_ARCHLIB = $(INST_LIB)$(INST_ARCH)
536INST_COREDIR = $(INST_ARCHLIB)\CORE
537INST_HTML = $(INST_TOP)$(INST_VER)\html
538
539#
540# Programs to compile, build .lib files and link
541#
542
543MINIBUILDOPT :=
544
b6e5775f
DD
545ifeq ($(CCTYPE),GCC)
546
342634f3 547CC = $(ARCHPREFIX)gcc
548LINK32 = $(ARCHPREFIX)g++
549LIB32 = $(ARCHPREFIX)ar rc
550IMPLIB = $(ARCHPREFIX)dlltool
551RSC = $(ARCHPREFIX)windres
552
553ifeq ($(USE_LONG_DOUBLE),define)
554BUILDOPT += -D__USE_MINGW_ANSI_STDIO
555MINIBUILDOPT += -D__USE_MINGW_ANSI_STDIO
f019f33b
SH
556else ifeq ($(USE_MINGW_ANSI_STDIO),define)
557BUILDOPT += -D__USE_MINGW_ANSI_STDIO
558MINIBUILDOPT += -D__USE_MINGW_ANSI_STDIO
342634f3 559endif
560
ca30c090
DD
561GCCVER1 := $(shell for /f "delims=. tokens=1,2,3" %%i in ('gcc -dumpversion') do echo %%i)
562GCCVER2 := $(shell for /f "delims=. tokens=1,2,3" %%i in ('gcc -dumpversion') do echo %%j)
563GCCVER3 := $(shell for /f "delims=. tokens=1,2,3" %%i in ('gcc -dumpversion') do echo %%k)
564
342634f3 565# If you are using GCC, 4.3 or later by default we add the -fwrapv option.
8034715d 566# See https://github.com/Perl/perl5/issues/13690
342634f3 567#
568GCCWRAPV := $(shell if "$(GCCVER1)"=="4" (if "$(GCCVER2)" geq "3" echo define) else if "$(GCCVER1)" geq "5" (echo define))
569
570ifeq ($(GCCWRAPV),define)
571BUILDOPT += -fwrapv
572MINIBUILDOPT += -fwrapv
573endif
574
575i = .i
576o = .o
577a = .a
578
579#
580# Options
581#
582
bf543eaf 583INCLUDES = -I.\include -I. -I..
342634f3 584DEFINES = -DWIN32
585ifeq ($(WIN64),define)
17d44595 586DEFINES += -DWIN64
342634f3 587endif
588LOCDEFS = -DPERLDLL -DPERL_CORE
342634f3 589CXX_FLAG = -xc++
590LIBC =
bf543eaf
DD
591LIBFILES = $(LIBC) -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool \
592 -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 \
593 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
342634f3 594
595ifeq ($(CFG),Debug)
4be1bfd7 596OPTIMIZE = -g -O2
342634f3 597LINK_DBG = -g
4be1bfd7 598DEFINES += -DDEBUGGING
342634f3 599else
600OPTIMIZE = -s -O2
601LINK_DBG = -s
602endif
603
604EXTRACFLAGS =
cc1cf065
DD
605ifeq ($(USE_CPLUSPLUS),define)
606EXTRACFLAGS += $(CXX_FLAG)
607endif
342634f3 608CFLAGS = $(EXTRACFLAGS) $(INCLUDES) $(DEFINES) $(LOCDEFS) $(OPTIMIZE)
609LINK_FLAGS = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)"
610OBJOUT_FLAG = -o
611EXEOUT_FLAG = -o
612LIBOUT_FLAG =
bf543eaf 613PDBOUT =
342634f3 614
615BUILDOPT += -fno-strict-aliasing -mms-bitfields
16d5aac1 616MINIBUILDOPT += -fno-strict-aliasing
b6e5775f
DD
617
618TESTPREPGCC = test-prep-gcc
619
620else
621
622o = .obj
623
624# All but the free version of VC++ 7.1 can load DLLs on demand. Makes the test
625# suite run in about 10% less time.
626ifneq ($(CCTYPE),MSVC70FREE)
627# If no registry, advapi32 is only used for Perl_pp_getlogin/getlogin/GetUserNameA
628# which is rare to execute
629ifneq ($(USE_NO_REGISTRY),undef)
630DELAYLOAD = -DELAYLOAD:ws2_32.dll -DELAYLOAD:advapi32.dll delayimp.lib
631MINIDELAYLOAD =
632else
633DELAYLOAD = -DELAYLOAD:ws2_32.dll delayimp.lib
634#miniperl never does any registry lookups
635MINIDELAYLOAD = -DELAYLOAD:advapi32.dll
636endif
637endif
638
639# Visual C++ 2005 and 2008 (VC++ 8.0 and 9.0) create manifest files for EXEs and
640# DLLs. These either need copying everywhere with the binaries, or else need
641# embedding in them otherwise MSVCR80.dll or MSVCR90.dll won't be found. For
642# simplicity, embed them if they exist (and delete them afterwards so that they
643# don't get installed too).
644EMBED_EXE_MANI = if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1 && \
645 if exist $@.manifest del $@.manifest
646EMBED_DLL_MANI = if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2 && \
647 if exist $@.manifest del $@.manifest
e84e5a4c
TK
648# This one is for perl.exe which already has an embedded manifest, so we want to
649# append to it, not replace it.
650APPEND_EXE_MANI = if exist $@.manifest mt -nologo -manifest $@.manifest -updateresource:$@;1 && \
651 if exist $@.manifest del $@.manifest
b6e5775f
DD
652
653# Most relevant compiler-specific options fall into two groups:
654# either pre-MSVC80 or MSVC80 onwards, so define a macro for this.
7adf2470 655ifeq ($(CCTYPE),MSVC70)
b6e5775f
DD
656PREMSVC80 = define
657else ifeq ($(CCTYPE),MSVC70FREE)
658PREMSVC80 = define
659else
660PREMSVC80 = undef
661endif
662
663ifneq ($(__ICC),define)
664CC = cl
665LINK32 = link
666else
667CC = icl
668LINK32 = xilink
669endif
670LIB32 = $(LINK32) -lib
671RSC = rc
672
673#
674# Options
675#
676
677INCLUDES = -I.\include -I. -I..
678#PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX
679DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT
680LOCDEFS = -DPERLDLL -DPERL_CORE
681CXX_FLAG = -TP -EHsc
4be1bfd7 682EXTRACFLAGS = -nologo -GF -W3
b6e5775f 683
1f664ef5
SH
684ifeq ($(CCTYPE),MSVC140)
685LIBC = ucrt.lib
88b13658
SH
686else ifeq ($(CCTYPE),MSVC141)
687LIBC = ucrt.lib
2a0cb97d
SH
688else ifeq ($(CCTYPE),MSVC142)
689LIBC = ucrt.lib
1f664ef5 690else
b6e5775f 691LIBC = msvcrt.lib
1f664ef5 692endif
b6e5775f
DD
693
694ifeq ($(CFG),Debug)
4be1bfd7 695OPTIMIZE = -Od -Zi
b6e5775f 696LINK_DBG = -debug
4be1bfd7
TK
697DEFINES += -DDEBUGGING
698EXTRACFLAGS += -MD
b6e5775f 699else ifeq ($(CFG),DebugSymbols)
4be1bfd7 700OPTIMIZE = -Od -Zi
b6e5775f 701LINK_DBG = -debug
4be1bfd7 702EXTRACFLAGS += -MD
b6e5775f 703else ifeq ($(CFG),DebugFull)
1f664ef5
SH
704ifeq ($(CCTYPE),MSVC140)
705LIBC = ucrtd.lib
88b13658
SH
706else ifeq ($(CCTYPE),MSVC141)
707LIBC = ucrtd.lib
2a0cb97d
SH
708else ifeq ($(CCTYPE),MSVC142)
709LIBC = ucrtd.lib
1f664ef5 710else
b6e5775f 711LIBC = msvcrtd.lib
1f664ef5 712endif
4be1bfd7 713OPTIMIZE = -Od -Zi
b6e5775f 714LINK_DBG = -debug
4be1bfd7
TK
715DEFINES += -D_DEBUG -DDEBUGGING
716EXTRACFLAGS += -MDd
717
b6e5775f 718else
7adf2470 719# Enable Whole Program Optimizations (WPO) and Link Time Code Generation (LTCG).
b6e5775f 720# -O1 yields smaller code, which turns out to be faster than -O2 on x86 and x64
4be1bfd7 721OPTIMIZE = -O1 -Zi -GL
b6e5775f 722# we enable debug symbols in release builds also
7adf2470 723LINK_DBG = -debug -opt:ref,icf -ltcg
b6e5775f
DD
724# you may want to enable this if you want COFF symbols in the executables
725# in addition to the PDB symbols. The default Dr. Watson that ships with
a3815e44 726# Windows can use the former but not latter. The free WinDbg can be
b6e5775f
DD
727# installed to get better stack traces from just the PDB symbols, so we
728# avoid the bloat of COFF symbols by default.
7adf2470 729#LINK_DBG += -debugtype:both
b6e5775f 730LIB_FLAGS = -ltcg
4be1bfd7 731EXTRACFLAGS += -MD
b6e5775f 732endif
b6e5775f
DD
733
734ifeq ($(WIN64),define)
17d44595 735DEFINES += -DWIN64
b6e5775f
DD
736OPTIMIZE += -fp:precise
737endif
738
739# For now, silence warnings from VC++ 8.0 onwards about "unsafe" CRT functions
740# and POSIX CRT function names being deprecated.
741ifeq ($(PREMSVC80),undef)
742DEFINES += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
743endif
744
3aa3d69a 745# Likewise for deprecated Winsock APIs in VC++ 14.0 onwards for now.
1f664ef5 746ifeq ($(CCTYPE),MSVC140)
88b13658 747DEFINES += -D_WINSOCK_DEPRECATED_NO_WARNINGS
88b13658
SH
748else ifeq ($(CCTYPE),MSVC141)
749DEFINES += -D_WINSOCK_DEPRECATED_NO_WARNINGS
2a0cb97d
SH
750else ifeq ($(CCTYPE),MSVC142)
751DEFINES += -D_WINSOCK_DEPRECATED_NO_WARNINGS
1f664ef5
SH
752endif
753
b79cd7df
SH
754# The Windows Server 2003 SP1 SDK compiler only defines _configthreadlocale() if
755# _MT is defined, i.e. when using /MT (the LIBCMT.lib version of the CRT), which
756# the perl build doesn't use. We therefore specify NO_THREAD_SAFE_LOCALE so that
757# perl.h doesn't set USE_THREAD_SAFE_LOCALE, which it otherwise would do since
758# _MSC_VER is 1400 for this compiler (as per MSVC80).
759ifeq ($(CCTYPE),SDK2003SP1)
760DEFINES += -DNO_THREAD_SAFE_LOCALE
761endif
762
b6e5775f
DD
763# In VS 2005 (VC++ 8.0) Microsoft changes time_t from 32-bit to
764# 64-bit, even in 32-bit mode. It also provides the _USE_32BIT_TIME_T
765# preprocessor option to revert back to the old functionality for
766# backward compatibility. We define this symbol here for older 32-bit
767# compilers only (which aren't using it at all) for the sole purpose
768# of getting it into $Config{ccflags}. That way if someone builds
7adf2470 769# Perl itself with e.g. VC7 but later installs an XS module using VC8
b6e5775f
DD
770# the time_t types will still be compatible.
771ifeq ($(WIN64),undef)
b5749b67 772ifeq ($(PREMSVC80),define)
b6e5775f
DD
773BUILDOPT += -D_USE_32BIT_TIME_T
774endif
775endif
776
777LIBBASEFILES = oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
778 comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
779 netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib \
780 odbc32.lib odbccp32.lib comctl32.lib
781
1f664ef5
SH
782ifeq ($(CCTYPE),MSVC140)
783ifeq ($(CFG),DebugFull)
784LIBBASEFILES += msvcrtd.lib vcruntimed.lib
785else
786LIBBASEFILES += msvcrt.lib vcruntime.lib
787endif
88b13658
SH
788else ifeq ($(CCTYPE),MSVC141)
789ifeq ($(CFG),DebugFull)
790LIBBASEFILES += msvcrtd.lib vcruntimed.lib
791else
792LIBBASEFILES += msvcrt.lib vcruntime.lib
793endif
2a0cb97d
SH
794else ifeq ($(CCTYPE),MSVC142)
795ifeq ($(CFG),DebugFull)
796LIBBASEFILES += msvcrtd.lib vcruntimed.lib
797else
798LIBBASEFILES += msvcrt.lib vcruntime.lib
799endif
1f664ef5
SH
800endif
801
b6e5775f
DD
802# Avoid __intel_new_proc_init link error for libircmt.
803# libmmd is /MD equivelent, other variants exist.
804# libmmd is Intel C's math addon funcs to MS CRT, contains long doubles, C99,
805# and optimized C89 funcs
806ifeq ($(__ICC),define)
807LIBBASEFILES += libircmt.lib libmmd.lib
808endif
809
b969270a 810# The Windows Server 2003 SP1 SDK compiler links against MSVCRT.dll, which
b6e5775f
DD
811# doesn't include the buffer overrun verification code used by the /GS switch.
812# Since the code links against libraries that are compiled with /GS, this
813# "security cookie verification" code must be included via bufferoverflow.lib.
b969270a 814ifeq ($(CCTYPE),SDK2003SP1)
b6e5775f
DD
815LIBBASEFILES += bufferoverflowU.lib
816endif
817
818LIBFILES = $(LIBBASEFILES) $(LIBC)
819
b6e5775f
DD
820ifeq ($(__ICC),define)
821EXTRACFLAGS += -Qstd=c99
822endif
823ifeq ($(USE_CPLUSPLUS),define)
824EXTRACFLAGS += $(CXX_FLAG)
825endif
826CFLAGS = $(EXTRACFLAGS) $(INCLUDES) $(DEFINES) $(LOCDEFS) \
827 $(PCHFLAGS) $(OPTIMIZE)
828LINK_FLAGS = -nologo -nodefaultlib $(LINK_DBG) \
829 -libpath:"$(INST_COREDIR)" \
830 -machine:$(PROCESSOR_ARCHITECTURE)
831LIB_FLAGS += -nologo
832OBJOUT_FLAG = -Fo
833EXEOUT_FLAG = -Fe
834LIBOUT_FLAG = /out:
835PDBOUT = -Fd$(*).pdb
836TESTPREPGCC =
837
838endif
839
342634f3 840CFLAGS_O = $(CFLAGS) $(BUILDOPT)
841
e84e5a4c 842RSC_FLAGS =
b6e5775f 843
88b13658 844# VS 2017 (VC++ 14.1) requires at minimum Windows 7 SP1 (with latest Windows Updates)
b6e5775f
DD
845
846# For XP support in >= VS 2013 (VC++ 12.0), subsystem is always in Config.pm
847# LINK_FLAGS else subsystem is only needed for EXE building, not XS DLL building
848# Console vs GUI makes no difference for DLLs, so use default for cleaner
849# building cmd lines
850
851ifeq ($(CCTYPE),MSVC120)
852ifeq ($(WIN64),define)
853LINK_FLAGS += -subsystem:console,"5.02"
854else
855LINK_FLAGS += -subsystem:console,"5.01"
856endif
857
b6e5775f
DD
858else ifeq ($(CCTYPE),MSVC140)
859ifeq ($(WIN64),define)
860LINK_FLAGS += -subsystem:console,"5.02"
861else
862LINK_FLAGS += -subsystem:console,"5.01"
863endif
864
2a0cb97d
SH
865else ifeq ($(CCTYPE),MSVC141)
866ifeq ($(WIN64),define)
867LINK_FLAGS += -subsystem:console,"5.02"
868else
869LINK_FLAGS += -subsystem:console,"5.01"
870endif
871
872else ifeq ($(CCTYPE),MSVC142)
873ifeq ($(WIN64),define)
874LINK_FLAGS += -subsystem:console,"5.02"
875else
876LINK_FLAGS += -subsystem:console,"5.01"
877endif
878
b6e5775f
DD
879else ifneq ($(CCTYPE),GCC)
880PRIV_LINK_FLAGS += -subsystem:console
881endif
882
342634f3 883BLINK_FLAGS = $(PRIV_LINK_FLAGS) $(LINK_FLAGS)
884
885#################### do not edit below this line #######################
886############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
887
bf543eaf
DD
888#prevent -j from reaching EUMM/make_ext.pl/"sub makes", Win32 EUMM not parallel
889#compatible yet
890unexport MAKEFLAGS
891
b6e5775f
DD
892a ?= .lib
893
894.SUFFIXES : .c .i $(o) .dll $(a) .exe .rc .res
895
342634f3 896%$(o): %.c
b6e5775f 897 $(CC) -c -I$(<D) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $(PDBOUT) $<
342634f3 898
899%.i: %.c
900 $(CC) -c -I$(<D) $(CFLAGS_O) -E $< >$@
901
902%.c: %.y
903 $(NOOP)
904
905%.dll: %$(o)
906 $(LINK32) -o $@ $(BLINK_FLAGS) $< $(LIBFILES)
907 $(IMPLIB) --input-def $(*F).def --output-lib $(*F).a $@
908
909%.res: %.rc
b6e5775f 910ifeq ($(CCTYPE),GCC)
342634f3 911 $(RSC) --use-temp-file --include-dir=. --include-dir=.. -O COFF -D INCLUDE_MANIFEST -i $< -o $@
b6e5775f
DD
912else
913 $(RSC) -i.. -DINCLUDE_MANIFEST $<
914endif
342634f3 915
916#
917# various targets
bf543eaf
DD
918
919#do not put $(MINIPERL) as a dep/prereq in a rule, instead put $(HAVEMINIPERL)
920#$(MINIPERL) is not a buildable target, use "gmake mp" if you want to just build
921#miniperl alone
342634f3 922MINIPERL = ..\miniperl.exe
bf543eaf 923HAVEMINIPERL = ..\lib\buildcustomize.pl
342634f3 924MINIDIR = mini
925PERLEXE = ..\perl.exe
926WPERLEXE = ..\wperl.exe
927PERLEXESTATIC = ..\perl-static.exe
928STATICDIR = .\static.tmp
929GLOBEXE = ..\perlglob.exe
bf543eaf 930CONFIGPM = ..\lib\Config.pm
342634f3 931GENUUDMAP = ..\generate_uudmap.exe
932ifeq ($(BUILD_STATIC),define)
933PERLSTATIC = static
934else
935ifeq ($(ALL_STATIC),define)
936PERLSTATIC = static
937else
938PERLSTATIC =
939endif
940endif
941
942# Unicode data files generated by mktables
943UNIDATAFILES = ..\lib\unicore\Decomposition.pl ..\lib\unicore\TestProp.pl \
944 ..\lib\unicore\CombiningClass.pl ..\lib\unicore\Name.pl \
945 ..\lib\unicore\UCD.pl ..\lib\unicore\Name.pm \
048bdb72 946 ..\lib\unicore\mktables.lst
342634f3 947
948# Directories of Unicode data files generated by mktables
949UNIDATADIR1 = ..\lib\unicore\To
950UNIDATADIR2 = ..\lib\unicore\lib
951
952PERLEXE_MANIFEST= .\perlexe.manifest
953PERLEXE_ICO = .\perlexe.ico
954PERLEXE_RES = .\perlexe.res
955PERLDLL_RES =
956
957# Nominate a target which causes extensions to be re-built
958# This used to be $(PERLEXE), but at worst it is the .dll that they depend
959# on and really only the interface - i.e. the .def file used to export symbols
960# from the .dll
bf543eaf 961PERLDEP = $(PERLIMPLIB)
342634f3 962
963
964PL2BAT = bin\pl2bat.pl
965
966UTILS = \
967 ..\utils\h2ph \
968 ..\utils\splain \
969 ..\utils\perlbug \
970 ..\utils\pl2pm \
342634f3 971 ..\utils\h2xs \
972 ..\utils\perldoc \
973 ..\utils\perlivp \
974 ..\utils\libnetcfg \
975 ..\utils\enc2xs \
bf543eaf 976 ..\utils\encguess \
342634f3 977 ..\utils\piconv \
978 ..\utils\corelist \
979 ..\utils\cpan \
980 ..\utils\xsubpp \
981 ..\utils\pod2html \
982 ..\utils\prove \
983 ..\utils\ptar \
984 ..\utils\ptardiff \
985 ..\utils\ptargrep \
986 ..\utils\zipdetails \
987 ..\utils\shasum \
988 ..\utils\instmodsh \
989 ..\utils\json_pp \
990 bin\exetype.pl \
991 bin\runperl.pl \
992 bin\pl2bat.pl \
993 bin\perlglob.pl \
994 bin\search.pl
995
b6e5775f
DD
996ifeq ($(CCTYPE),GCC)
997
342634f3 998CFGSH_TMPL = config.gc
999CFGH_TMPL = config_H.gc
f69f4f3b
S
1000PERLIMPLIB = $(COREDIR)\libperl533$(a)
1001PERLIMPLIBBASE = libperl533$(a)
1002PERLSTATICLIB = ..\libperl533s$(a)
342634f3 1003INT64 = long long
1004
b6e5775f
DD
1005else
1006
1007CFGSH_TMPL = config.vc
1008CFGH_TMPL = config_H.vc
1009INT64 = __int64
1010
1011endif
1012
342634f3 1013# makedef.pl must be updated if this changes, and this should normally
1014# only change when there is an incompatible revision of the public API.
f69f4f3b
S
1015PERLIMPLIB ?= $(COREDIR)\perl533$(a)
1016PERLIMPLIBBASE ?= perl533$(a)
1017PERLEXPLIB ?= $(COREDIR)\perl533.exp
1018PERLSTATICLIB ?= ..\perl533s$(a)
1019PERLDLL = ..\perl533.dll
1020PERLDLLBASE = perl533.dll
342634f3 1021
bf543eaf
DD
1022# don't let "gmake -n all" try to run "miniperl.exe make_ext.pl"
1023PLMAKE = gmake
1024
342634f3 1025XCOPY = xcopy /f /r /i /d /y
1026RCOPY = xcopy /f /r /i /e /d /y
1027NOOP = @rem
1028
bf543eaf
DD
1029#first ones are arrange in compile time order for faster parallel building
1030#see #123867 for details
342634f3 1031MICROCORE_SRC = \
bf543eaf
DD
1032 ..\toke.c \
1033 ..\regcomp.c \
1034 ..\regexec.c \
1035 ..\op.c \
1036 ..\sv.c \
1037 ..\pp.c \
1038 ..\pp_ctl.c \
1039 ..\pp_sys.c \
1040 ..\pp_pack.c \
1041 ..\pp_hot.c \
1042 ..\gv.c \
1043 ..\perl.c \
1044 ..\utf8.c \
1045 ..\dump.c \
1046 ..\hv.c \
342634f3 1047 ..\av.c \
1048 ..\caretx.c \
1049 ..\deb.c \
1050 ..\doio.c \
1051 ..\doop.c \
a55c5245 1052 ..\dquote.c \
342634f3 1053 ..\globals.c \
16d5aac1 1054 ..\mro_core.c \
342634f3 1055 ..\locale.c \
1056 ..\keywords.c \
1057 ..\mathoms.c \
1058 ..\mg.c \
1059 ..\numeric.c \
342634f3 1060 ..\pad.c \
342634f3 1061 ..\perly.c \
342634f3 1062 ..\pp_sort.c \
342634f3 1063 ..\reentr.c \
342634f3 1064 ..\run.c \
1065 ..\scope.c \
342634f3 1066 ..\taint.c \
f832b29a 1067 ..\time64.c \
342634f3 1068 ..\universal.c \
342634f3 1069 ..\util.c
1070
1071EXTRACORE_SRC += perllib.c
1072
1073ifeq ($(PERL_MALLOC),define)
1074EXTRACORE_SRC += ..\malloc.c
1075endif
1076
1077EXTRACORE_SRC += ..\perlio.c
1078
1079WIN32_SRC = \
1080 .\win32.c \
1081 .\win32sck.c \
1082 .\win32thread.c \
1083 .\fcrypt.c
1084
1085# We need this for miniperl build unless we override canned
1086# config.h #define building mini\*
1087#ifeq ($(USE_PERLIO)" == "define"
1088WIN32_SRC += .\win32io.c
1089#endif
1090
1091CORE_NOCFG_H = \
1092 ..\av.h \
1093 ..\cop.h \
1094 ..\cv.h \
1095 ..\dosish.h \
1096 ..\embed.h \
1097 ..\form.h \
1098 ..\gv.h \
1099 ..\handy.h \
1100 ..\hv.h \
1101 ..\hv_func.h \
1102 ..\iperlsys.h \
1103 ..\mg.h \
1104 ..\nostdio.h \
1105 ..\op.h \
1106 ..\opcode.h \
1107 ..\perl.h \
1108 ..\perlapi.h \
1109 ..\perlsdio.h \
1110 ..\perly.h \
1111 ..\pp.h \
1112 ..\proto.h \
1113 ..\regcomp.h \
1114 ..\regexp.h \
1115 ..\scope.h \
1116 ..\sv.h \
1117 ..\thread.h \
1118 ..\unixish.h \
1119 ..\utf8.h \
1120 ..\util.h \
1121 ..\warnings.h \
1122 ..\XSUB.h \
1123 ..\EXTERN.h \
1124 ..\perlvars.h \
1125 ..\intrpvar.h \
1126 .\include\dirent.h \
1127 .\include\netdb.h \
1128 .\include\sys\errno2.h \
1129 .\include\sys\socket.h \
1130 .\win32.h
1131
1132CORE_H = $(CORE_NOCFG_H) .\config.h ..\git_version.h
1133
1134UUDMAP_H = ..\uudmap.h
1135BITCOUNT_H = ..\bitcount.h
1136MG_DATA_H = ..\mg_data.h
1137GENERATED_HEADERS = $(UUDMAP_H) $(BITCOUNT_H) $(MG_DATA_H)
8657e86b
TC
1138
1139HAVE_COREDIR = .coreheaders
342634f3 1140
b6e5775f
DD
1141MICROCORE_OBJ = $(MICROCORE_SRC:.c=$(o))
1142CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:.c=$(o))
1143WIN32_OBJ = $(WIN32_SRC:.c=$(o))
342634f3 1144
1145MINICORE_OBJ = $(subst ..\,mini\,$(MICROCORE_OBJ)) \
1146 $(MINIDIR)\miniperlmain$(o) \
1147 $(MINIDIR)\perlio$(o)
1148MINIWIN32_OBJ = $(subst .\,mini\,$(WIN32_OBJ))
1149MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
1150DLL_OBJ = $(DYNALOADER)
342634f3 1151
1152PERLDLL_OBJ = $(CORE_OBJ)
1153PERLEXE_OBJ = perlmain$(o)
1154PERLEXEST_OBJ = perlmainst$(o)
1155
1156PERLDLL_OBJ += $(WIN32_OBJ) $(DLL_OBJ)
1157
1158ifneq ($(USE_SETARGV),)
1159SETARGV_OBJ = setargv$(o)
1160endif
1161
1162ifeq ($(ALL_STATIC),define)
1163# some exclusions, unfortunately, until fixed:
1164# - MakeMaker isn't capable enough for SDBM_File (small bug)
1165STATIC_EXT = * !SDBM_File
908f2cb5 1166NORMALIZE_STATIC = Normalize_static
342634f3 1167else
1168# specify static extensions here, for example:
1169# (be sure to include Win32CORE to load Win32 on demand)
1170#STATIC_EXT = Win32CORE Cwd Compress/Raw/Zlib
1171STATIC_EXT = Win32CORE
908f2cb5 1172NORMALIZE_DYN = Normalize_dyn
342634f3 1173endif
1174
1175DYNALOADER = ..\DynaLoader$(o)
1176
1177# vars must be separated by "\t+~\t+", since we're using the tempfile
1178# version of config_sh.pl (we were overflowing someone's buffer by
1179# trying to fit them all on the command line)
1180# -- BKS 10-17-1999
1181CFG_VARS = \
1182 "INST_TOP=$(INST_TOP)" \
1183 "INST_VER=$(INST_VER)" \
1184 "INST_ARCH=$(INST_ARCH)" \
1185 "archname=$(ARCHNAME)" \
1186 "cc=$(CC)" \
1187 "ld=$(LINK32)" \
4be1bfd7 1188 "ccflags=$(subst ",\",$(EXTRACFLAGS) $(DEFINES) $(BUILDOPT))" \
bf543eaf 1189 "usecplusplus=$(USE_CPLUSPLUS)" \
342634f3 1190 "cf_email=$(EMAIL)" \
1191 "d_mymalloc=$(PERL_MALLOC)" \
1192 "libs=$(LIBFILES)" \
b6e5775f
DD
1193 "incpath=$(subst ",\",$(CCINCDIR))" \
1194 "libperl=$(subst ",\",$(PERLIMPLIBBASE))" \
1195 "libpth=$(subst ",\",$(CCLIBDIR);$(EXTRALIBDIRS))" \
342634f3 1196 "libc=$(LIBC)" \
bf543eaf 1197 "make=$(PLMAKE)" \
342634f3 1198 "_o=$(o)" \
1199 "obj_ext=$(o)" \
1200 "_a=$(a)" \
1201 "lib_ext=$(a)" \
1202 "static_ext=$(STATIC_EXT)" \
1203 "usethreads=$(USE_ITHREADS)" \
1204 "useithreads=$(USE_ITHREADS)" \
1205 "usemultiplicity=$(USE_MULTI)" \
1206 "useperlio=$(USE_PERLIO)" \
1207 "use64bitint=$(USE_64_BIT_INT)" \
1208 "uselongdouble=$(USE_LONG_DOUBLE)" \
342634f3 1209 "usesitecustomize=$(USE_SITECUST)" \
458ea8f7 1210 "default_inc_excludes_dot=$(DEFAULT_INC_EXCLUDES_DOT)" \
b6e5775f
DD
1211 "LINK_FLAGS=$(subst ",\",$(LINK_FLAGS))"\
1212 "optimize=$(subst ",\",$(OPTIMIZE))" \
342634f3 1213 "ARCHPREFIX=$(ARCHPREFIX)" \
1214 "WIN64=$(WIN64)"
1215
1216#
1217# Top targets
1218#
1219
1220.PHONY: all info
1221
2a0bbd31 1222all : info rebasePE Extensions_nonxs $(PERLSTATIC)
342634f3 1223
1224info :
ca30c090 1225ifeq ($(CCTYPE),GCC)
b2029beb
DD
1226 @echo # CCTYPE=$(CCTYPE)&& \
1227 echo # GCCBIN=$(GCCBIN)&& \
1228 echo # GCCVER=$(GCCVER1).$(GCCVER2).$(GCCVER3)&& \
1229 echo # GCCTARGET=$(GCCTARGET)&& \
1230 echo # GCCCROSS=$(GCCCROSS)&& \
1231 echo # WIN64=$(WIN64)&& \
1232 echo # ARCHITECTURE=$(ARCHITECTURE)&& \
1233 echo # ARCHNAME=$(ARCHNAME)&& \
1234 echo # MAKE=$(PLMAKE)
1235else
1236 @echo # CCTYPE=$(CCTYPE)&& \
1237 echo # WIN64=$(WIN64)&& \
1238 echo # ARCHITECTURE=$(ARCHITECTURE)&& \
1239 echo # ARCHNAME=$(ARCHNAME)&& \
1240 echo # MAKE=$(PLMAKE)
1241endif
ca30c090 1242ifeq ($(CCTYPE),)
342634f3 1243 @echo Unable to detect gcc and/or architecture!
1244 @exit 1
1245endif
1246
1247
342634f3 1248..\regcomp$(o) : ..\regnodes.h ..\regcharclass.h
1249
1250..\regexec$(o) : ..\regnodes.h ..\regcharclass.h
1251
bf543eaf 1252reonly : ..\regnodes.h .\config.h ..\git_version.h $(GLOBEXE) $(HAVEMINIPERL)\
342634f3 1253 $(CONFIGPM) $(UNIDATAFILES) $(PERLEXE) \
1254 Extensions_reonly
1255
1256static: $(PERLEXESTATIC)
1257
1258#----------------------------------------------------------------
1259
bf543eaf 1260$(GLOBEXE) : perlglob.c
b6e5775f 1261ifeq ($(CCTYPE),GCC)
34667d08 1262 $(LINK32) $(EXTRACFLAGS) $(OPTIMIZE) $(BLINK_FLAGS) -mconsole -o $@ perlglob.c $(LIBFILES)
b6e5775f 1263else
34667d08 1264 $(CC) $(EXTRACFLAGS) $(OPTIMIZE) $(PDBOUT) -Fe$@ perlglob.c -link $(BLINK_FLAGS) \
8e925de9 1265 setargv$(o) $(LIBFILES) && $(EMBED_EXE_MANI)
b6e5775f 1266endif
bf543eaf
DD
1267
1268..\git_version.h : $(HAVEMINIPERL) ..\make_patchnum.pl
1269 $(MINIPERL) -I..\lib ..\make_patchnum.pl
1270
1271# make sure that we recompile perl.c if the git version changes
1272..\perl$(o) : ..\git_version.h
1273
1274..\config.sh : $(CFGSH_TMPL) config_sh.PL FindExt.pm $(HAVEMINIPERL)
1275 $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) $(CFGSH_TMPL) > ..\config.sh
1276
1277# This target is for when changes to the main config.sh happen.
1278# Edit config.gc, then make perl using GCC in a minimal configuration (i.e.
1279# with MULTI, ITHREADS, IMP_SYS, LARGE_FILES and PERLIO off), then make
1280# this target to regenerate config_H.gc.
1281regen_config_h:
1282 $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) $(CFGSH_TMPL) > ..\config.sh
1283 $(MINIPERL) -I..\lib ..\configpm --chdir=..
1284 -del /f $(CFGH_TMPL)
1285 -$(MINIPERL) -I..\lib config_h.PL "ARCHPREFIX=$(ARCHPREFIX)"
1286 rename config.h $(CFGH_TMPL)
1287
1288$(CONFIGPM): ..\config.sh config_h.PL
1289 $(MINIPERL) -I..\lib ..\configpm --chdir=..
1290 -$(MINIPERL) -I..\lib config_h.PL "ARCHPREFIX=$(ARCHPREFIX)"
1291
1292.\config.h : $(CONFIGPM)
1293
1294# See the comment in Makefile.SH explaining this seemingly cranky ordering
1295..\lib\buildcustomize.pl : $(MINI_OBJ) ..\write_buildcustomize.pl
b6e5775f 1296ifeq ($(CCTYPE),GCC)
bf543eaf 1297 $(LINK32) -mconsole -o $(MINIPERL) $(BLINK_FLAGS) $(MINI_OBJ) $(LIBFILES)
b6e5775f
DD
1298else
1299 $(LINK32) -out:$(MINIPERL) $(BLINK_FLAGS) \
1300 $(DELAYLOAD) $(MINIDELAYLOAD) $(LIBFILES) $(MINI_OBJ)
1301 $(subst $@,$(MINIPERL),$(EMBED_EXE_MANI))
1302
1303endif
bf543eaf 1304 $(MINIPERL) -I..\lib -f ..\write_buildcustomize.pl ..
342634f3 1305
bf543eaf
DD
1306#convinence target, get a working miniperl
1307mp : $(CONFIGPM)
342634f3 1308
bf543eaf
DD
1309$(MINIDIR)\.exists : $(CFGH_TMPL)
1310 if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
342634f3 1311#
1312# Copy the template config.h and set configurables at the end of it
1313# as per the options chosen and compiler used.
1314# Note: This config.h is only used to build miniperl.exe anyway, but
1315# it's as well to have its options correct to be sure that it builds
1316# and so that it's "-V" options are correct for use by makedef.pl. The
1317# real config.h used to build perl.exe is generated from the top-level
1318# config_h.SH by config_h.PL (run by miniperl.exe).
1319#
bf543eaf
DD
1320# MINIDIR generates config.h so miniperl.exe is not rebuilt when the 2nd
1321# config.h is generated in CONFIGPM target, see also the comments for $(MINI_OBJ).
342634f3 1322 copy $(CFGH_TMPL) config.h
6f960640
DD
1323 @(echo.&& \
1324 echo #ifndef _config_h_footer_&& \
1325 echo #define _config_h_footer_&& \
6f960640
DD
1326 echo #undef PTRSIZE&& \
1327 echo #undef SSize_t&& \
1328 echo #undef HAS_ATOLL&& \
1329 echo #undef HAS_STRTOLL&& \
1330 echo #undef HAS_STRTOULL&& \
1331 echo #undef Size_t_size&& \
1332 echo #undef IVTYPE&& \
1333 echo #undef UVTYPE&& \
1334 echo #undef IVSIZE&& \
1335 echo #undef UVSIZE&& \
1336 echo #undef NV_PRESERVES_UV&& \
1337 echo #undef NV_PRESERVES_UV_BITS&& \
1338 echo #undef IVdf&& \
1339 echo #undef UVuf&& \
1340 echo #undef UVof&& \
1341 echo #undef UVxf&& \
1342 echo #undef UVXf&& \
1343 echo #undef USE_64_BIT_INT&& \
1344 echo #undef Gconvert&& \
1345 echo #undef HAS_FREXPL&& \
1346 echo #undef HAS_ISNANL&& \
1347 echo #undef HAS_MODFL&& \
1348 echo #undef HAS_MODFL_PROTO&& \
1349 echo #undef HAS_SQRTL&& \
1350 echo #undef HAS_STRTOLD&& \
1351 echo #undef PERL_PRIfldbl&& \
1352 echo #undef PERL_PRIgldbl&& \
1353 echo #undef PERL_PRIeldbl&& \
1354 echo #undef PERL_SCNfldbl&& \
1355 echo #undef NVTYPE&& \
1356 echo #undef NVSIZE&& \
1357 echo #undef LONG_DOUBLESIZE&& \
1358 echo #undef NV_OVERFLOWS_INTEGERS_AT&& \
1359 echo #undef NVef&& \
1360 echo #undef NVff&& \
1361 echo #undef NVgf&& \
f9e90a19
SH
1362 echo #undef USE_LONG_DOUBLE&& \
1363 echo #undef USE_CPLUSPLUS)>> config.h
1f664ef5
SH
1364ifeq ($(CCTYPE),MSVC140)
1365 @(echo #undef FILE_ptr&& \
1366 echo #undef FILE_cnt&& \
1367 echo #undef FILE_base&& \
1368 echo #undef FILE_bufsiz&& \
88b13658
SH
1369 echo #define FILE_ptr^(fp^) PERLIO_FILE_ptr^(fp^)&& \
1370 echo #define FILE_cnt^(fp^) PERLIO_FILE_cnt^(fp^)&& \
1371 echo #define FILE_base^(fp^) PERLIO_FILE_base^(fp^)&& \
1372 echo #define FILE_bufsiz^(fp^) ^(PERLIO_FILE_cnt^(fp^) + PERLIO_FILE_ptr^(fp^) - PERLIO_FILE_base^(fp^)^)&& \
1f664ef5 1373 echo #define I_STDBOOL)>> config.h
88b13658
SH
1374else ifeq ($(CCTYPE),MSVC141)
1375 @(echo #undef FILE_ptr&& \
2a0cb97d
SH
1376 echo #undef FILE_cnt&& \
1377 echo #undef FILE_base&& \
1378 echo #undef FILE_bufsiz&& \
1379 echo #define FILE_ptr^(fp^) PERLIO_FILE_ptr^(fp^)&& \
1380 echo #define FILE_cnt^(fp^) PERLIO_FILE_cnt^(fp^)&& \
1381 echo #define FILE_base^(fp^) PERLIO_FILE_base^(fp^)&& \
1382 echo #define FILE_bufsiz^(fp^) ^(PERLIO_FILE_cnt^(fp^) + PERLIO_FILE_ptr^(fp^) - PERLIO_FILE_base^(fp^)^)&& \
1383 echo #define I_STDBOOL)>> config.h
1384else ifeq ($(CCTYPE),MSVC142)
1385 @(echo #undef FILE_ptr&& \
88b13658
SH
1386 echo #undef FILE_cnt&& \
1387 echo #undef FILE_base&& \
1388 echo #undef FILE_bufsiz&& \
1389 echo #define FILE_ptr^(fp^) PERLIO_FILE_ptr^(fp^)&& \
1390 echo #define FILE_cnt^(fp^) PERLIO_FILE_cnt^(fp^)&& \
1391 echo #define FILE_base^(fp^) PERLIO_FILE_base^(fp^)&& \
1392 echo #define FILE_bufsiz^(fp^) ^(PERLIO_FILE_cnt^(fp^) + PERLIO_FILE_ptr^(fp^) - PERLIO_FILE_base^(fp^)^)&& \
1f664ef5
SH
1393 echo #define I_STDBOOL)>> config.h
1394endif
342634f3 1395ifeq ($(WIN64),define)
a385474c
DD
1396ifeq ($(CCTYPE),GCC)
1397 @(echo #define LONG_DOUBLESIZE ^16)>> config.h
1398else
1399 @(echo #define LONG_DOUBLESIZE ^8)>> config.h
1400endif
6f960640
DD
1401 @(echo #define PTRSIZE ^8&& \
1402 echo #define SSize_t $(INT64)&& \
1403 echo #define HAS_ATOLL&& \
1404 echo #define HAS_STRTOLL&& \
1405 echo #define HAS_STRTOULL&& \
1406 echo #define Size_t_size ^8)>> config.h
342634f3 1407else
a385474c
DD
1408ifeq ($(CCTYPE),GCC)
1409 @(echo #define LONG_DOUBLESIZE ^12)>> config.h
1410else
1411 @(echo #define LONG_DOUBLESIZE ^8)>> config.h
1412endif
6f960640
DD
1413 @(echo #define PTRSIZE ^4&& \
1414 echo #define SSize_t int&& \
1415 echo #undef HAS_ATOLL&& \
1416 echo #undef HAS_STRTOLL&& \
1417 echo #undef HAS_STRTOULL&& \
1418 echo #define Size_t_size ^4)>> config.h
342634f3 1419endif
1420ifeq ($(USE_64_BIT_INT),define)
6f960640
DD
1421 @(echo #define IVTYPE $(INT64)&& \
1422 echo #define UVTYPE unsigned $(INT64)&& \
1423 echo #define IVSIZE ^8&& \
1424 echo #define UVSIZE ^8)>> config.h
342634f3 1425ifeq ($(USE_LONG_DOUBLE),define)
6f960640
DD
1426 @(echo #define NV_PRESERVES_UV&& \
1427 echo #define NV_PRESERVES_UV_BITS 64)>> config.h
342634f3 1428else
6f960640
DD
1429 @(echo #undef NV_PRESERVES_UV&& \
1430 echo #define NV_PRESERVES_UV_BITS 53)>> config.h
1431endif
1432 @(echo #define IVdf "I64d"&& \
1433 echo #define UVuf "I64u"&& \
1434 echo #define UVof "I64o"&& \
1435 echo #define UVxf "I64x"&& \
1436 echo #define UVXf "I64X"&& \
1437 echo #define USE_64_BIT_INT)>> config.h
342634f3 1438else
6f960640
DD
1439 @(echo #define IVTYPE long&& \
1440 echo #define UVTYPE unsigned long&& \
1441 echo #define IVSIZE ^4&& \
1442 echo #define UVSIZE ^4&& \
1443 echo #define NV_PRESERVES_UV&& \
1444 echo #define NV_PRESERVES_UV_BITS 32&& \
1445 echo #define IVdf "ld"&& \
1446 echo #define UVuf "lu"&& \
1447 echo #define UVof "lo"&& \
1448 echo #define UVxf "lx"&& \
1449 echo #define UVXf "lX"&& \
1450 echo #undef USE_64_BIT_INT)>> config.h
342634f3 1451endif
1452ifeq ($(USE_LONG_DOUBLE),define)
6f960640
DD
1453 @(echo #define Gconvert^(x,n,t,b^) sprintf^(^(b^),"%%.*""Lg",^(n^),^(x^)^)&& \
1454 echo #define HAS_FREXPL&& \
1455 echo #define HAS_ISNANL&& \
1456 echo #define HAS_MODFL&& \
1457 echo #define HAS_MODFL_PROTO&& \
1458 echo #define HAS_SQRTL&& \
1459 echo #define HAS_STRTOLD&& \
1460 echo #define PERL_PRIfldbl "Lf"&& \
1461 echo #define PERL_PRIgldbl "Lg"&& \
1462 echo #define PERL_PRIeldbl "Le"&& \
1463 echo #define PERL_SCNfldbl "Lf"&& \
a385474c
DD
1464 echo #define NVTYPE long double&& \
1465 echo #define NVSIZE LONG_DOUBLESIZE&& \
1466 echo #define NV_OVERFLOWS_INTEGERS_AT 256.0*256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0*2.0*2.0*2.0&& \
6f960640
DD
1467 echo #define NVef "Le"&& \
1468 echo #define NVff "Lf"&& \
1469 echo #define NVgf "Lg"&& \
1470 echo #define USE_LONG_DOUBLE)>> config.h
342634f3 1471else
6f960640
DD
1472 @(echo #define Gconvert^(x,n,t,b^) sprintf^(^(b^),"%%.*g",^(n^),^(x^)^)&& \
1473 echo #undef HAS_FREXPL&& \
1474 echo #undef HAS_ISNANL&& \
1475 echo #undef HAS_MODFL&& \
1476 echo #undef HAS_MODFL_PROTO&& \
1477 echo #undef HAS_SQRTL&& \
1478 echo #undef HAS_STRTOLD&& \
1479 echo #undef PERL_PRIfldbl&& \
1480 echo #undef PERL_PRIgldbl&& \
1481 echo #undef PERL_PRIeldbl&& \
1482 echo #undef PERL_SCNfldbl&& \
1483 echo #define NVTYPE double&& \
1484 echo #define NVSIZE ^8&& \
6f960640
DD
1485 echo #define NV_OVERFLOWS_INTEGERS_AT 256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0&& \
1486 echo #define NVef "e"&& \
1487 echo #define NVff "f"&& \
1488 echo #define NVgf "g"&& \
1489 echo #undef USE_LONG_DOUBLE)>> config.h
1490endif
1491ifeq ($(USE_CPLUSPLUS),define)
1492 @(echo #define USE_CPLUSPLUS&& \
1493 echo #endif)>> config.h
1494else
1495 @(echo #undef USE_CPLUSPLUS&& \
1496 echo #endif)>> config.h
1497endif
bf543eaf 1498#separate line since this is sentinal that this target is done
19d5c34a 1499 @rem. > $(MINIDIR)\.exists
342634f3 1500
1501$(MINICORE_OBJ) : $(CORE_NOCFG_H)
bf543eaf 1502 $(CC) -c $(CFLAGS) $(MINIBUILDOPT) -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL $(OBJOUT_FLAG)$@ $(PDBOUT) ..\$(*F).c
342634f3 1503
1504$(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
bf543eaf 1505 $(CC) -c $(CFLAGS) $(MINIBUILDOPT) -DPERL_IS_MINIPERL $(OBJOUT_FLAG)$@ $(PDBOUT) $(*F).c
342634f3 1506
1507# -DPERL_IMPLICIT_SYS needs C++ for perllib.c
a3815e44 1508# rules wrapped in .IFs break Win9X build (we end up with unbalanced []s
bf543eaf 1509# unless the .IF is true), so instead we use a .ELSE with the default.
342634f3 1510# This is the only file that depends on perlhost.h, vmem.h, and vdir.h
1511
bf543eaf 1512perllib$(o) : perllib.c perllibst.h .\perlhost.h .\vdir.h .\vmem.h
342634f3 1513ifeq ($(USE_IMP_SYS),define)
bf543eaf 1514 $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ $(PDBOUT) perllib.c
342634f3 1515else
bf543eaf 1516 $(CC) -c -I. $(CFLAGS_O) $(OBJOUT_FLAG)$@ $(PDBOUT) perllib.c
342634f3 1517endif
1518
1519# 1. we don't want to rebuild miniperl.exe when config.h changes
1520# 2. we don't want to rebuild miniperl.exe with non-default config.h
1521# 3. we can't have miniperl.exe depend on git_version.h, as miniperl creates it
bf543eaf 1522$(MINI_OBJ) : $(MINIDIR)\.exists $(CORE_NOCFG_H)
342634f3 1523
1524$(WIN32_OBJ) : $(CORE_H)
1525
1526$(CORE_OBJ) : $(CORE_H)
1527
1528$(DLL_OBJ) : $(CORE_H)
1529
bf543eaf
DD
1530
1531perllibst.h : $(HAVEMINIPERL) $(CONFIGPM) create_perllibst_h.pl
342634f3 1532 $(MINIPERL) -I..\lib create_perllibst_h.pl
bf543eaf
DD
1533
1534perldll.def : $(HAVEMINIPERL) $(CONFIGPM) ..\embed.fnc ..\makedef.pl
342634f3 1535 $(MINIPERL) -I..\lib -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) \
b6e5775f 1536 $(BUILDOPT) CCTYPE=$(CCTYPE) TARG_DIR=..\ > perldll.def
342634f3 1537
bf543eaf
DD
1538$(PERLEXPLIB) : $(PERLIMPLIB)
1539
1540$(PERLIMPLIB) : perldll.def
b6e5775f 1541ifeq ($(CCTYPE),GCC)
1b30b4a8 1542 $(IMPLIB) -k -d perldll.def -D $(PERLDLLBASE) -l $(PERLIMPLIB) -e $(PERLEXPLIB)
b6e5775f
DD
1543else
1544 lib -def:perldll.def -machine:$(ARCHITECTURE) /OUT:$(PERLIMPLIB)
1545endif
bf543eaf
DD
1546
1547$(PERLDLL): $(PERLEXPLIB) $(PERLDLL_OBJ) $(PERLDLL_RES) Extensions_static
b6e5775f 1548ifeq ($(CCTYPE),GCC)
342634f3 1549 $(LINK32) -mdll -o $@ $(BLINK_FLAGS) \
bf543eaf 1550 $(PERLDLL_OBJ) $(shell type Extensions_static) $(LIBFILES) $(PERLEXPLIB)
b6e5775f
DD
1551else
1552 $(LINK32) -dll -out:$@ $(BLINK_FLAGS) \
1553 @Extensions_static \
fb953ad4 1554 $(DELAYLOAD) $(LIBFILES) \
b6e5775f
DD
1555 $(PERLDLL_RES) $(PERLDLL_OBJ) $(PERLEXPLIB)
1556 $(EMBED_DLL_MANI)
1557endif
342634f3 1558
1559$(PERLSTATICLIB): $(PERLDLL_OBJ) Extensions_static
b6e5775f 1560ifeq ($(CCTYPE),GCC)
342634f3 1561 $(LIB32) $(LIB_FLAGS) $@ $(PERLDLL_OBJ)
1562 if exist $(STATICDIR) rmdir /s /q $(STATICDIR)
1563 for %%i in ($(shell type Extensions_static)) do \
1564 @mkdir $(STATICDIR) && cd $(STATICDIR) && \
1565 $(ARCHPREFIX)ar x ..\%%i && \
1566 $(ARCHPREFIX)ar q ..\$@ *$(o) && \
1567 cd .. && rmdir /s /q $(STATICDIR)
b6e5775f
DD
1568else
1569 $(LIB32) $(LIB_FLAGS) -out:$@ @Extensions_static \
1570 $(PERLDLL_OBJ)
1571endif
342634f3 1572 $(XCOPY) $(PERLSTATICLIB) $(COREDIR)
1573
1574$(PERLEXE_RES): perlexe.rc $(PERLEXE_MANIFEST) $(PERLEXE_ICO)
1575
1576$(MINIDIR)\globals$(o) : $(GENERATED_HEADERS)
1577
1578$(UUDMAP_H) $(MG_DATA_H) : $(BITCOUNT_H)
1579
1580$(BITCOUNT_H) : $(GENUUDMAP)
1581 $(GENUUDMAP) $(GENERATED_HEADERS)
1582
bf543eaf 1583$(GENUUDMAP) : ..\mg_raw.h
b6e5775f 1584ifeq ($(CCTYPE),GCC)
bf543eaf
DD
1585 $(LINK32) $(CFLAGS_O) -o..\generate_uudmap.exe ..\generate_uudmap.c \
1586 $(BLINK_FLAGS) $(LIBFILES)
b6e5775f 1587else
8e925de9 1588 $(CC) $(CFLAGS_O) $(PDBOUT) -Fe..\generate_uudmap.exe ..\generate_uudmap.c -link $(LIBFILES) $(BLINK_FLAGS)
b6e5775f
DD
1589 $(EMBED_EXE_MANI)
1590endif
342634f3 1591
8657e86b
TC
1592.PHONY: MakePPPort
1593
1594MakePPPort : $(HAVEMINIPERL) $(CONFIGPM)
1595 $(MINIPERL) -I..\lib ..\mkppport
1596
1597# also known as $(HAVE_COREDIR)
1598.coreheaders : $(CORE_H)
bf543eaf
DD
1599 $(XCOPY) *.h $(COREDIR)\\*.*
1600 $(RCOPY) include $(COREDIR)\\*.*
1601 $(XCOPY) ..\\*.h $(COREDIR)\\*.*
1602 rem. > $@
342634f3 1603
bf543eaf
DD
1604perlmain$(o) : runperl.c $(CONFIGPM)
1605 $(CC) $(subst -DPERLDLL,-UPERLDLL,$(CFLAGS_O)) $(OBJOUT_FLAG)$@ $(PDBOUT) -c runperl.c
342634f3 1606
bf543eaf
DD
1607perlmainst$(o) : runperl.c $(CONFIGPM)
1608 $(CC) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $(PDBOUT) -c runperl.c
342634f3 1609
bf543eaf 1610$(PERLEXE): $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES) $(PERLIMPLIB)
b6e5775f 1611ifeq ($(CCTYPE),GCC)
342634f3 1612 $(LINK32) -mconsole -o $@ $(BLINK_FLAGS) \
1613 $(PERLEXE_OBJ) $(PERLEXE_RES) $(PERLIMPLIB) $(LIBFILES)
b6e5775f
DD
1614else
1615 $(LINK32) -out:$@ $(BLINK_FLAGS) \
1616 $(PERLEXE_OBJ) $(PERLEXE_RES) $(PERLIMPLIB) $(LIBFILES) $(SETARGV_OBJ)
e84e5a4c 1617 $(APPEND_EXE_MANI)
b6e5775f 1618endif
342634f3 1619 copy $(PERLEXE) $(WPERLEXE)
1620 $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS
1621
1622$(PERLEXESTATIC): $(PERLSTATICLIB) $(CONFIGPM) $(PERLEXEST_OBJ) $(PERLEXE_RES)
b6e5775f 1623ifeq ($(CCTYPE),GCC)
342634f3 1624 $(LINK32) -mconsole -o $@ $(BLINK_FLAGS) \
1625 $(PERLEXEST_OBJ) $(PERLEXE_RES) $(PERLSTATICLIB) $(LIBFILES)
b6e5775f
DD
1626else
1627 $(LINK32) -out:$@ $(BLINK_FLAGS) \
1628 $(PERLEXEST_OBJ) $(PERLEXE_RES) $(PERLSTATICLIB) $(LIBFILES) $(SETARGV_OBJ)
e84e5a4c 1629 $(APPEND_EXE_MANI)
b6e5775f 1630endif
342634f3 1631
342634f3 1632#-------------------------------------------------------------------------------
1633# There's no direct way to mark a dependency on
1634# DynaLoader.pm, so this will have to do
342634f3 1635
bf543eaf 1636#most of deps of this target are in DYNALOADER and therefore omitted here
908f2cb5 1637Extensions : $(PERLDEP) $(DYNALOADER) Extension_lib $(GLOBEXE) MakePPPort
bf543eaf
DD
1638 $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic !Unicode/Normalize
1639
908f2cb5
DD
1640Normalize_static : $(CONFIGPM) $(GLOBEXE) $(HAVE_COREDIR) $(UNIDATAFILES)
1641 $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static +Unicode/Normalize
1642
1643Normalize_dyn : $(PERLDEP) $(DYNALOADER) $(GLOBEXE) $(UNIDATAFILES)
bf543eaf
DD
1644 $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +Unicode/Normalize
1645
1646Extensions_reonly : $(PERLDEP) $(DYNALOADER)
1647 $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +re
342634f3 1648
908f2cb5
DD
1649Exts_static_general : ..\make_ext.pl $(CONFIGPM) Extension_lib $(GLOBEXE) $(HAVE_COREDIR) MakePPPort
1650 $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static !Unicode/Normalize
1651
1652Extensions_static : list_static_libs.pl Exts_static_general $(NORMALIZE_STATIC)
342634f3 1653 $(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static
1654
bf543eaf
DD
1655Extensions_nonxs : ..\make_ext.pl ..\pod\perlfunc.pod $(CONFIGPM) $(GLOBEXE)
1656 $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --nonxs !libs
342634f3 1657
908f2cb5
DD
1658Extension_lib : ..\make_ext.pl $(CONFIGPM)
1659 $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) lib
1660
bf543eaf
DD
1661#lib must be built, it can't be buildcustomize.pl-ed, and is required for XS building
1662$(DYNALOADER) : ..\make_ext.pl $(CONFIGPM) $(HAVE_COREDIR)
908f2cb5 1663 $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(EXTDIR) --dir=$(DISTDIR) --dynaloader
342634f3 1664
1665Extensions_clean :
bf543eaf 1666 -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=clean
342634f3 1667
1668Extensions_realclean :
bf543eaf
DD
1669 -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=realclean
1670
1671# all PE files need to be built by the time this target runs, PP files can still
1672# be running in parallel like UNIDATAFILES, this target a placeholder for the
1673# future
cd17fa28 1674ifeq ($(PERLSTATIC),static)
908f2cb5 1675rebasePE : Extensions $(PERLDLL) $(PERLEXE) $(PERLEXESTATIC)
bf543eaf 1676else
908f2cb5 1677rebasePE : Extensions $(PERLDLL) $(NORMALIZE_DYN) $(PERLEXE)
bf543eaf
DD
1678endif
1679 $(NOOP)
342634f3 1680
1681#-------------------------------------------------------------------------------
1682
bf543eaf 1683doc: $(PERLEXE) $(PERLDLL) ..\pod\perltoc.pod
342634f3 1684 $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=$(HTMLDIR) \
1685 --podpath=pod:lib:utils --htmlroot="file://$(subst :,|,$(INST_HTML))"\
1686 --recurse
1687
1688..\utils\Makefile: $(CONFIGPM) ..\utils\Makefile.PL
1689 $(MINIPERL) -I..\lib ..\utils\Makefile.PL ..
1690
1691# Note that this next section is parsed (and regenerated) by pod/buildtoc
1692# so please check that script before making structural changes here
bf543eaf
DD
1693utils: $(HAVEMINIPERL) ..\utils\Makefile
1694 cd ..\utils && $(PLMAKE) PERL=$(MINIPERL)
342634f3 1695 copy ..\README.aix ..\pod\perlaix.pod
1696 copy ..\README.amiga ..\pod\perlamiga.pod
1697 copy ..\README.android ..\pod\perlandroid.pod
1698 copy ..\README.bs2000 ..\pod\perlbs2000.pod
342634f3 1699 copy ..\README.cn ..\pod\perlcn.pod
1700 copy ..\README.cygwin ..\pod\perlcygwin.pod
1701 copy ..\README.dos ..\pod\perldos.pod
1702 copy ..\README.freebsd ..\pod\perlfreebsd.pod
1703 copy ..\README.haiku ..\pod\perlhaiku.pod
1704 copy ..\README.hpux ..\pod\perlhpux.pod
1705 copy ..\README.hurd ..\pod\perlhurd.pod
1706 copy ..\README.irix ..\pod\perlirix.pod
1707 copy ..\README.jp ..\pod\perljp.pod
1708 copy ..\README.ko ..\pod\perlko.pod
1709 copy ..\README.linux ..\pod\perllinux.pod
1710 copy ..\README.macos ..\pod\perlmacos.pod
1711 copy ..\README.macosx ..\pod\perlmacosx.pod
1712 copy ..\README.netware ..\pod\perlnetware.pod
1713 copy ..\README.openbsd ..\pod\perlopenbsd.pod
1714 copy ..\README.os2 ..\pod\perlos2.pod
1715 copy ..\README.os390 ..\pod\perlos390.pod
1716 copy ..\README.os400 ..\pod\perlos400.pod
1717 copy ..\README.plan9 ..\pod\perlplan9.pod
1718 copy ..\README.qnx ..\pod\perlqnx.pod
1719 copy ..\README.riscos ..\pod\perlriscos.pod
1720 copy ..\README.solaris ..\pod\perlsolaris.pod
342634f3 1721 copy ..\README.synology ..\pod\perlsynology.pod
1722 copy ..\README.tru64 ..\pod\perltru64.pod
1723 copy ..\README.tw ..\pod\perltw.pod
1724 copy ..\README.vos ..\pod\perlvos.pod
1725 copy ..\README.win32 ..\pod\perlwin32.pod
d228bb8b 1726 copy ..\pod\perldelta.pod ..\pod\perl5335delta.pod
bf543eaf 1727 $(MINIPERL) -I..\lib $(PL2BAT) $(UTILS)
342634f3 1728 $(MINIPERL) -I..\lib ..\autodoc.pl ..
1729 $(MINIPERL) -I..\lib ..\pod\perlmodlib.PL -q ..
1730
908f2cb5 1731..\pod\perltoc.pod: $(PERLEXE) $(PERLDLL) Extensions Extensions_nonxs $(NORMALIZE_DYN) utils
342634f3 1732 $(PERLEXE) -f ..\pod\buildtoc -q
1733
1734# Note that the pod cleanup in this next section is parsed (and regenerated
1735# by pod/buildtoc so please check that script before making changes here
1736
1737distclean: realclean
1738 -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \
1739 $(PERLIMPLIB) ..\miniperl$(a) $(PERLEXESTATIC) $(PERLSTATICLIB)
1740 -del /f $(LIBDIR)\Encode.pm $(LIBDIR)\encoding.pm $(LIBDIR)\Errno.pm
1741 -del /f $(LIBDIR)\Config.pod $(LIBDIR)\POSIX.pod $(LIBDIR)\threads.pm
1742 -del /f $(LIBDIR)\.exists $(LIBDIR)\attributes.pm $(LIBDIR)\DynaLoader.pm
1743 -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
1744 -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm
1745 -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
1746 -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
1747 -del /f $(LIBDIR)\File\Glob.pm
342634f3 1748 -del /f $(LIBDIR)\Sys\Hostname.pm
1749 -del /f $(LIBDIR)\Time\HiRes.pm
1750 -del /f $(LIBDIR)\Unicode\Normalize.pm
1751 -del /f $(LIBDIR)\Math\BigInt\FastCalc.pm
908f2cb5 1752 -del /f $(LIBDIR)\Storable.pm $(LIBDIR)\Storable\Limit.pm
342634f3 1753 -del /f $(LIBDIR)\Win32.pm
1754 -del /f $(LIBDIR)\Win32CORE.pm
1755 -del /f $(LIBDIR)\Win32API\File.pm
1756 -del /f $(LIBDIR)\Win32API\File\cFile.pc
1757 -del /f $(LIBDIR)\buildcustomize.pl
1758 -del /f $(DISTDIR)\XSLoader\XSLoader.pm
1759 -del /f *.def *.map
908f2cb5 1760 -if exist $(LIBDIR)\Amiga rmdir /s /q $(LIBDIR)\Amiga
342634f3 1761 -if exist $(LIBDIR)\App rmdir /s /q $(LIBDIR)\App
1762 -if exist $(LIBDIR)\Archive rmdir /s /q $(LIBDIR)\Archive
1763 -if exist $(LIBDIR)\Attribute rmdir /s /q $(LIBDIR)\Attribute
1764 -if exist $(LIBDIR)\autodie rmdir /s /q $(LIBDIR)\autodie
1765 -if exist $(LIBDIR)\Carp rmdir /s /q $(LIBDIR)\Carp
1766 -if exist $(LIBDIR)\Compress rmdir /s /q $(LIBDIR)\Compress
1767 -if exist $(LIBDIR)\Config\Perl rmdir /s /q $(LIBDIR)\Config\Perl
1768 -if exist $(LIBDIR)\CPAN rmdir /s /q $(LIBDIR)\CPAN
1769 -if exist $(LIBDIR)\Data rmdir /s /q $(LIBDIR)\Data
1770 -if exist $(LIBDIR)\Devel rmdir /s /q $(LIBDIR)\Devel
1771 -if exist $(LIBDIR)\Digest rmdir /s /q $(LIBDIR)\Digest
1772 -if exist $(LIBDIR)\Encode rmdir /s /q $(LIBDIR)\Encode
1773 -if exist $(LIBDIR)\encoding rmdir /s /q $(LIBDIR)\encoding
1774 -if exist $(LIBDIR)\Exporter rmdir /s /q $(LIBDIR)\Exporter
1775 -if exist $(LIBDIR)\ExtUtils\CBuilder rmdir /s /q $(LIBDIR)\ExtUtils\CBuilder
1776 -if exist $(LIBDIR)\ExtUtils\Command rmdir /s /q $(LIBDIR)\ExtUtils\Command
1777 -if exist $(LIBDIR)\ExtUtils\Constant rmdir /s /q $(LIBDIR)\ExtUtils\Constant
1778 -if exist $(LIBDIR)\ExtUtils\Liblist rmdir /s /q $(LIBDIR)\ExtUtils\Liblist
1779 -if exist $(LIBDIR)\ExtUtils\MakeMaker rmdir /s /q $(LIBDIR)\ExtUtils\MakeMaker
1780 -if exist $(LIBDIR)\ExtUtils\ParseXS rmdir /s /q $(LIBDIR)\ExtUtils\ParseXS
1781 -if exist $(LIBDIR)\ExtUtils\Typemaps rmdir /s /q $(LIBDIR)\ExtUtils\Typemaps
1782 -if exist $(LIBDIR)\File\Spec rmdir /s /q $(LIBDIR)\File\Spec
1783 -if exist $(LIBDIR)\Filter rmdir /s /q $(LIBDIR)\Filter
1784 -if exist $(LIBDIR)\Hash rmdir /s /q $(LIBDIR)\Hash
1785 -if exist $(LIBDIR)\HTTP rmdir /s /q $(LIBDIR)\HTTP
1786 -if exist $(LIBDIR)\I18N rmdir /s /q $(LIBDIR)\I18N
df61f5a9 1787 -if exist $(LIBDIR)\inc rmdir /s /q $(LIBDIR)\inc
342634f3 1788 -if exist $(LIBDIR)\IO rmdir /s /q $(LIBDIR)\IO
1789 -if exist $(LIBDIR)\IPC rmdir /s /q $(LIBDIR)\IPC
1790 -if exist $(LIBDIR)\JSON rmdir /s /q $(LIBDIR)\JSON
1791 -if exist $(LIBDIR)\List rmdir /s /q $(LIBDIR)\List
1792 -if exist $(LIBDIR)\Locale rmdir /s /q $(LIBDIR)\Locale
1793 -if exist $(LIBDIR)\Math rmdir /s /q $(LIBDIR)\Math
1794 -if exist $(LIBDIR)\Memoize rmdir /s /q $(LIBDIR)\Memoize
1795 -if exist $(LIBDIR)\MIME rmdir /s /q $(LIBDIR)\MIME
1796 -if exist $(LIBDIR)\Module rmdir /s /q $(LIBDIR)\Module
1797 -if exist $(LIBDIR)\Net\FTP rmdir /s /q $(LIBDIR)\Net\FTP
1798 -if exist $(LIBDIR)\Params rmdir /s /q $(LIBDIR)\Params
1799 -if exist $(LIBDIR)\Parse rmdir /s /q $(LIBDIR)\Parse
1800 -if exist $(LIBDIR)\Perl rmdir /s /q $(LIBDIR)\Perl
1801 -if exist $(LIBDIR)\PerlIO rmdir /s /q $(LIBDIR)\PerlIO
1802 -if exist $(LIBDIR)\Pod\Perldoc rmdir /s /q $(LIBDIR)\Pod\Perldoc
1803 -if exist $(LIBDIR)\Pod\Simple rmdir /s /q $(LIBDIR)\Pod\Simple
1804 -if exist $(LIBDIR)\Pod\Text rmdir /s /q $(LIBDIR)\Pod\Text
1805 -if exist $(LIBDIR)\Scalar rmdir /s /q $(LIBDIR)\Scalar
1806 -if exist $(LIBDIR)\Search rmdir /s /q $(LIBDIR)\Search
1807 -if exist $(LIBDIR)\Sub rmdir /s /q $(LIBDIR)\Sub
1808 -if exist $(LIBDIR)\Sys rmdir /s /q $(LIBDIR)\Sys
1809 -if exist $(LIBDIR)\TAP rmdir /s /q $(LIBDIR)\TAP
1810 -if exist $(LIBDIR)\Term rmdir /s /q $(LIBDIR)\Term
1811 -if exist $(LIBDIR)\Test rmdir /s /q $(LIBDIR)\Test
908f2cb5 1812 -if exist $(LIBDIR)\Test2 rmdir /s /q $(LIBDIR)\Test2
342634f3 1813 -if exist $(LIBDIR)\Text rmdir /s /q $(LIBDIR)\Text
1814 -if exist $(LIBDIR)\Thread rmdir /s /q $(LIBDIR)\Thread
1815 -if exist $(LIBDIR)\threads rmdir /s /q $(LIBDIR)\threads
1816 -if exist $(LIBDIR)\Tie\Hash rmdir /s /q $(LIBDIR)\Tie\Hash
1817 -if exist $(LIBDIR)\Unicode\Collate rmdir /s /q $(LIBDIR)\Unicode\Collate
1818 -if exist $(LIBDIR)\Unicode\Collate\Locale rmdir /s /q $(LIBDIR)\Unicode\Collate\Locale
1819 -if exist $(LIBDIR)\version rmdir /s /q $(LIBDIR)\version
1820 -if exist $(LIBDIR)\VMS rmdir /s /q $(LIBDIR)\VMS
1821 -if exist $(LIBDIR)\Win32API rmdir /s /q $(LIBDIR)\Win32API
1822 -if exist $(LIBDIR)\XS rmdir /s /q $(LIBDIR)\XS
1823 -cd $(PODDIR) && del /f *.html *.bat roffitall \
d228bb8b 1824 perl5335delta.pod perlaix.pod perlamiga.pod perlandroid.pod \
79c32fc2 1825 perlapi.pod perlbs2000.pod perlcn.pod perlcygwin.pod \
342634f3 1826 perldos.pod perlfreebsd.pod perlhaiku.pod perlhpux.pod \
1827 perlhurd.pod perlintern.pod perlirix.pod perljp.pod perlko.pod \
1828 perllinux.pod perlmacos.pod perlmacosx.pod perlmodlib.pod \
1829 perlnetware.pod perlopenbsd.pod perlos2.pod perlos390.pod \
1830 perlos400.pod perlplan9.pod perlqnx.pod perlriscos.pod \
822c8b4d
DIM
1831 perlsolaris.pod perlsynology.pod perltoc.pod perltru64.pod \
1832 perltw.pod perluniprops.pod perlvos.pod perlwin32.pod
2560602c 1833 -cd ..\utils && del /f h2ph splain perlbug pl2pm h2xs \
bf543eaf 1834 perldoc perlivp libnetcfg enc2xs encguess piconv cpan *.bat \
342634f3 1835 xsubpp pod2html instmodsh json_pp prove ptar ptardiff ptargrep shasum corelist zipdetails
1836 -del /f ..\config.sh perlmain.c dlutils.c config.h.new \
1837 perlmainst.c
1838 -del /f $(CONFIGPM)
1839 -del /f ..\lib\Config_git.pl
1840 -del /f "bin\*.bat"
1841 -del /f perllibst.h
1842 -del /f $(PERLEXE_RES) perl.base
1843 -cd .. && del /s *$(a) *.map *.pdb *.ilk *.bs *$(o) .exists pm_to_blib ppport.h
1844 -cd $(EXTDIR) && del /s *.def Makefile Makefile.old
1845 -cd $(DISTDIR) && del /s *.def Makefile Makefile.old
1846 -cd $(CPANDIR) && del /s *.def Makefile Makefile.old
1847 -del /s ..\utils\Makefile
1848 -if exist $(AUTODIR) rmdir /s /q $(AUTODIR)
1849 -if exist $(COREDIR) rmdir /s /q $(COREDIR)
1850 -if exist pod2htmd.tmp del pod2htmd.tmp
1851 -if exist $(HTMLDIR) rmdir /s /q $(HTMLDIR)
1852 -del /f ..\t\test_state
1853
1854install : all installbare installhtml
1855
1856installbare : utils ..\pod\perltoc.pod
1857 $(PERLEXE) ..\installperl
1858 if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\$(NULL)
1859 if exist $(PERLEXESTATIC) $(XCOPY) $(PERLEXESTATIC) $(INST_BIN)\$(NULL)
1860 $(XCOPY) $(GLOBEXE) $(INST_BIN)\$(NULL)
1861 if exist ..\perl*.pdb $(XCOPY) ..\perl*.pdb $(INST_BIN)\$(NULL)
1862 $(XCOPY) "bin\*.bat" $(INST_SCRIPT)\$(NULL)
1863
1864installhtml : doc
1865 $(RCOPY) $(HTMLDIR)\*.* $(INST_HTML)\$(NULL)
1866
1867inst_lib : $(CONFIGPM)
1868 $(RCOPY) ..\lib $(INST_LIB)\$(NULL)
1869
bf543eaf
DD
1870$(UNIDATAFILES) : ..\pod\perluniprops.pod
1871
1872..\pod\perluniprops.pod: ..\lib\unicore\mktables $(CONFIGPM)
1873 $(MINIPERL) -I..\lib ..\lib\unicore\mktables -C ..\lib\unicore -P ..\pod -maketest -makelist -p
342634f3 1874
bf543eaf 1875minitest : $(HAVEMINIPERL) $(GLOBEXE) $(CONFIGPM) $(UNIDATAFILES) utils
342634f3 1876 $(XCOPY) $(MINIPERL) ..\t\$(NULL)
1877 if exist ..\t\perl.exe del /f ..\t\perl.exe
1878 rename ..\t\miniperl.exe perl.exe
1879 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1880 attrib -r "..\t\*.*"
1881 cd ..\t && \
1882 $(MINIPERL) -I..\lib harness base/*.t comp/*.t cmd/*.t io/*.t opbasic/*.t op/*.t pragma/*.t
1883
b6e5775f 1884test-prep : all utils ..\pod\perltoc.pod $(TESTPREPGCC)
342634f3 1885 $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1886 $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1887 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1888# If building with gcc versions 4.x.x or greater, then
1889# the GCC helper DLL will also need copied to the test directory.
1890# The name of the dll can change, depending upon which vendor has supplied
1891# your compiler, and upon the values of "x".
1892# libstdc++-6.dll is copied if it exists as it, too, may then be needed.
1893# Without this copying, the op/taint.t test script will fail.
b6e5775f
DD
1894
1895ifeq ($(CCTYPE),GCC)
1896
1897test-prep-gcc :
342634f3 1898 if exist $(CCDLLDIR)\libgcc_s_seh-1.dll $(XCOPY) $(CCDLLDIR)\libgcc_s_seh-1.dll ..\t\$(NULL)
1899 if exist $(CCDLLDIR)\libgcc_s_sjlj-1.dll $(XCOPY) $(CCDLLDIR)\libgcc_s_sjlj-1.dll ..\t\$(NULL)
1900 if exist $(CCDLLDIR)\libgcc_s_dw2-1.dll $(XCOPY) $(CCDLLDIR)\libgcc_s_dw2-1.dll ..\t\$(NULL)
1901 if exist $(CCDLLDIR)\libstdc++-6.dll $(XCOPY) $(CCDLLDIR)\libstdc++-6.dll ..\t\$(NULL)
1902 if exist $(CCDLLDIR)\libwinpthread-1.dll $(XCOPY) $(CCDLLDIR)\libwinpthread-1.dll ..\t\$(NULL)
1903
b6e5775f
DD
1904endif
1905
342634f3 1906test : test-prep
1907 set PERL_STATIC_EXT=$(STATIC_EXT) && \
b6e5775f 1908 cd ..\t && perl.exe harness $(TEST_SWITCHES) $(TEST_FILES)
342634f3 1909
1910test_porting : test-prep
1911 set PERL_STATIC_EXT=$(STATIC_EXT) && \
b6e5775f 1912 cd ..\t && perl.exe harness $(TEST_SWITCHES) porting\*.t ..\lib\diagnostics.t
342634f3 1913
1914test-reonly : reonly utils
1915 $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1916 $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1917 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
bf543eaf 1918 cd ..\t && perl.exe harness $(OPT) -re \bpat\\/ $(EXTRA)
342634f3 1919
1920regen :
bf543eaf 1921 cd .. && regen.pl
342634f3 1922
1923test-notty : test-prep
1924 set PERL_STATIC_EXT=$(STATIC_EXT) && \
1925 set PERL_SKIP_TTY_TEST=1 && \
bf543eaf 1926 cd ..\t && perl.exe harness $(TEST_SWITCHES) $(TEST_FILES)
342634f3 1927
1928_test :
1929 $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1930 $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1931 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1932 set PERL_STATIC_EXT=$(STATIC_EXT) && \
bf543eaf 1933 cd ..\t && perl.exe harness $(TEST_SWITCHES) $(TEST_FILES)
342634f3 1934
1935_clean :
1936 -@erase miniperlmain$(o)
1937 -@erase $(MINIPERL)
1938 -@erase perlglob$(o)
1939 -@erase perlmain$(o)
1940 -@erase perlmainst$(o)
342634f3 1941 -@erase /f config.h
1942 -@erase /f ..\git_version.h
1943 -@erase $(GLOBEXE)
1944 -@erase $(PERLEXE)
1945 -@erase $(WPERLEXE)
1946 -@erase $(PERLEXESTATIC)
1947 -@erase $(PERLSTATICLIB)
1948 -@erase $(PERLDLL)
1949 -@erase $(CORE_OBJ)
1950 -@erase $(GENUUDMAP) $(GENUUDMAP_OBJ) $(GENERATED_HEADERS)
8657e86b 1951 -@erase .coreheaders
342634f3 1952 -if exist $(MINIDIR) rmdir /s /q $(MINIDIR)
1953 -if exist $(UNIDATADIR1) rmdir /s /q $(UNIDATADIR1)
1954 -if exist $(UNIDATADIR2) rmdir /s /q $(UNIDATADIR2)
1955 -@erase $(UNIDATAFILES)
1956 -@erase $(WIN32_OBJ)
1957 -@erase $(DLL_OBJ)
1958 -@erase ..\*$(o) ..\*$(a) ..\*.exp *$(o) *$(a) *.exp *.res
1959 -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
1960 -@erase *.ilk
bf543eaf 1961 -@erase *.pdb ..\*.pdb
342634f3 1962 -@erase Extensions_static
1963
1964clean : Extensions_clean _clean
1965
1966realclean : Extensions_realclean _clean
1967
1968# Handy way to run perlbug -ok without having to install and run the
1969# installed perlbug. We don't re-run the tests here - we trust the user.
1970# Please *don't* use this unless all tests pass.
1971# If you want to report test failures, use "gmake nok" instead.
bf543eaf
DD
1972ok: utils $(PERLEXE) $(PERLDLL) Extensions_nonxs Extensions
1973 $(PERLEXE) ..\utils\perlbug -ok -s "(UNINSTALLED)"
1974
1975okfile: utils $(PERLEXE) $(PERLDLL) Extensions_nonxs Extensions
1976 $(PERLEXE) ..\utils\perlbug -ok -s "(UNINSTALLED)" -F perl.ok
342634f3 1977
bf543eaf
DD
1978nok: utils $(PERLEXE) $(PERLDLL) Extensions_nonxs Extensions
1979 $(PERLEXE) ..\utils\perlbug -nok -s "(UNINSTALLED)"
342634f3 1980
bf543eaf
DD
1981nokfile: utils $(PERLEXE) $(PERLDLL) Extensions_nonxs Extensions
1982 $(PERLEXE) ..\utils\perlbug -nok -s "(UNINSTALLED)" -F perl.nok
342634f3 1983