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