This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add link for the Coverity perl5 project.
[perl5.git] / win32 / GNUmakefile
1 #
2 # Makefile to build perl on Windows using GNU make + gcc + MinGW.
3 #
4 # This is set up to build a perl.exe that runs off a shared library
5 # (perl523.dll).  Also makes individual DLLs for the XS extensions.
6 #
7 # The easiest way to customize the build process is to use parameters like this:
8 #
9 # c:\dev\perlsrc\win32> gmake INST_TOP=c:\sw\perl CCHOME=c:\sw\mingw USE_64_BIT_INT=define
10
11
12 ##
13 ## Make sure you read README.win32 *before* you mess with anything here!
14 ##
15
16 #
17 # We set this to point to cmd.exe in case GNU Make finds sh.exe in the path.
18 # Comment this line out if necessary
19 #
20 SHELL := cmd.exe
21
22 # define whether you want to use native gcc compiler or cross-compiler
23 # possible values: gcc
24 #                  i686-w64-mingw32-gcc
25 #                  x86_64-w64-mingw32-gcc
26 GCCBIN := gcc
27
28 ifeq ($(GCCBIN),x86_64-w64-mingw32-gcc)
29 GCCCROSS := x86_64-w64-mingw32
30 endif
31 ifeq ($(GCCBIN),i686-w64-mingw32-gcc)
32 GCCCROSS := i686-w64-mingw32
33 endif
34
35 GCCTARGET := $(shell $(GCCBIN) -dumpmachine)
36 GCCVER1   := $(shell for /f "delims=. tokens=1,2,3" %%i in ('gcc -dumpversion') do echo %%i)
37 GCCVER2   := $(shell for /f "delims=. tokens=1,2,3" %%i in ('gcc -dumpversion') do echo %%j)
38 GCCVER3   := $(shell for /f "delims=. tokens=1,2,3" %%i in ('gcc -dumpversion') do echo %%k)
39
40 ifeq ($(GCCTARGET),x86_64-w64-mingw32)
41 WIN64 := define
42 ARCHITECTURE := x64
43 endif
44 ifeq ($(GCCTARGET),i686-w64-mingw32)
45 WIN64 := undef
46 ARCHITECTURE := x86
47 endif
48
49 ##
50 ## Build configuration.  Edit the values below to suit your needs.
51 ##
52
53 #
54 # Set these to wherever you want "gmake install" to put your
55 # newly built perl.
56 #
57 INST_DRV := c:
58 INST_TOP := $(INST_DRV)\perl
59
60 #
61 # Comment this out if you DON'T want your perl installation to be versioned.
62 # This means that the new installation will overwrite any files from the
63 # old installation at the same INST_TOP location.  Leaving it enabled is
64 # the safest route, as perl adds the extra version directory to all the
65 # locations it installs files to.  If you disable it, an alternative
66 # versioned installation can be obtained by setting INST_TOP above to a
67 # path that includes an arbitrary version string.
68 #
69 #INST_VER       := \5.23.4
70
71 #
72 # Comment this out if you DON'T want your perl installation to have
73 # architecture specific components.  This means that architecture-
74 # specific files will be installed along with the architecture-neutral
75 # files.  Leaving it enabled is safer and more flexible, in case you
76 # want to build multiple flavors of perl and install them together in
77 # the same location.  Commenting it out gives you a simpler
78 # installation that is easier to understand for beginners.
79 #
80 #INST_ARCH      := \$(ARCHNAME)
81
82 #
83 # Uncomment this if you want perl to run
84 #       $Config{sitelibexp}\sitecustomize.pl
85 # before anything else.  This script can then be set up, for example,
86 # to add additional entries to @INC.
87 #
88 #USE_SITECUST   := define
89
90 #
91 # uncomment to enable multiple interpreters.  This is needed for fork()
92 # emulation and for thread support, and is auto-enabled by USE_IMP_SYS
93 # and USE_ITHREADS below.
94 #
95 USE_MULTI       := define
96
97 #
98 # Interpreter cloning/threads; now reasonably complete.
99 # This should be enabled to get the fork() emulation.  This needs (and
100 # will auto-enable) USE_MULTI above.
101 #
102 USE_ITHREADS    := define
103
104 #
105 # uncomment to enable the implicit "host" layer for all system calls
106 # made by perl.  This is also needed to get fork().  This needs (and
107 # will auto-enable) USE_MULTI above.
108 #
109 USE_IMP_SYS     := define
110
111 #
112 # Comment out next assign to disable perl's I/O subsystem and use compiler's
113 # stdio for IO - depending on your compiler vendor and run time library you may
114 # then get a number of fails from make test i.e. bugs - complain to them not us ;-).
115 # You will also be unable to take full advantage of perl5.8's support for multiple
116 # encodings and may see lower IO performance. You have been warned.
117 #
118 USE_PERLIO      := define
119
120 #
121 # Comment this out if you don't want to enable large file support for
122 # some reason.  Should normally only be changed to maintain compatibility
123 # with an older release of perl.
124 #
125 USE_LARGE_FILES := define
126
127 #
128 # Uncomment this if you're building a 32-bit perl and want 64-bit integers.
129 # (If you're building a 64-bit perl then you will have 64-bit integers whether
130 # or not this is uncommented.)
131 # Note: This option is not supported in 32-bit MSVC60 builds.
132 #
133 #USE_64_BIT_INT := define
134
135 #
136 # Uncomment this if you want to support the use of long doubles.
137 #
138 #USE_LONG_DOUBLE :=define
139
140 #
141 # uncomment next line if you want debug version of perl (big,slow)
142 # If not enabled, we automatically try to use maximum optimization
143 # with all compilers that are known to have a working optimizer.
144 #
145 #CFG            := Debug
146
147 #
148 # uncomment to enable linking with setargv.obj under the Visual C
149 # compiler. Setting this options enables perl to expand wildcards in
150 # arguments, but it may be harder to use alternate methods like
151 # File::DosGlob that are more powerful.  This option is supported only with
152 # Visual C.
153 #
154 #USE_SETARGV    := define
155
156 #
157 # set this if you wish to use perl's malloc
158 # WARNING: Turning this on/off WILL break binary compatibility with extensions
159 # you may have compiled with/without it.  Be prepared to recompile all
160 # extensions if you change the default.  Currently, this cannot be enabled
161 # if you ask for USE_IMP_SYS above.
162 #
163 #PERL_MALLOC    := define
164
165 #
166 # set this to enable debugging mstats
167 # This must be enabled to use the Devel::Peek::mstat() function.  This cannot
168 # be enabled without PERL_MALLOC as well.
169 #
170 #DEBUG_MSTATS   := define
171
172 #
173 # set this to additionally provide a statically linked perl-static.exe.
174 # Note that dynamic loading will not work with this perl, so you must
175 # include required modules statically using the STATIC_EXT or ALL_STATIC
176 # variables below. A static library perl523s.lib will also be created.
177 # Ordinary perl.exe is not affected by this option.
178 #
179 #BUILD_STATIC   := define
180
181 #
182 # in addition to BUILD_STATIC the option ALL_STATIC makes *every*
183 # extension get statically built
184 # This will result in a very large perl executable, but the main purpose
185 # is to have proper linking set so as to be able to create miscellaneous
186 # executables with different built-in extensions
187 #
188 #ALL_STATIC     := define
189
190 #
191 # set the install locations of the compiler include/libraries
192 # Running VCVARS32.BAT is *required* when using Visual C.
193 # Some versions of Visual C don't define MSVCDIR in the environment,
194 # so you may have to set CCHOME explicitly (spaces in the path name should
195 # not be quoted)
196 #
197 CCHOME          := C:\MinGW
198
199 #
200 # Following sets $Config{incpath} and $Config{libpth}
201 #
202
203 ifneq ($(GCCCROSS),)
204 CCINCDIR := $(CCHOME)\$(GCCCROSS)\include
205 CCLIBDIR := $(CCHOME)\$(GCCCROSS)\lib
206 CCDLLDIR := $(CCLIBDIR)
207 ARCHPREFIX := $(GCCCROSS)-
208 else
209 CCINCDIR := $(CCHOME)\include
210 CCLIBDIR := $(CCHOME)\lib
211 CCDLLDIR := $(CCHOME)\bin
212 ARCHPREFIX :=
213 endif
214
215 #
216 # Additional compiler flags can be specified here.
217 #
218 BUILDOPT        := $(BUILDOPTEXTRA)
219
220 #
221 # This should normally be disabled.  Enabling it will disable the File::Glob
222 # implementation of CORE::glob.
223 #
224 #BUILDOPT       += -DPERL_EXTERNAL_GLOB
225
226 #
227 # Perl needs to read scripts in text mode so that the DATA filehandle
228 # works correctly with seek() and tell(), or around auto-flushes of
229 # all filehandles (e.g. by system(), backticks, fork(), etc).
230 #
231 # The current version on the ByteLoader module on CPAN however only
232 # works if scripts are read in binary mode.  But before you disable text
233 # mode script reading (and break some DATA filehandle functionality)
234 # please check first if an updated ByteLoader isn't available on CPAN.
235 #
236 BUILDOPT        += -DPERL_TEXTMODE_SCRIPTS
237
238 #
239 # specify semicolon-separated list of extra directories that modules will
240 # look for libraries (spaces in path names need not be quoted)
241 #
242 EXTRALIBDIRS    :=
243
244 #
245 # set this to your email address (perl will guess a value from
246 # from your loginname and your hostname, which may not be right)
247 #
248 #EMAIL          :=
249
250 ##
251 ## Build configuration ends.
252 ##
253
254 ##################### CHANGE THESE ONLY IF YOU MUST #####################
255
256 PERL_MALLOC     ?= undef
257 DEBUG_MSTATS    ?= undef
258
259 USE_SITECUST    ?= undef
260 USE_MULTI       ?= undef
261 USE_ITHREADS    ?= undef
262 USE_IMP_SYS     ?= undef
263 USE_PERLIO      ?= undef
264 USE_LARGE_FILES ?= undef
265 USE_64_BIT_INT  ?= undef
266 USE_LONG_DOUBLE ?= undef
267
268 ifeq ($(USE_IMP_SYS),define)
269 PERL_MALLOC     = undef
270 endif
271
272 ifeq ($(PERL_MALLOC),undef)
273 DEBUG_MSTATS    = undef
274 endif
275
276 ifeq ($(DEBUG_MSTATS),define)
277 BUILDOPT        += -DPERL_DEBUGGING_MSTATS
278 endif
279
280 ifeq ("$(USE_IMP_SYS) $(USE_MULTI)","define undef")
281 USE_MULTI       = define
282 endif
283
284 ifeq ("$(USE_ITHREADS) $(USE_MULTI)","define undef")
285 USE_MULTI       = define
286 endif
287
288 ifeq ($(USE_SITECUST),define)
289 BUILDOPT        += -DUSE_SITECUSTOMIZE
290 endif
291
292 ifneq ($(USE_MULTI),undef)
293 BUILDOPT        += -DPERL_IMPLICIT_CONTEXT
294 endif
295
296 ifneq ($(USE_IMP_SYS),undef)
297 BUILDOPT        += -DPERL_IMPLICIT_SYS
298 endif
299
300 ifeq ($(WIN64),define)
301 USE_64_BIT_INT  = define
302 endif
303
304 ifeq ($(USE_MULTI),define)
305 ARCHNAME        = MSWin32-$(ARCHITECTURE)-multi
306 else
307 ifeq ($(USE_PERLIO),define)
308 ARCHNAME        = MSWin32-$(ARCHITECTURE)-perlio
309 else
310 ARCHNAME        = MSWin32-$(ARCHITECTURE)
311 endif
312 endif
313
314 ifeq ($(USE_PERLIO),define)
315 BUILDOPT        += -DUSE_PERLIO
316 endif
317
318 ifeq ($(USE_ITHREADS),define)
319 ARCHNAME        := $(ARCHNAME)-thread
320 endif
321
322 ifneq ($(WIN64),define)
323 ifeq ($(USE_64_BIT_INT),define)
324 ARCHNAME        := $(ARCHNAME)-64int
325 endif
326 endif
327
328 ifeq ($(USE_LONG_DOUBLE),define)
329 ARCHNAME        := $(ARCHNAME)-ld
330 endif
331
332 ARCHDIR         = ..\lib\$(ARCHNAME)
333 COREDIR         = ..\lib\CORE
334 AUTODIR         = ..\lib\auto
335 LIBDIR          = ..\lib
336 EXTDIR          = ..\ext
337 DISTDIR         = ..\dist
338 CPANDIR         = ..\cpan
339 PODDIR          = ..\pod
340 HTMLDIR         = .\html
341
342 #
343 INST_SCRIPT     = $(INST_TOP)$(INST_VER)\bin
344 INST_BIN        = $(INST_SCRIPT)$(INST_ARCH)
345 INST_LIB        = $(INST_TOP)$(INST_VER)\lib
346 INST_ARCHLIB    = $(INST_LIB)$(INST_ARCH)
347 INST_COREDIR    = $(INST_ARCHLIB)\CORE
348 INST_HTML       = $(INST_TOP)$(INST_VER)\html
349
350 #
351 # Programs to compile, build .lib files and link
352 #
353
354 MINIBUILDOPT    :=
355
356 CC              = $(ARCHPREFIX)gcc
357 LINK32          = $(ARCHPREFIX)g++
358 LIB32           = $(ARCHPREFIX)ar rc
359 IMPLIB          = $(ARCHPREFIX)dlltool
360 RSC             = $(ARCHPREFIX)windres
361
362 ifeq ($(USE_LONG_DOUBLE),define)
363 BUILDOPT        += -D__USE_MINGW_ANSI_STDIO
364 MINIBUILDOPT    += -D__USE_MINGW_ANSI_STDIO
365 endif
366
367 # If you are using GCC, 4.3 or later by default we add the -fwrapv option.
368 # See https://rt.perl.org/Ticket/Display.html?id=121505
369 #
370 GCCWRAPV := $(shell if "$(GCCVER1)"=="4" (if "$(GCCVER2)" geq "3" echo define) else if "$(GCCVER1)" geq "5" (echo define))
371
372 ifeq ($(GCCWRAPV),define)
373 BUILDOPT        += -fwrapv
374 MINIBUILDOPT    += -fwrapv
375 endif
376
377 i = .i
378 o = .o
379 a = .a
380
381 #
382 # Options
383 #
384
385 INCLUDES        = -I.\include -I. -I.. -I$(COREDIR)
386 DEFINES         = -DWIN32
387 ifeq ($(WIN64),define)
388 DEFINES         += -DWIN64 -DCONSERVATIVE
389 endif
390 LOCDEFS         = -DPERLDLL -DPERL_CORE
391 SUBSYS          = console
392 CXX_FLAG        = -xc++
393 LIBC            =
394 LIBFILES        = $(LIBC) \
395                   -lmoldname -lkernel32 -luser32 -lgdi32 \
396                   -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 \
397                   -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr \
398                   -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
399
400 ifeq ($(CFG),Debug)
401 OPTIMIZE        = -g -O2 -DDEBUGGING
402 LINK_DBG        = -g
403 else
404 OPTIMIZE        = -s -O2
405 LINK_DBG        = -s
406 endif
407
408 EXTRACFLAGS     =
409 CFLAGS          = $(EXTRACFLAGS) $(INCLUDES) $(DEFINES) $(LOCDEFS) $(OPTIMIZE)
410 LINK_FLAGS      = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)"
411 OBJOUT_FLAG     = -o
412 EXEOUT_FLAG     = -o
413 LIBOUT_FLAG     =
414
415 BUILDOPT        += -fno-strict-aliasing -mms-bitfields
416 MINIBUILDOPT    += -fno-strict-aliasing
417 CFLAGS_O        = $(CFLAGS) $(BUILDOPT)
418
419 # used to allow local linking flags that are not propogated into Config.pm,
420 # currently unused
421 #   -- BKS, 12-12-1999
422 PRIV_LINK_FLAGS =
423 BLINK_FLAGS     = $(PRIV_LINK_FLAGS) $(LINK_FLAGS)
424
425 #################### do not edit below this line #######################
426 ############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
427
428 %$(o): %.c
429         $(CC) -c -I$(<D) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $<
430
431 %.i: %.c
432         $(CC) -c -I$(<D) $(CFLAGS_O) -E $< >$@
433
434 %.c: %.y
435         $(NOOP)
436
437 %.dll: %$(o)
438         $(LINK32) -o $@ $(BLINK_FLAGS) $< $(LIBFILES)
439         $(IMPLIB) --input-def $(*F).def --output-lib $(*F).a $@
440
441 %.res: %.rc
442         $(RSC) --use-temp-file --include-dir=. --include-dir=.. -O COFF -D INCLUDE_MANIFEST -i $< -o $@
443
444 #
445 # various targets
446 MINIPERL        = ..\miniperl.exe
447 MINIDIR         = mini
448 PERLEXE         = ..\perl.exe
449 WPERLEXE        = ..\wperl.exe
450 PERLEXESTATIC   = ..\perl-static.exe
451 STATICDIR       = .\static.tmp
452 GLOBEXE         = ..\perlglob.exe
453 CONFIGPM        = ..\lib\Config.pm ..\lib\Config_heavy.pl
454 GENUUDMAP       = ..\generate_uudmap.exe
455 ifeq ($(BUILD_STATIC),define)
456 PERLSTATIC      = static
457 else
458 ifeq ($(ALL_STATIC),define)
459 PERLSTATIC      = static
460 else
461 PERLSTATIC      =
462 endif
463 endif
464
465 # Unicode data files generated by mktables
466 UNIDATAFILES     = ..\lib\unicore\Decomposition.pl ..\lib\unicore\TestProp.pl \
467                    ..\lib\unicore\CombiningClass.pl ..\lib\unicore\Name.pl \
468                    ..\lib\unicore\UCD.pl ..\lib\unicore\Name.pm            \
469                    ..\lib\unicore\Heavy.pl ..\lib\unicore\mktables.lst
470
471 # Directories of Unicode data files generated by mktables
472 UNIDATADIR1     = ..\lib\unicore\To
473 UNIDATADIR2     = ..\lib\unicore\lib
474
475 PERLEXE_MANIFEST= .\perlexe.manifest
476 PERLEXE_ICO     = .\perlexe.ico
477 PERLEXE_RES     = .\perlexe.res
478 PERLDLL_RES     =
479
480 # Nominate a target which causes extensions to be re-built
481 # This used to be $(PERLEXE), but at worst it is the .dll that they depend
482 # on and really only the interface - i.e. the .def file used to export symbols
483 # from the .dll
484 PERLDEP = perldll.def
485
486
487 PL2BAT          = bin\pl2bat.pl
488
489 UTILS           =                       \
490                 ..\utils\h2ph           \
491                 ..\utils\splain         \
492                 ..\utils\perlbug        \
493                 ..\utils\pl2pm          \
494                 ..\utils\c2ph           \
495                 ..\utils\pstruct        \
496                 ..\utils\h2xs           \
497                 ..\utils\perldoc        \
498                 ..\utils\perlivp        \
499                 ..\utils\libnetcfg      \
500                 ..\utils\enc2xs         \
501                 ..\utils\piconv         \
502                 ..\utils\corelist       \
503                 ..\utils\cpan           \
504                 ..\utils\xsubpp         \
505                 ..\utils\pod2html       \
506                 ..\utils\prove          \
507                 ..\utils\ptar           \
508                 ..\utils\ptardiff       \
509                 ..\utils\ptargrep       \
510                 ..\utils\zipdetails     \
511                 ..\utils\shasum         \
512                 ..\utils\instmodsh      \
513                 ..\utils\json_pp        \
514                 bin\exetype.pl          \
515                 bin\runperl.pl          \
516                 bin\pl2bat.pl           \
517                 bin\perlglob.pl         \
518                 bin\search.pl
519
520 CFGSH_TMPL      = config.gc
521 CFGH_TMPL       = config_H.gc
522 PERLIMPLIB      = ..\libperl523$(a)
523 PERLSTATICLIB   = ..\libperl523s$(a)
524 INT64           = long long
525
526 # makedef.pl must be updated if this changes, and this should normally
527 # only change when there is an incompatible revision of the public API.
528 PERLDLL         = ..\perl523.dll
529
530 XCOPY           = xcopy /f /r /i /d /y
531 RCOPY           = xcopy /f /r /i /e /d /y
532 NOOP            = @rem
533
534 MICROCORE_SRC   =               \
535                 ..\av.c         \
536                 ..\caretx.c     \
537                 ..\deb.c        \
538                 ..\doio.c       \
539                 ..\doop.c       \
540                 ..\dquote.c     \
541                 ..\dump.c       \
542                 ..\globals.c    \
543                 ..\gv.c         \
544                 ..\mro_core.c   \
545                 ..\hv.c         \
546                 ..\locale.c     \
547                 ..\keywords.c   \
548                 ..\mathoms.c    \
549                 ..\mg.c         \
550                 ..\numeric.c    \
551                 ..\op.c         \
552                 ..\pad.c        \
553                 ..\perl.c       \
554                 ..\perlapi.c    \
555                 ..\perly.c      \
556                 ..\pp.c         \
557                 ..\pp_ctl.c     \
558                 ..\pp_hot.c     \
559                 ..\pp_pack.c    \
560                 ..\pp_sort.c    \
561                 ..\pp_sys.c     \
562                 ..\reentr.c     \
563                 ..\regcomp.c    \
564                 ..\regexec.c    \
565                 ..\run.c        \
566                 ..\scope.c      \
567                 ..\sv.c         \
568                 ..\taint.c      \
569                 ..\time64.c     \
570                 ..\toke.c       \
571                 ..\universal.c  \
572                 ..\utf8.c       \
573                 ..\util.c
574
575 EXTRACORE_SRC   += perllib.c
576
577 ifeq ($(PERL_MALLOC),define)
578 EXTRACORE_SRC   += ..\malloc.c
579 endif
580
581 EXTRACORE_SRC   += ..\perlio.c
582
583 WIN32_SRC       =               \
584                 .\win32.c       \
585                 .\win32sck.c    \
586                 .\win32thread.c \
587                 .\fcrypt.c
588
589 # We need this for miniperl build unless we override canned
590 # config.h #define building mini\*
591 #ifeq ($(USE_PERLIO)" == "define"
592 WIN32_SRC       += .\win32io.c
593 #endif
594
595 CORE_NOCFG_H    =               \
596                 ..\av.h         \
597                 ..\cop.h        \
598                 ..\cv.h         \
599                 ..\dosish.h     \
600                 ..\embed.h      \
601                 ..\form.h       \
602                 ..\gv.h         \
603                 ..\handy.h      \
604                 ..\hv.h         \
605                 ..\hv_func.h    \
606                 ..\iperlsys.h   \
607                 ..\mg.h         \
608                 ..\nostdio.h    \
609                 ..\op.h         \
610                 ..\opcode.h     \
611                 ..\perl.h       \
612                 ..\perlapi.h    \
613                 ..\perlsdio.h   \
614                 ..\perly.h      \
615                 ..\pp.h         \
616                 ..\proto.h      \
617                 ..\regcomp.h    \
618                 ..\regexp.h     \
619                 ..\scope.h      \
620                 ..\sv.h         \
621                 ..\thread.h     \
622                 ..\unixish.h    \
623                 ..\utf8.h       \
624                 ..\util.h       \
625                 ..\warnings.h   \
626                 ..\XSUB.h       \
627                 ..\EXTERN.h     \
628                 ..\perlvars.h   \
629                 ..\intrpvar.h   \
630                 .\include\dirent.h      \
631                 .\include\netdb.h       \
632                 .\include\sys\errno2.h  \
633                 .\include\sys\socket.h  \
634                 .\win32.h
635
636 CORE_H          = $(CORE_NOCFG_H) .\config.h ..\git_version.h
637
638 UUDMAP_H        = ..\uudmap.h
639 BITCOUNT_H      = ..\bitcount.h
640 MG_DATA_H       = ..\mg_data.h
641 GENERATED_HEADERS = $(UUDMAP_H) $(BITCOUNT_H) $(MG_DATA_H)
642
643 MICROCORE_OBJ   = $(MICROCORE_SRC:.c=.o)
644 CORE_OBJ        = $(MICROCORE_OBJ) $(EXTRACORE_SRC:.c=.o)
645 WIN32_OBJ       = $(WIN32_SRC:.c=.o)
646
647 MINICORE_OBJ    = $(subst ..\,mini\,$(MICROCORE_OBJ))   \
648                   $(MINIDIR)\miniperlmain$(o)   \
649                   $(MINIDIR)\perlio$(o)
650 MINIWIN32_OBJ   = $(subst .\,mini\,$(WIN32_OBJ))
651 MINI_OBJ        = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
652 DLL_OBJ         = $(DYNALOADER)
653 GENUUDMAP_OBJ   = $(GENUUDMAP:.exe=.o)
654
655 PERLDLL_OBJ     = $(CORE_OBJ)
656 PERLEXE_OBJ     = perlmain$(o)
657 PERLEXEST_OBJ   = perlmainst$(o)
658
659 PERLDLL_OBJ     += $(WIN32_OBJ) $(DLL_OBJ)
660
661 ifneq ($(USE_SETARGV),)
662 SETARGV_OBJ     = setargv$(o)
663 endif
664
665 ifeq ($(ALL_STATIC),define)
666 # some exclusions, unfortunately, until fixed:
667 #  - MakeMaker isn't capable enough for SDBM_File (small bug)
668 STATIC_EXT      = * !SDBM_File
669 else
670 # specify static extensions here, for example:
671 # (be sure to include Win32CORE to load Win32 on demand)
672 #STATIC_EXT     = Win32CORE Cwd Compress/Raw/Zlib
673 STATIC_EXT      = Win32CORE
674 endif
675
676 DYNALOADER      = ..\DynaLoader$(o)
677
678 # vars must be separated by "\t+~\t+", since we're using the tempfile
679 # version of config_sh.pl (we were overflowing someone's buffer by
680 # trying to fit them all on the command line)
681 #       -- BKS 10-17-1999
682 CFG_VARS        =                                       \
683                 "INST_TOP=$(INST_TOP)"                  \
684                 "INST_VER=$(INST_VER)"                  \
685                 "INST_ARCH=$(INST_ARCH)"                \
686                 "archname=$(ARCHNAME)"                  \
687                 "cc=$(CC)"                              \
688                 "ld=$(LINK32)"                          \
689                 "ccflags=$(EXTRACFLAGS) $(OPTIMIZE) $(DEFINES) $(BUILDOPT)" \
690                 "cf_email=$(EMAIL)"                     \
691                 "d_mymalloc=$(PERL_MALLOC)"             \
692                 "libs=$(LIBFILES)"                      \
693                 "incpath=$(CCINCDIR)"                   \
694                 "libperl=$(subst ..\,,$(PERLIMPLIB))"   \
695                 "libpth=$(CCLIBDIR);$(EXTRALIBDIRS)"    \
696                 "libc=$(LIBC)"                          \
697                 "make=$(MAKE)"                          \
698                 "_o=$(o)"                               \
699                 "obj_ext=$(o)"                          \
700                 "_a=$(a)"                               \
701                 "lib_ext=$(a)"                          \
702                 "static_ext=$(STATIC_EXT)"              \
703                 "usethreads=$(USE_ITHREADS)"            \
704                 "useithreads=$(USE_ITHREADS)"           \
705                 "usemultiplicity=$(USE_MULTI)"          \
706                 "useperlio=$(USE_PERLIO)"               \
707                 "use64bitint=$(USE_64_BIT_INT)"         \
708                 "uselongdouble=$(USE_LONG_DOUBLE)"      \
709                 "uselargefiles=$(USE_LARGE_FILES)"      \
710                 "usesitecustomize=$(USE_SITECUST)"      \
711                 "LINK_FLAGS=$(LINK_FLAGS)"              \
712                 "optimize=$(OPTIMIZE)"                  \
713                 "ARCHPREFIX=$(ARCHPREFIX)"              \
714                 "WIN64=$(WIN64)"
715
716 #
717 # Top targets
718 #
719
720 .PHONY: all info
721
722 all : info .\config.h ..\git_version.h $(GLOBEXE) $(MINIPERL)   \
723         $(CONFIGPM) $(UNIDATAFILES) MakePPPort                  \
724         $(PERLEXE) Extensions Extensions_nonxs $(PERLSTATIC)
725
726 info :
727         @echo # GCCBIN=$(GCCBIN)
728         @echo # GCCVER=$(GCCVER1).$(GCCVER2).$(GCCVER3)
729         @echo # GCCTARGET=$(GCCTARGET)
730         @echo # GCCCROSS=$(GCCCROSS)
731         @echo # WIN64=$(WIN64)
732         @echo # ARCHITECTURE=$(ARCHITECTURE)
733         @echo # ARCHNAME=$(ARCHNAME)
734         @echo # MAKE=$(MAKE)
735 ifeq ($(GCCTARGET),)
736         @echo Unable to detect gcc and/or architecture!
737         @exit 1
738 endif
739
740
741 regnodes : ..\regnodes.h
742
743 ..\regcomp$(o) : ..\regnodes.h ..\regcharclass.h
744
745 ..\regexec$(o) : ..\regnodes.h ..\regcharclass.h
746
747 reonly : regnodes .\config.h ..\git_version.h $(GLOBEXE) $(MINIPERL)    \
748         $(CONFIGPM) $(UNIDATAFILES) $(PERLEXE)                          \
749         Extensions_reonly
750
751 static: $(PERLEXESTATIC)
752
753 #----------------------------------------------------------------
754
755 $(GLOBEXE) : perlglob$(o)
756         $(LINK32) $(BLINK_FLAGS) -mconsole -o $@ perlglob$(o) $(LIBFILES)
757
758 perlglob$(o)  : perlglob.c
759
760 config.w32 : $(CFGSH_TMPL)
761         copy $(CFGSH_TMPL) config.w32
762
763 #
764 # Copy the template config.h and set configurables at the end of it
765 # as per the options chosen and compiler used.
766 # Note: This config.h is only used to build miniperl.exe anyway, but
767 # it's as well to have its options correct to be sure that it builds
768 # and so that it's "-V" options are correct for use by makedef.pl. The
769 # real config.h used to build perl.exe is generated from the top-level
770 # config_h.SH by config_h.PL (run by miniperl.exe).
771 #
772 .\config.h : $(CFGH_TMPL) $(CORE_NOCFG_H)
773         -del /f config.h
774         copy $(CFGH_TMPL) config.h
775         @echo.>>$@
776         @echo #ifndef _config_h_footer_>>$@
777         @echo #define _config_h_footer_>>$@
778         @echo #undef Off_t>>$@
779         @echo #undef LSEEKSIZE>>$@
780         @echo #undef Off_t_size>>$@
781         @echo #undef PTRSIZE>>$@
782         @echo #undef SSize_t>>$@
783         @echo #undef HAS_ATOLL>>$@
784         @echo #undef HAS_STRTOLL>>$@
785         @echo #undef HAS_STRTOULL>>$@
786         @echo #undef Size_t_size>>$@
787         @echo #undef IVTYPE>>$@
788         @echo #undef UVTYPE>>$@
789         @echo #undef IVSIZE>>$@
790         @echo #undef UVSIZE>>$@
791         @echo #undef NV_PRESERVES_UV>>$@
792         @echo #undef NV_PRESERVES_UV_BITS>>$@
793         @echo #undef IVdf>>$@
794         @echo #undef UVuf>>$@
795         @echo #undef UVof>>$@
796         @echo #undef UVxf>>$@
797         @echo #undef UVXf>>$@
798         @echo #undef USE_64_BIT_INT>>$@
799         @echo #undef Gconvert>>$@
800         @echo #undef HAS_FREXPL>>$@
801         @echo #undef HAS_ISNANL>>$@
802         @echo #undef HAS_MODFL>>$@
803         @echo #undef HAS_MODFL_PROTO>>$@
804         @echo #undef HAS_SQRTL>>$@
805         @echo #undef HAS_STRTOLD>>$@
806         @echo #undef PERL_PRIfldbl>>$@
807         @echo #undef PERL_PRIgldbl>>$@
808         @echo #undef PERL_PRIeldbl>>$@
809         @echo #undef PERL_SCNfldbl>>$@
810         @echo #undef NVTYPE>>$@
811         @echo #undef NVSIZE>>$@
812         @echo #undef LONG_DOUBLESIZE>>$@
813         @echo #undef NV_OVERFLOWS_INTEGERS_AT>>$@
814         @echo #undef NVef>>$@
815         @echo #undef NVff>>$@
816         @echo #undef NVgf>>$@
817         @echo #undef USE_LONG_DOUBLE>>$@
818 ifeq ($(USE_LARGE_FILES),define)
819         @echo #define Off_t $(INT64)>>$@
820         @echo #define LSEEKSIZE ^8>>$@
821         @echo #define Off_t_size ^8>>$@
822 else
823         @echo #define Off_t long>>$@
824         @echo #define LSEEKSIZE ^4>>$@
825         @echo #define Off_t_size ^4>>$@
826 endif
827 ifeq ($(WIN64),define)
828         @echo #define PTRSIZE ^8>>$@
829         @echo #define SSize_t $(INT64)>>$@
830         @echo #define HAS_ATOLL>>$@
831         @echo #define HAS_STRTOLL>>$@
832         @echo #define HAS_STRTOULL>>$@
833         @echo #define Size_t_size ^8>>$@
834 else
835         @echo #define PTRSIZE ^4>>$@
836         @echo #define SSize_t int>>$@
837         @echo #undef HAS_ATOLL>>$@
838         @echo #undef HAS_STRTOLL>>$@
839         @echo #undef HAS_STRTOULL>>$@
840         @echo #define Size_t_size ^4>>$@
841 endif
842 ifeq ($(USE_64_BIT_INT),define)
843         @echo #define IVTYPE $(INT64)>>$@
844         @echo #define UVTYPE unsigned $(INT64)>>$@
845         @echo #define IVSIZE ^8>>$@
846         @echo #define UVSIZE ^8>>$@
847 ifeq ($(USE_LONG_DOUBLE),define)
848         @echo #define NV_PRESERVES_UV>>$@
849         @echo #define NV_PRESERVES_UV_BITS 64>>$@
850 else
851         @echo #undef NV_PRESERVES_UV>>$@
852         @echo #define NV_PRESERVES_UV_BITS 53>>$@
853 endif
854         @echo #define IVdf "I64d">>$@
855         @echo #define UVuf "I64u">>$@
856         @echo #define UVof "I64o">>$@
857         @echo #define UVxf "I64x">>$@
858         @echo #define UVXf "I64X">>$@
859         @echo #define USE_64_BIT_INT>>$@
860 else
861         @echo #define IVTYPE long>>$@
862         @echo #define UVTYPE unsigned long>>$@
863         @echo #define IVSIZE ^4>>$@
864         @echo #define UVSIZE ^4>>$@
865         @echo #define NV_PRESERVES_UV>>$@
866         @echo #define NV_PRESERVES_UV_BITS 32>>$@
867         @echo #define IVdf "ld">>$@
868         @echo #define UVuf "lu">>$@
869         @echo #define UVof "lo">>$@
870         @echo #define UVxf "lx">>$@
871         @echo #define UVXf "lX">>$@
872         @echo #undef USE_64_BIT_INT>>$@
873 endif
874 ifeq ($(USE_LONG_DOUBLE),define)
875         @echo #define Gconvert(x,n,t,b) sprintf((b),"%%.*""Lg",(n),(x))>>$@
876         @echo #define HAS_FREXPL>>$@
877         @echo #define HAS_ISNANL>>$@
878         @echo #define HAS_MODFL>>$@
879         @echo #define HAS_MODFL_PROTO>>$@
880         @echo #define HAS_SQRTL>>$@
881         @echo #define HAS_STRTOLD>>$@
882         @echo #define PERL_PRIfldbl "Lf">>$@
883         @echo #define PERL_PRIgldbl "Lg">>$@
884         @echo #define PERL_PRIeldbl "Le">>$@
885         @echo #define PERL_SCNfldbl "Lf">>$@
886         @echo #define NVTYPE long double>>$@
887 ifeq ($(WIN64),define)
888         @echo #define NVSIZE ^16>>$@
889         @echo #define LONG_DOUBLESIZE ^16>>$@
890 else
891         @echo #define NVSIZE ^12>>$@
892         @echo #define LONG_DOUBLESIZE ^12>>$@
893 endif
894         @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>>$@
895         @echo #define NVef "Le">>$@
896         @echo #define NVff "Lf">>$@
897         @echo #define NVgf "Lg">>$@
898         @echo #define USE_LONG_DOUBLE>>$@
899 else
900         @echo #define Gconvert(x,n,t,b) sprintf((b),"%%.*g",(n),(x))>>$@
901         @echo #undef HAS_FREXPL>>$@
902         @echo #undef HAS_ISNANL>>$@
903         @echo #undef HAS_MODFL>>$@
904         @echo #undef HAS_MODFL_PROTO>>$@
905         @echo #undef HAS_SQRTL>>$@
906         @echo #undef HAS_STRTOLD>>$@
907         @echo #undef PERL_PRIfldbl>>$@
908         @echo #undef PERL_PRIgldbl>>$@
909         @echo #undef PERL_PRIeldbl>>$@
910         @echo #undef PERL_SCNfldbl>>$@
911         @echo #define NVTYPE double>>$@
912         @echo #define NVSIZE ^8>>$@
913         @echo #define LONG_DOUBLESIZE ^8>>$@
914         @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>>$@
915         @echo #define NVef "e">>$@
916         @echo #define NVff "f">>$@
917         @echo #define NVgf "g">>$@
918         @echo #undef USE_LONG_DOUBLE>>$@
919 endif
920         @echo #endif>>$@
921
922 ..\git_version.h : $(MINIPERL) ..\make_patchnum.pl
923         cd .. && miniperl -Ilib make_patchnum.pl
924
925 # make sure that we recompile perl.c if the git version changes
926 ..\perl$(o) : ..\git_version.h
927
928 ..\config.sh : config.w32 $(MINIPERL) config_sh.PL FindExt.pm
929         $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) config.w32 > ..\config.sh
930
931 # This target is for when changes to the main config.sh happen.
932 # Edit config.gc, then make perl using GCC in a minimal configuration (i.e.
933 # with MULTI, ITHREADS, IMP_SYS, LARGE_FILES and PERLIO off), then make
934 # this target to regenerate config_H.gc.
935 regen_config_h:
936         $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS)) $(CFGSH_TMPL) > ..\config.sh
937         $(MINIPERL) -I..\lib ..\configpm --chdir=..
938         -del /f $(CFGH_TMPL)
939         -$(MINIPERL) -I..\lib config_h.PL "ARCHPREFIX=$(ARCHPREFIX)"
940         rename config.h $(CFGH_TMPL)
941
942 $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL
943         $(MINIPERL) -I..\lib ..\configpm --chdir=..
944         if exist lib\* $(RCOPY) "lib\*.*" ..\lib\$(NULL)
945         $(XCOPY) "..\*.h" $(COREDIR)\$(NULL)
946         $(XCOPY) "*.h" $(COREDIR)\$(NULL)
947         $(RCOPY) include $(COREDIR)\$(NULL)
948         $(MINIPERL) -I..\lib config_h.PL "ARCHPREFIX=$(ARCHPREFIX)" \
949             || $(MAKE) $(MAKEMACROS) $(CONFIGPM) $(MAKEFILE)
950
951 # See the comment in Makefile.SH explaining this seemingly cranky ordering
952 $(MINIPERL) : ..\lib\buildcustomize.pl
953
954 ..\lib\buildcustomize.pl : $(MINIDIR) $(MINI_OBJ) $(CRTIPMLIBS) ..\write_buildcustomize.pl
955         $(LINK32) -mconsole -o $(MINIPERL) $(BLINK_FLAGS) $(MINI_OBJ) $(LIBFILES)
956         $(MINIPERL) -I..\lib -f ..\write_buildcustomize.pl ..
957
958 $(MINIDIR) :
959         if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
960
961 $(MINICORE_OBJ) : $(CORE_NOCFG_H)
962         $(CC) -c $(CFLAGS) $(MINIBUILDOPT) -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL $(OBJOUT_FLAG)$@ ..\$(*F).c
963
964 $(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
965         $(CC) -c $(CFLAGS) $(MINIBUILDOPT) -DPERL_IS_MINIPERL $(OBJOUT_FLAG)$@ $(*F).c
966
967 # -DPERL_IMPLICIT_SYS needs C++ for perllib.c
968 # rules wrapped in .IFs break Win9X build (we end up with unbalanced []s unless
969 # unless the .IF is true), so instead we use a else with the default.
970 # This is the only file that depends on perlhost.h, vmem.h, and vdir.h
971
972 perllib$(o)     : perllib.c .\perlhost.h .\vdir.h .\vmem.h
973 ifeq ($(USE_IMP_SYS),define)
974         $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
975 else
976         $(CC) -c -I. $(CFLAGS_O) $(OBJOUT_FLAG)$@ perllib.c
977 endif
978
979 # 1. we don't want to rebuild miniperl.exe when config.h changes
980 # 2. we don't want to rebuild miniperl.exe with non-default config.h
981 # 3. we can't have miniperl.exe depend on git_version.h, as miniperl creates it
982 $(MINI_OBJ)     : $(CORE_NOCFG_H)
983
984 $(WIN32_OBJ)    : $(CORE_H)
985
986 $(CORE_OBJ)     : $(CORE_H)
987
988 $(DLL_OBJ)      : $(CORE_H)
989
990 perldll.def : $(MINIPERL) $(CONFIGPM) ..\embed.fnc ..\makedef.pl create_perllibst_h.pl
991         $(MINIPERL) -I..\lib create_perllibst_h.pl
992         $(MINIPERL) -I..\lib -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) \
993         $(BUILDOPT) CCTYPE=GCC TARG_DIR=..\ > perldll.def
994
995 $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES) Extensions_static
996         $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(BLINK_FLAGS) \
997            $(PERLDLL_OBJ) $(shell type Extensions_static) $(LIBFILES)
998         $(IMPLIB) --output-lib $(PERLIMPLIB) \
999                 --dllname $(PERLDLL) \
1000                 --def perldll.def \
1001                 --base-file perl.base \
1002                 --output-exp perl.exp
1003         $(LINK32) -mdll -o $@ $(BLINK_FLAGS) \
1004             $(PERLDLL_OBJ) $(shell type Extensions_static) $(LIBFILES) perl.exp
1005         $(XCOPY) $(PERLIMPLIB) $(COREDIR)
1006
1007 $(PERLSTATICLIB): $(PERLDLL_OBJ) Extensions_static
1008         $(LIB32) $(LIB_FLAGS) $@ $(PERLDLL_OBJ)
1009         if exist $(STATICDIR) rmdir /s /q $(STATICDIR)
1010         for %%i in ($(shell type Extensions_static)) do \
1011                 @mkdir $(STATICDIR) && cd $(STATICDIR) && \
1012                 $(ARCHPREFIX)ar x ..\%%i && \
1013                 $(ARCHPREFIX)ar q ..\$@ *$(o) && \
1014                 cd .. && rmdir /s /q $(STATICDIR)
1015         $(XCOPY) $(PERLSTATICLIB) $(COREDIR)
1016
1017 $(PERLEXE_RES): perlexe.rc $(PERLEXE_MANIFEST) $(PERLEXE_ICO)
1018
1019 $(MINIDIR)\globals$(o) : $(GENERATED_HEADERS)
1020
1021 $(UUDMAP_H) $(MG_DATA_H) : $(BITCOUNT_H)
1022
1023 $(BITCOUNT_H) : $(GENUUDMAP)
1024         $(GENUUDMAP) $(GENERATED_HEADERS)
1025
1026 $(GENUUDMAP_OBJ) : ..\mg_raw.h
1027
1028 $(GENUUDMAP) : $(GENUUDMAP_OBJ)
1029         $(LINK32) -o $@ $(BLINK_FLAGS) $(GENUUDMAP_OBJ) $(LIBFILES)
1030
1031 perlmain.c : runperl.c
1032         copy runperl.c perlmain.c
1033
1034 perlmain$(o) : perlmain.c
1035         $(CC) $(subst -DPERLDLL,-UPERLDLL,$(CFLAGS_O)) $(OBJOUT_FLAG)$@ -c perlmain.c
1036
1037 perlmainst.c : runperl.c
1038         copy runperl.c perlmainst.c
1039
1040 perlmainst$(o) : perlmainst.c
1041         $(CC) $(CFLAGS_O) $(OBJOUT_FLAG)$@ -c perlmainst.c
1042
1043 $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES)
1044         $(LINK32) -mconsole -o $@ $(BLINK_FLAGS)  \
1045             $(PERLEXE_OBJ) $(PERLEXE_RES) $(PERLIMPLIB) $(LIBFILES)
1046         copy $(PERLEXE) $(WPERLEXE)
1047         $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS
1048
1049 $(PERLEXESTATIC): $(PERLSTATICLIB) $(CONFIGPM) $(PERLEXEST_OBJ) $(PERLEXE_RES)
1050         $(LINK32) -mconsole -o $@ $(BLINK_FLAGS) \
1051             $(PERLEXEST_OBJ) $(PERLEXE_RES) $(PERLSTATICLIB) $(LIBFILES)
1052
1053 MakePPPort: $(MINIPERL) $(CONFIGPM) Extensions_nonxs
1054         $(MINIPERL) -I..\lib ..\mkppport
1055
1056 #-------------------------------------------------------------------------------
1057 # There's no direct way to mark a dependency on
1058 # DynaLoader.pm, so this will have to do
1059 Extensions : ..\make_ext.pl ..\lib\buildcustomize.pl $(PERLDEP) $(CONFIGPM) $(DYNALOADER)
1060         $(XCOPY) "..\*.h" $(COREDIR)\$(NULL)
1061         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic
1062
1063 Extensions_reonly : ..\make_ext.pl ..\lib\buildcustomize.pl $(PERLDEP) $(CONFIGPM) $(DYNALOADER)
1064         $(XCOPY) "..\*.h" $(COREDIR)\$(NULL)
1065         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +re
1066
1067 Extensions_static : ..\make_ext.pl ..\lib\buildcustomize.pl list_static_libs.pl $(PERLDEP) $(CONFIGPM) Extensions_nonxs
1068         $(XCOPY) "..\*.h" $(COREDIR)\$(NULL)
1069         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static
1070         $(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static
1071
1072 Extensions_nonxs : ..\make_ext.pl ..\lib\buildcustomize.pl $(PERLDEP) $(CONFIGPM) ..\pod\perlfunc.pod
1073         $(XCOPY) "..\*.h" $(COREDIR)\$(NULL)
1074         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --nonxs
1075
1076 $(DYNALOADER) : ..\make_ext.pl ..\lib\buildcustomize.pl $(PERLDEP) $(CONFIGPM) Extensions_nonxs
1077         $(XCOPY) "..\*.h" $(COREDIR)\$(NULL)
1078         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(EXTDIR) --dynaloader
1079
1080 Extensions_clean :
1081         -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=clean
1082
1083 Extensions_realclean :
1084         -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=realclean
1085
1086 #-------------------------------------------------------------------------------
1087
1088 doc: $(PERLEXE) ..\pod\perltoc.pod
1089         $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=$(HTMLDIR) \
1090             --podpath=pod:lib:utils --htmlroot="file://$(subst :,|,$(INST_HTML))"\
1091             --recurse
1092
1093 ..\utils\Makefile: $(CONFIGPM) ..\utils\Makefile.PL
1094         $(MINIPERL) -I..\lib ..\utils\Makefile.PL ..
1095
1096 # Note that this next section is parsed (and regenerated) by pod/buildtoc
1097 # so please check that script before making structural changes here
1098 utils: $(PERLEXE) ..\utils\Makefile
1099         cd ..\utils && $(MAKE) PERL=$(MINIPERL)
1100         copy ..\README.aix      ..\pod\perlaix.pod
1101         copy ..\README.amiga    ..\pod\perlamiga.pod
1102         copy ..\README.android  ..\pod\perlandroid.pod
1103         copy ..\README.bs2000   ..\pod\perlbs2000.pod
1104         copy ..\README.ce       ..\pod\perlce.pod
1105         copy ..\README.cn       ..\pod\perlcn.pod
1106         copy ..\README.cygwin   ..\pod\perlcygwin.pod
1107         copy ..\README.dos      ..\pod\perldos.pod
1108         copy ..\README.freebsd  ..\pod\perlfreebsd.pod
1109         copy ..\README.haiku    ..\pod\perlhaiku.pod
1110         copy ..\README.hpux     ..\pod\perlhpux.pod
1111         copy ..\README.hurd     ..\pod\perlhurd.pod
1112         copy ..\README.irix     ..\pod\perlirix.pod
1113         copy ..\README.jp       ..\pod\perljp.pod
1114         copy ..\README.ko       ..\pod\perlko.pod
1115         copy ..\README.linux    ..\pod\perllinux.pod
1116         copy ..\README.macos    ..\pod\perlmacos.pod
1117         copy ..\README.macosx   ..\pod\perlmacosx.pod
1118         copy ..\README.netware  ..\pod\perlnetware.pod
1119         copy ..\README.openbsd  ..\pod\perlopenbsd.pod
1120         copy ..\README.os2      ..\pod\perlos2.pod
1121         copy ..\README.os390    ..\pod\perlos390.pod
1122         copy ..\README.os400    ..\pod\perlos400.pod
1123         copy ..\README.plan9    ..\pod\perlplan9.pod
1124         copy ..\README.qnx      ..\pod\perlqnx.pod
1125         copy ..\README.riscos   ..\pod\perlriscos.pod
1126         copy ..\README.solaris  ..\pod\perlsolaris.pod
1127         copy ..\README.symbian  ..\pod\perlsymbian.pod
1128         copy ..\README.synology ..\pod\perlsynology.pod
1129         copy ..\README.tru64    ..\pod\perltru64.pod
1130         copy ..\README.tw       ..\pod\perltw.pod
1131         copy ..\README.vos      ..\pod\perlvos.pod
1132         copy ..\README.win32    ..\pod\perlwin32.pod
1133         copy ..\pod\perldelta.pod ..\pod\perl5234delta.pod
1134         $(PERLEXE) $(PL2BAT) $(UTILS)
1135         $(MINIPERL) -I..\lib ..\autodoc.pl ..
1136         $(MINIPERL) -I..\lib ..\pod\perlmodlib.PL -q ..
1137
1138 ..\pod\perltoc.pod: $(PERLEXE) Extensions Extensions_nonxs
1139         $(PERLEXE) -f ..\pod\buildtoc -q
1140
1141 # Note that the pod cleanup in this next section is parsed (and regenerated
1142 # by pod/buildtoc so please check that script before making changes here
1143
1144 distclean: realclean
1145         -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \
1146                 $(PERLIMPLIB) ..\miniperl$(a) $(PERLEXESTATIC) $(PERLSTATICLIB)
1147         -del /f $(LIBDIR)\Encode.pm $(LIBDIR)\encoding.pm $(LIBDIR)\Errno.pm
1148         -del /f $(LIBDIR)\Config.pod $(LIBDIR)\POSIX.pod $(LIBDIR)\threads.pm
1149         -del /f $(LIBDIR)\.exists $(LIBDIR)\attributes.pm $(LIBDIR)\DynaLoader.pm
1150         -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
1151         -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm
1152         -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
1153         -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
1154         -del /f $(LIBDIR)\File\Glob.pm
1155         -del /f $(LIBDIR)\Storable.pm
1156         -del /f $(LIBDIR)\Sys\Hostname.pm
1157         -del /f $(LIBDIR)\Time\HiRes.pm
1158         -del /f $(LIBDIR)\Unicode\Normalize.pm
1159         -del /f $(LIBDIR)\Math\BigInt\FastCalc.pm
1160         -del /f $(LIBDIR)\Win32.pm
1161         -del /f $(LIBDIR)\Win32CORE.pm
1162         -del /f $(LIBDIR)\Win32API\File.pm
1163         -del /f $(LIBDIR)\Win32API\File\cFile.pc
1164         -del /f $(LIBDIR)\buildcustomize.pl
1165         -del /f $(DISTDIR)\XSLoader\XSLoader.pm
1166         -del /f *.def *.map
1167         -if exist $(LIBDIR)\App rmdir /s /q $(LIBDIR)\App
1168         -if exist $(LIBDIR)\Archive rmdir /s /q $(LIBDIR)\Archive
1169         -if exist $(LIBDIR)\Attribute rmdir /s /q $(LIBDIR)\Attribute
1170         -if exist $(LIBDIR)\autodie rmdir /s /q $(LIBDIR)\autodie
1171         -if exist $(LIBDIR)\Carp rmdir /s /q $(LIBDIR)\Carp
1172         -if exist $(LIBDIR)\Compress rmdir /s /q $(LIBDIR)\Compress
1173         -if exist $(LIBDIR)\Config\Perl rmdir /s /q $(LIBDIR)\Config\Perl
1174         -if exist $(LIBDIR)\CPAN rmdir /s /q $(LIBDIR)\CPAN
1175         -if exist $(LIBDIR)\Data rmdir /s /q $(LIBDIR)\Data
1176         -if exist $(LIBDIR)\Devel rmdir /s /q $(LIBDIR)\Devel
1177         -if exist $(LIBDIR)\Digest rmdir /s /q $(LIBDIR)\Digest
1178         -if exist $(LIBDIR)\Encode rmdir /s /q $(LIBDIR)\Encode
1179         -if exist $(LIBDIR)\encoding rmdir /s /q $(LIBDIR)\encoding
1180         -if exist $(LIBDIR)\Exporter rmdir /s /q $(LIBDIR)\Exporter
1181         -if exist $(LIBDIR)\ExtUtils\CBuilder rmdir /s /q $(LIBDIR)\ExtUtils\CBuilder
1182         -if exist $(LIBDIR)\ExtUtils\Command rmdir /s /q $(LIBDIR)\ExtUtils\Command
1183         -if exist $(LIBDIR)\ExtUtils\Constant rmdir /s /q $(LIBDIR)\ExtUtils\Constant
1184         -if exist $(LIBDIR)\ExtUtils\Liblist rmdir /s /q $(LIBDIR)\ExtUtils\Liblist
1185         -if exist $(LIBDIR)\ExtUtils\MakeMaker rmdir /s /q $(LIBDIR)\ExtUtils\MakeMaker
1186         -if exist $(LIBDIR)\ExtUtils\ParseXS rmdir /s /q $(LIBDIR)\ExtUtils\ParseXS
1187         -if exist $(LIBDIR)\ExtUtils\Typemaps rmdir /s /q $(LIBDIR)\ExtUtils\Typemaps
1188         -if exist $(LIBDIR)\File\Spec rmdir /s /q $(LIBDIR)\File\Spec
1189         -if exist $(LIBDIR)\Filter rmdir /s /q $(LIBDIR)\Filter
1190         -if exist $(LIBDIR)\Hash rmdir /s /q $(LIBDIR)\Hash
1191         -if exist $(LIBDIR)\HTTP rmdir /s /q $(LIBDIR)\HTTP
1192         -if exist $(LIBDIR)\I18N rmdir /s /q $(LIBDIR)\I18N
1193         -if exist $(LIBDIR)\IO rmdir /s /q $(LIBDIR)\IO
1194         -if exist $(LIBDIR)\IPC rmdir /s /q $(LIBDIR)\IPC
1195         -if exist $(LIBDIR)\JSON rmdir /s /q $(LIBDIR)\JSON
1196         -if exist $(LIBDIR)\List rmdir /s /q $(LIBDIR)\List
1197         -if exist $(LIBDIR)\Locale rmdir /s /q $(LIBDIR)\Locale
1198         -if exist $(LIBDIR)\Math rmdir /s /q $(LIBDIR)\Math
1199         -if exist $(LIBDIR)\Memoize rmdir /s /q $(LIBDIR)\Memoize
1200         -if exist $(LIBDIR)\MIME rmdir /s /q $(LIBDIR)\MIME
1201         -if exist $(LIBDIR)\Module rmdir /s /q $(LIBDIR)\Module
1202         -if exist $(LIBDIR)\Net\FTP rmdir /s /q $(LIBDIR)\Net\FTP
1203         -if exist $(LIBDIR)\Params rmdir /s /q $(LIBDIR)\Params
1204         -if exist $(LIBDIR)\Parse rmdir /s /q $(LIBDIR)\Parse
1205         -if exist $(LIBDIR)\Perl rmdir /s /q $(LIBDIR)\Perl
1206         -if exist $(LIBDIR)\PerlIO rmdir /s /q $(LIBDIR)\PerlIO
1207         -if exist $(LIBDIR)\Pod\Perldoc rmdir /s /q $(LIBDIR)\Pod\Perldoc
1208         -if exist $(LIBDIR)\Pod\Simple rmdir /s /q $(LIBDIR)\Pod\Simple
1209         -if exist $(LIBDIR)\Pod\Text rmdir /s /q $(LIBDIR)\Pod\Text
1210         -if exist $(LIBDIR)\Scalar rmdir /s /q $(LIBDIR)\Scalar
1211         -if exist $(LIBDIR)\Search rmdir /s /q $(LIBDIR)\Search
1212         -if exist $(LIBDIR)\Sub rmdir /s /q $(LIBDIR)\Sub
1213         -if exist $(LIBDIR)\Sys rmdir /s /q $(LIBDIR)\Sys
1214         -if exist $(LIBDIR)\TAP rmdir /s /q $(LIBDIR)\TAP
1215         -if exist $(LIBDIR)\Term rmdir /s /q $(LIBDIR)\Term
1216         -if exist $(LIBDIR)\Test rmdir /s /q $(LIBDIR)\Test
1217         -if exist $(LIBDIR)\Text rmdir /s /q $(LIBDIR)\Text
1218         -if exist $(LIBDIR)\Thread rmdir /s /q $(LIBDIR)\Thread
1219         -if exist $(LIBDIR)\threads rmdir /s /q $(LIBDIR)\threads
1220         -if exist $(LIBDIR)\Tie\Hash rmdir /s /q $(LIBDIR)\Tie\Hash
1221         -if exist $(LIBDIR)\Unicode\Collate rmdir /s /q $(LIBDIR)\Unicode\Collate
1222         -if exist $(LIBDIR)\Unicode\Collate\Locale rmdir /s /q $(LIBDIR)\Unicode\Collate\Locale
1223         -if exist $(LIBDIR)\version rmdir /s /q $(LIBDIR)\version
1224         -if exist $(LIBDIR)\VMS rmdir /s /q $(LIBDIR)\VMS
1225         -if exist $(LIBDIR)\Win32API rmdir /s /q $(LIBDIR)\Win32API
1226         -if exist $(LIBDIR)\XS rmdir /s /q $(LIBDIR)\XS
1227         -cd $(PODDIR) && del /f *.html *.bat roffitall \
1228             perl5234delta.pod perlaix.pod perlamiga.pod perlandroid.pod \
1229             perlapi.pod perlbs2000.pod perlce.pod perlcn.pod perlcygwin.pod \
1230             perldos.pod perlfreebsd.pod perlhaiku.pod perlhpux.pod \
1231             perlhurd.pod perlintern.pod perlirix.pod perljp.pod perlko.pod \
1232             perllinux.pod perlmacos.pod perlmacosx.pod perlmodlib.pod \
1233             perlnetware.pod perlopenbsd.pod perlos2.pod perlos390.pod \
1234             perlos400.pod perlplan9.pod perlqnx.pod perlriscos.pod \
1235             perlsolaris.pod perlsymbian.pod perlsynology.pod perltoc.pod \
1236             perltru64.pod perltw.pod perluniprops.pod perlvos.pod \
1237             perlwin32.pod
1238         -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph pstruct h2xs \
1239             perldoc perlivp libnetcfg enc2xs piconv cpan *.bat \
1240             xsubpp pod2html instmodsh json_pp prove ptar ptardiff ptargrep shasum corelist zipdetails
1241         -del /f ..\config.sh perlmain.c dlutils.c config.h.new \
1242             perlmainst.c
1243         -del /f $(CONFIGPM)
1244         -del /f ..\lib\Config_git.pl
1245         -del /f "bin\*.bat"
1246         -del /f perllibst.h
1247         -del /f $(PERLEXE_RES) perl.base
1248         -cd .. && del /s *$(a) *.map *.pdb *.ilk *.bs *$(o) .exists pm_to_blib ppport.h
1249         -cd $(EXTDIR) && del /s *.def Makefile Makefile.old
1250         -cd $(DISTDIR) && del /s *.def Makefile Makefile.old
1251         -cd $(CPANDIR) && del /s *.def Makefile Makefile.old
1252         -del /s ..\utils\Makefile
1253         -if exist $(AUTODIR) rmdir /s /q $(AUTODIR)
1254         -if exist $(COREDIR) rmdir /s /q $(COREDIR)
1255         -if exist pod2htmd.tmp del pod2htmd.tmp
1256         -if exist $(HTMLDIR) rmdir /s /q $(HTMLDIR)
1257         -del /f ..\t\test_state
1258
1259 install : all installbare installhtml
1260
1261 installbare : utils ..\pod\perltoc.pod
1262         $(PERLEXE) ..\installperl
1263         if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\$(NULL)
1264         if exist $(PERLEXESTATIC) $(XCOPY) $(PERLEXESTATIC) $(INST_BIN)\$(NULL)
1265         $(XCOPY) $(GLOBEXE) $(INST_BIN)\$(NULL)
1266         if exist ..\perl*.pdb $(XCOPY) ..\perl*.pdb $(INST_BIN)\$(NULL)
1267         $(XCOPY) "bin\*.bat" $(INST_SCRIPT)\$(NULL)
1268
1269 installhtml : doc
1270         $(RCOPY) $(HTMLDIR)\*.* $(INST_HTML)\$(NULL)
1271
1272 inst_lib : $(CONFIGPM)
1273         $(RCOPY) ..\lib $(INST_LIB)\$(NULL)
1274
1275 $(UNIDATAFILES) ..\pod\perluniprops.pod .UPDATEALL : $(MINIPERL) $(CONFIGPM) ..\lib\unicore\mktables Extensions_nonxs
1276         cd ..\lib\unicore && \
1277         ..\$(MINIPERL) -I.. -I..\..\dist\Cwd\lib -I..\..\dist\Cwd mktables -P ..\..\pod -maketest -makelist -p
1278
1279 minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) $(UNIDATAFILES) utils
1280         $(XCOPY) $(MINIPERL) ..\t\$(NULL)
1281         if exist ..\t\perl.exe del /f ..\t\perl.exe
1282         rename ..\t\miniperl.exe perl.exe
1283         $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1284         attrib -r "..\t\*.*"
1285         cd ..\t && \
1286         $(MINIPERL) -I..\lib harness base/*.t comp/*.t cmd/*.t io/*.t opbasic/*.t op/*.t pragma/*.t
1287
1288 test-prep : all utils ..\pod\perltoc.pod
1289         $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1290         $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1291         $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1292 # If building with gcc versions 4.x.x or greater, then
1293 # the GCC helper DLL will also need copied to the test directory.
1294 # The name of the dll can change, depending upon which vendor has supplied
1295 # your compiler, and upon the values of "x".
1296 # libstdc++-6.dll is copied if it exists as it, too, may then be needed.
1297 # Without this copying, the op/taint.t test script will fail.
1298         if exist $(CCDLLDIR)\libgcc_s_seh-1.dll $(XCOPY) $(CCDLLDIR)\libgcc_s_seh-1.dll ..\t\$(NULL)
1299         if exist $(CCDLLDIR)\libgcc_s_sjlj-1.dll $(XCOPY) $(CCDLLDIR)\libgcc_s_sjlj-1.dll ..\t\$(NULL)
1300         if exist $(CCDLLDIR)\libgcc_s_dw2-1.dll $(XCOPY) $(CCDLLDIR)\libgcc_s_dw2-1.dll ..\t\$(NULL)
1301         if exist $(CCDLLDIR)\libstdc++-6.dll $(XCOPY) $(CCDLLDIR)\libstdc++-6.dll ..\t\$(NULL)
1302         if exist $(CCDLLDIR)\libwinpthread-1.dll $(XCOPY) $(CCDLLDIR)\libwinpthread-1.dll ..\t\$(NULL)
1303
1304 test : test-prep
1305         set PERL_STATIC_EXT=$(STATIC_EXT) && \
1306             cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
1307
1308 test_porting : test-prep
1309         set PERL_STATIC_EXT=$(STATIC_EXT) && \
1310             cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) porting\*.t ..\lib\diagnostics.t
1311
1312 test-reonly : reonly utils
1313         $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1314         $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1315         $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1316         cd ..\t && \
1317         $(PERLEXE) -I..\lib harness $(OPT) -re \bpat\\/ $(EXTRA) && \
1318         cd ..\win32
1319
1320 regen :
1321         cd .. && regen.pl && cd win32
1322
1323 test-notty : test-prep
1324         set PERL_STATIC_EXT=$(STATIC_EXT) && \
1325             set PERL_SKIP_TTY_TEST=1 && \
1326             cd ..\t && $(PERLEXE) -I.\lib harness $(TEST_SWITCHES) $(TEST_FILES)
1327
1328 _test :
1329         $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1330         $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1331         $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1332         set PERL_STATIC_EXT=$(STATIC_EXT) && \
1333             cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
1334
1335 _clean :
1336         -@erase miniperlmain$(o)
1337         -@erase $(MINIPERL)
1338         -@erase perlglob$(o)
1339         -@erase perlmain$(o)
1340         -@erase perlmainst$(o)
1341         -@erase config.w32
1342         -@erase /f config.h
1343         -@erase /f ..\git_version.h
1344         -@erase $(GLOBEXE)
1345         -@erase $(PERLEXE)
1346         -@erase $(WPERLEXE)
1347         -@erase $(PERLEXESTATIC)
1348         -@erase $(PERLSTATICLIB)
1349         -@erase $(PERLDLL)
1350         -@erase $(CORE_OBJ)
1351         -@erase $(GENUUDMAP) $(GENUUDMAP_OBJ) $(GENERATED_HEADERS)
1352         -if exist $(MINIDIR) rmdir /s /q $(MINIDIR)
1353         -if exist $(UNIDATADIR1) rmdir /s /q $(UNIDATADIR1)
1354         -if exist $(UNIDATADIR2) rmdir /s /q $(UNIDATADIR2)
1355         -@erase $(UNIDATAFILES)
1356         -@erase $(WIN32_OBJ)
1357         -@erase $(DLL_OBJ)
1358         -@erase ..\*$(o) ..\*$(a) ..\*.exp *$(o) *$(a) *.exp *.res
1359         -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
1360         -@erase *.ilk
1361         -@erase *.pdb
1362         -@erase Extensions_static
1363
1364 clean : Extensions_clean _clean
1365
1366 realclean : Extensions_realclean _clean
1367
1368 # Handy way to run perlbug -ok without having to install and run the
1369 # installed perlbug. We don't re-run the tests here - we trust the user.
1370 # Please *don't* use this unless all tests pass.
1371 # If you want to report test failures, use "gmake nok" instead.
1372 ok: utils
1373         $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)"
1374
1375 okfile: utils
1376         $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)" -F perl.ok
1377
1378 nok: utils
1379         $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)"
1380
1381 nokfile: utils
1382         $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)" -F perl.nok