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