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