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