This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
New perldelta for 5.23.6
[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.5
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 #
761 # Copy the template config.h and set configurables at the end of it
762 # as per the options chosen and compiler used.
763 # Note: This config.h is only used to build miniperl.exe anyway, but
764 # it's as well to have its options correct to be sure that it builds
765 # and so that it's "-V" options are correct for use by makedef.pl. The
766 # real config.h used to build perl.exe is generated from the top-level
767 # config_h.SH by config_h.PL (run by miniperl.exe).
768 #
769 .\config.h : $(CFGH_TMPL) $(CORE_NOCFG_H)
770         -del /f config.h
771         copy $(CFGH_TMPL) config.h
772         @echo.>>$@
773         @echo #ifndef _config_h_footer_>>$@
774         @echo #define _config_h_footer_>>$@
775         @echo #undef Off_t>>$@
776         @echo #undef LSEEKSIZE>>$@
777         @echo #undef Off_t_size>>$@
778         @echo #undef PTRSIZE>>$@
779         @echo #undef SSize_t>>$@
780         @echo #undef HAS_ATOLL>>$@
781         @echo #undef HAS_STRTOLL>>$@
782         @echo #undef HAS_STRTOULL>>$@
783         @echo #undef Size_t_size>>$@
784         @echo #undef IVTYPE>>$@
785         @echo #undef UVTYPE>>$@
786         @echo #undef IVSIZE>>$@
787         @echo #undef UVSIZE>>$@
788         @echo #undef NV_PRESERVES_UV>>$@
789         @echo #undef NV_PRESERVES_UV_BITS>>$@
790         @echo #undef IVdf>>$@
791         @echo #undef UVuf>>$@
792         @echo #undef UVof>>$@
793         @echo #undef UVxf>>$@
794         @echo #undef UVXf>>$@
795         @echo #undef USE_64_BIT_INT>>$@
796         @echo #undef Gconvert>>$@
797         @echo #undef HAS_FREXPL>>$@
798         @echo #undef HAS_ISNANL>>$@
799         @echo #undef HAS_MODFL>>$@
800         @echo #undef HAS_MODFL_PROTO>>$@
801         @echo #undef HAS_SQRTL>>$@
802         @echo #undef HAS_STRTOLD>>$@
803         @echo #undef PERL_PRIfldbl>>$@
804         @echo #undef PERL_PRIgldbl>>$@
805         @echo #undef PERL_PRIeldbl>>$@
806         @echo #undef PERL_SCNfldbl>>$@
807         @echo #undef NVTYPE>>$@
808         @echo #undef NVSIZE>>$@
809         @echo #undef LONG_DOUBLESIZE>>$@
810         @echo #undef NV_OVERFLOWS_INTEGERS_AT>>$@
811         @echo #undef NVef>>$@
812         @echo #undef NVff>>$@
813         @echo #undef NVgf>>$@
814         @echo #undef USE_LONG_DOUBLE>>$@
815 ifeq ($(USE_LARGE_FILES),define)
816         @echo #define Off_t $(INT64)>>$@
817         @echo #define LSEEKSIZE ^8>>$@
818         @echo #define Off_t_size ^8>>$@
819 else
820         @echo #define Off_t long>>$@
821         @echo #define LSEEKSIZE ^4>>$@
822         @echo #define Off_t_size ^4>>$@
823 endif
824 ifeq ($(WIN64),define)
825         @echo #define PTRSIZE ^8>>$@
826         @echo #define SSize_t $(INT64)>>$@
827         @echo #define HAS_ATOLL>>$@
828         @echo #define HAS_STRTOLL>>$@
829         @echo #define HAS_STRTOULL>>$@
830         @echo #define Size_t_size ^8>>$@
831 else
832         @echo #define PTRSIZE ^4>>$@
833         @echo #define SSize_t int>>$@
834         @echo #undef HAS_ATOLL>>$@
835         @echo #undef HAS_STRTOLL>>$@
836         @echo #undef HAS_STRTOULL>>$@
837         @echo #define Size_t_size ^4>>$@
838 endif
839 ifeq ($(USE_64_BIT_INT),define)
840         @echo #define IVTYPE $(INT64)>>$@
841         @echo #define UVTYPE unsigned $(INT64)>>$@
842         @echo #define IVSIZE ^8>>$@
843         @echo #define UVSIZE ^8>>$@
844 ifeq ($(USE_LONG_DOUBLE),define)
845         @echo #define NV_PRESERVES_UV>>$@
846         @echo #define NV_PRESERVES_UV_BITS 64>>$@
847 else
848         @echo #undef NV_PRESERVES_UV>>$@
849         @echo #define NV_PRESERVES_UV_BITS 53>>$@
850 endif
851         @echo #define IVdf "I64d">>$@
852         @echo #define UVuf "I64u">>$@
853         @echo #define UVof "I64o">>$@
854         @echo #define UVxf "I64x">>$@
855         @echo #define UVXf "I64X">>$@
856         @echo #define USE_64_BIT_INT>>$@
857 else
858         @echo #define IVTYPE long>>$@
859         @echo #define UVTYPE unsigned long>>$@
860         @echo #define IVSIZE ^4>>$@
861         @echo #define UVSIZE ^4>>$@
862         @echo #define NV_PRESERVES_UV>>$@
863         @echo #define NV_PRESERVES_UV_BITS 32>>$@
864         @echo #define IVdf "ld">>$@
865         @echo #define UVuf "lu">>$@
866         @echo #define UVof "lo">>$@
867         @echo #define UVxf "lx">>$@
868         @echo #define UVXf "lX">>$@
869         @echo #undef USE_64_BIT_INT>>$@
870 endif
871 ifeq ($(USE_LONG_DOUBLE),define)
872         @echo #define Gconvert(x,n,t,b) sprintf((b),"%%.*""Lg",(n),(x))>>$@
873         @echo #define HAS_FREXPL>>$@
874         @echo #define HAS_ISNANL>>$@
875         @echo #define HAS_MODFL>>$@
876         @echo #define HAS_MODFL_PROTO>>$@
877         @echo #define HAS_SQRTL>>$@
878         @echo #define HAS_STRTOLD>>$@
879         @echo #define PERL_PRIfldbl "Lf">>$@
880         @echo #define PERL_PRIgldbl "Lg">>$@
881         @echo #define PERL_PRIeldbl "Le">>$@
882         @echo #define PERL_SCNfldbl "Lf">>$@
883         @echo #define NVTYPE long double>>$@
884 ifeq ($(WIN64),define)
885         @echo #define NVSIZE ^16>>$@
886         @echo #define LONG_DOUBLESIZE ^16>>$@
887 else
888         @echo #define NVSIZE ^12>>$@
889         @echo #define LONG_DOUBLESIZE ^12>>$@
890 endif
891         @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>>$@
892         @echo #define NVef "Le">>$@
893         @echo #define NVff "Lf">>$@
894         @echo #define NVgf "Lg">>$@
895         @echo #define USE_LONG_DOUBLE>>$@
896 else
897         @echo #define Gconvert(x,n,t,b) sprintf((b),"%%.*g",(n),(x))>>$@
898         @echo #undef HAS_FREXPL>>$@
899         @echo #undef HAS_ISNANL>>$@
900         @echo #undef HAS_MODFL>>$@
901         @echo #undef HAS_MODFL_PROTO>>$@
902         @echo #undef HAS_SQRTL>>$@
903         @echo #undef HAS_STRTOLD>>$@
904         @echo #undef PERL_PRIfldbl>>$@
905         @echo #undef PERL_PRIgldbl>>$@
906         @echo #undef PERL_PRIeldbl>>$@
907         @echo #undef PERL_SCNfldbl>>$@
908         @echo #define NVTYPE double>>$@
909         @echo #define NVSIZE ^8>>$@
910         @echo #define LONG_DOUBLESIZE ^8>>$@
911         @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>>$@
912         @echo #define NVef "e">>$@
913         @echo #define NVff "f">>$@
914         @echo #define NVgf "g">>$@
915         @echo #undef USE_LONG_DOUBLE>>$@
916 endif
917         @echo #endif>>$@
918
919 ..\git_version.h : $(MINIPERL) ..\make_patchnum.pl
920         cd .. && miniperl -Ilib make_patchnum.pl
921
922 # make sure that we recompile perl.c if the git version changes
923 ..\perl$(o) : ..\git_version.h
924
925 ..\config.sh : $(CFGSH_TMPL) config_sh.PL FindExt.pm $(MINIPERL)
926         $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) $(CFGSH_TMPL) > ..\config.sh
927
928 # This target is for when changes to the main config.sh happen.
929 # Edit config.gc, then make perl using GCC in a minimal configuration (i.e.
930 # with MULTI, ITHREADS, IMP_SYS, LARGE_FILES and PERLIO off), then make
931 # this target to regenerate config_H.gc.
932 regen_config_h:
933         $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS)) $(CFGSH_TMPL) > ..\config.sh
934         $(MINIPERL) -I..\lib ..\configpm --chdir=..
935         -del /f $(CFGH_TMPL)
936         -$(MINIPERL) -I..\lib config_h.PL "ARCHPREFIX=$(ARCHPREFIX)"
937         rename config.h $(CFGH_TMPL)
938
939 $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL
940         $(MINIPERL) -I..\lib ..\configpm --chdir=..
941         if exist lib\* $(RCOPY) "lib\*.*" ..\lib\$(NULL)
942         $(XCOPY) "..\*.h" $(COREDIR)\$(NULL)
943         $(XCOPY) "*.h" $(COREDIR)\$(NULL)
944         $(RCOPY) include $(COREDIR)\$(NULL)
945         $(MINIPERL) -I..\lib config_h.PL "ARCHPREFIX=$(ARCHPREFIX)" \
946             || $(MAKE) $(MAKEMACROS) $(CONFIGPM) $(MAKEFILE)
947
948 # See the comment in Makefile.SH explaining this seemingly cranky ordering
949 $(MINIPERL) : ..\lib\buildcustomize.pl
950
951 ..\lib\buildcustomize.pl : $(MINIDIR) $(MINI_OBJ) $(CRTIPMLIBS) ..\write_buildcustomize.pl
952         $(LINK32) -mconsole -o $(MINIPERL) $(BLINK_FLAGS) $(MINI_OBJ) $(LIBFILES)
953         $(MINIPERL) -I..\lib -f ..\write_buildcustomize.pl ..
954
955 $(MINIDIR) :
956         if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
957
958 $(MINICORE_OBJ) : $(CORE_NOCFG_H)
959         $(CC) -c $(CFLAGS) $(MINIBUILDOPT) -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL $(OBJOUT_FLAG)$@ ..\$(*F).c
960
961 $(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
962         $(CC) -c $(CFLAGS) $(MINIBUILDOPT) -DPERL_IS_MINIPERL $(OBJOUT_FLAG)$@ $(*F).c
963
964 # -DPERL_IMPLICIT_SYS needs C++ for perllib.c
965 # rules wrapped in .IFs break Win9X build (we end up with unbalanced []s unless
966 # unless the .IF is true), so instead we use a else with the default.
967 # This is the only file that depends on perlhost.h, vmem.h, and vdir.h
968
969 perllib$(o)     : perllib.c .\perlhost.h .\vdir.h .\vmem.h
970 ifeq ($(USE_IMP_SYS),define)
971         $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
972 else
973         $(CC) -c -I. $(CFLAGS_O) $(OBJOUT_FLAG)$@ perllib.c
974 endif
975
976 # 1. we don't want to rebuild miniperl.exe when config.h changes
977 # 2. we don't want to rebuild miniperl.exe with non-default config.h
978 # 3. we can't have miniperl.exe depend on git_version.h, as miniperl creates it
979 $(MINI_OBJ)     : $(CORE_NOCFG_H)
980
981 $(WIN32_OBJ)    : $(CORE_H)
982
983 $(CORE_OBJ)     : $(CORE_H)
984
985 $(DLL_OBJ)      : $(CORE_H)
986
987 perldll.def : $(MINIPERL) $(CONFIGPM) ..\embed.fnc ..\makedef.pl create_perllibst_h.pl
988         $(MINIPERL) -I..\lib create_perllibst_h.pl
989         $(MINIPERL) -I..\lib -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) \
990         $(BUILDOPT) CCTYPE=GCC TARG_DIR=..\ > perldll.def
991
992 $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES) Extensions_static
993         $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(BLINK_FLAGS) \
994            $(PERLDLL_OBJ) $(shell type Extensions_static) $(LIBFILES)
995         $(IMPLIB) --output-lib $(PERLIMPLIB) \
996                 --dllname $(PERLDLL) \
997                 --def perldll.def \
998                 --base-file perl.base \
999                 --output-exp perl.exp
1000         $(LINK32) -mdll -o $@ $(BLINK_FLAGS) \
1001             $(PERLDLL_OBJ) $(shell type Extensions_static) $(LIBFILES) perl.exp
1002         $(XCOPY) $(PERLIMPLIB) $(COREDIR)
1003
1004 $(PERLSTATICLIB): $(PERLDLL_OBJ) Extensions_static
1005         $(LIB32) $(LIB_FLAGS) $@ $(PERLDLL_OBJ)
1006         if exist $(STATICDIR) rmdir /s /q $(STATICDIR)
1007         for %%i in ($(shell type Extensions_static)) do \
1008                 @mkdir $(STATICDIR) && cd $(STATICDIR) && \
1009                 $(ARCHPREFIX)ar x ..\%%i && \
1010                 $(ARCHPREFIX)ar q ..\$@ *$(o) && \
1011                 cd .. && rmdir /s /q $(STATICDIR)
1012         $(XCOPY) $(PERLSTATICLIB) $(COREDIR)
1013
1014 $(PERLEXE_RES): perlexe.rc $(PERLEXE_MANIFEST) $(PERLEXE_ICO)
1015
1016 $(MINIDIR)\globals$(o) : $(GENERATED_HEADERS)
1017
1018 $(UUDMAP_H) $(MG_DATA_H) : $(BITCOUNT_H)
1019
1020 $(BITCOUNT_H) : $(GENUUDMAP)
1021         $(GENUUDMAP) $(GENERATED_HEADERS)
1022
1023 $(GENUUDMAP_OBJ) : ..\mg_raw.h
1024
1025 $(GENUUDMAP) : $(GENUUDMAP_OBJ)
1026         $(LINK32) -o $@ $(BLINK_FLAGS) $(GENUUDMAP_OBJ) $(LIBFILES)
1027
1028 perlmain.c : runperl.c
1029         copy runperl.c perlmain.c
1030
1031 perlmain$(o) : perlmain.c
1032         $(CC) $(subst -DPERLDLL,-UPERLDLL,$(CFLAGS_O)) $(OBJOUT_FLAG)$@ -c perlmain.c
1033
1034 perlmainst.c : runperl.c
1035         copy runperl.c perlmainst.c
1036
1037 perlmainst$(o) : perlmainst.c
1038         $(CC) $(CFLAGS_O) $(OBJOUT_FLAG)$@ -c perlmainst.c
1039
1040 $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES)
1041         $(LINK32) -mconsole -o $@ $(BLINK_FLAGS)  \
1042             $(PERLEXE_OBJ) $(PERLEXE_RES) $(PERLIMPLIB) $(LIBFILES)
1043         copy $(PERLEXE) $(WPERLEXE)
1044         $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS
1045
1046 $(PERLEXESTATIC): $(PERLSTATICLIB) $(CONFIGPM) $(PERLEXEST_OBJ) $(PERLEXE_RES)
1047         $(LINK32) -mconsole -o $@ $(BLINK_FLAGS) \
1048             $(PERLEXEST_OBJ) $(PERLEXE_RES) $(PERLSTATICLIB) $(LIBFILES)
1049
1050 MakePPPort: $(MINIPERL) $(CONFIGPM) Extensions_nonxs
1051         $(MINIPERL) -I..\lib ..\mkppport
1052
1053 #-------------------------------------------------------------------------------
1054 # There's no direct way to mark a dependency on
1055 # DynaLoader.pm, so this will have to do
1056 Extensions : ..\make_ext.pl ..\lib\buildcustomize.pl $(PERLDEP) $(CONFIGPM) $(DYNALOADER)
1057         $(XCOPY) "..\*.h" $(COREDIR)\$(NULL)
1058         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic
1059
1060 Extensions_reonly : ..\make_ext.pl ..\lib\buildcustomize.pl $(PERLDEP) $(CONFIGPM) $(DYNALOADER)
1061         $(XCOPY) "..\*.h" $(COREDIR)\$(NULL)
1062         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +re
1063
1064 Extensions_static : ..\make_ext.pl ..\lib\buildcustomize.pl list_static_libs.pl $(PERLDEP) $(CONFIGPM) Extensions_nonxs
1065         $(XCOPY) "..\*.h" $(COREDIR)\$(NULL)
1066         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static
1067         $(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static
1068
1069 Extensions_nonxs : ..\make_ext.pl ..\lib\buildcustomize.pl $(PERLDEP) $(CONFIGPM) ..\pod\perlfunc.pod
1070         $(XCOPY) "..\*.h" $(COREDIR)\$(NULL)
1071         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --nonxs
1072
1073 $(DYNALOADER) : ..\make_ext.pl ..\lib\buildcustomize.pl $(PERLDEP) $(CONFIGPM) Extensions_nonxs
1074         $(XCOPY) "..\*.h" $(COREDIR)\$(NULL)
1075         $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(EXTDIR) --dynaloader
1076
1077 Extensions_clean :
1078         -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=clean
1079
1080 Extensions_realclean :
1081         -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=realclean
1082
1083 #-------------------------------------------------------------------------------
1084
1085 doc: $(PERLEXE) ..\pod\perltoc.pod
1086         $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=$(HTMLDIR) \
1087             --podpath=pod:lib:utils --htmlroot="file://$(subst :,|,$(INST_HTML))"\
1088             --recurse
1089
1090 ..\utils\Makefile: $(CONFIGPM) ..\utils\Makefile.PL
1091         $(MINIPERL) -I..\lib ..\utils\Makefile.PL ..
1092
1093 # Note that this next section is parsed (and regenerated) by pod/buildtoc
1094 # so please check that script before making structural changes here
1095 utils: $(PERLEXE) ..\utils\Makefile
1096         cd ..\utils && $(MAKE) PERL=$(MINIPERL)
1097         copy ..\README.aix      ..\pod\perlaix.pod
1098         copy ..\README.amiga    ..\pod\perlamiga.pod
1099         copy ..\README.android  ..\pod\perlandroid.pod
1100         copy ..\README.bs2000   ..\pod\perlbs2000.pod
1101         copy ..\README.ce       ..\pod\perlce.pod
1102         copy ..\README.cn       ..\pod\perlcn.pod
1103         copy ..\README.cygwin   ..\pod\perlcygwin.pod
1104         copy ..\README.dos      ..\pod\perldos.pod
1105         copy ..\README.freebsd  ..\pod\perlfreebsd.pod
1106         copy ..\README.haiku    ..\pod\perlhaiku.pod
1107         copy ..\README.hpux     ..\pod\perlhpux.pod
1108         copy ..\README.hurd     ..\pod\perlhurd.pod
1109         copy ..\README.irix     ..\pod\perlirix.pod
1110         copy ..\README.jp       ..\pod\perljp.pod
1111         copy ..\README.ko       ..\pod\perlko.pod
1112         copy ..\README.linux    ..\pod\perllinux.pod
1113         copy ..\README.macos    ..\pod\perlmacos.pod
1114         copy ..\README.macosx   ..\pod\perlmacosx.pod
1115         copy ..\README.netware  ..\pod\perlnetware.pod
1116         copy ..\README.openbsd  ..\pod\perlopenbsd.pod
1117         copy ..\README.os2      ..\pod\perlos2.pod
1118         copy ..\README.os390    ..\pod\perlos390.pod
1119         copy ..\README.os400    ..\pod\perlos400.pod
1120         copy ..\README.plan9    ..\pod\perlplan9.pod
1121         copy ..\README.qnx      ..\pod\perlqnx.pod
1122         copy ..\README.riscos   ..\pod\perlriscos.pod
1123         copy ..\README.solaris  ..\pod\perlsolaris.pod
1124         copy ..\README.symbian  ..\pod\perlsymbian.pod
1125         copy ..\README.synology ..\pod\perlsynology.pod
1126         copy ..\README.tru64    ..\pod\perltru64.pod
1127         copy ..\README.tw       ..\pod\perltw.pod
1128         copy ..\README.vos      ..\pod\perlvos.pod
1129         copy ..\README.win32    ..\pod\perlwin32.pod
1130         copy ..\pod\perldelta.pod ..\pod\perl5236delta.pod
1131         $(PERLEXE) $(PL2BAT) $(UTILS)
1132         $(MINIPERL) -I..\lib ..\autodoc.pl ..
1133         $(MINIPERL) -I..\lib ..\pod\perlmodlib.PL -q ..
1134
1135 ..\pod\perltoc.pod: $(PERLEXE) Extensions Extensions_nonxs
1136         $(PERLEXE) -f ..\pod\buildtoc -q
1137
1138 # Note that the pod cleanup in this next section is parsed (and regenerated
1139 # by pod/buildtoc so please check that script before making changes here
1140
1141 distclean: realclean
1142         -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \
1143                 $(PERLIMPLIB) ..\miniperl$(a) $(PERLEXESTATIC) $(PERLSTATICLIB)
1144         -del /f $(LIBDIR)\Encode.pm $(LIBDIR)\encoding.pm $(LIBDIR)\Errno.pm
1145         -del /f $(LIBDIR)\Config.pod $(LIBDIR)\POSIX.pod $(LIBDIR)\threads.pm
1146         -del /f $(LIBDIR)\.exists $(LIBDIR)\attributes.pm $(LIBDIR)\DynaLoader.pm
1147         -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
1148         -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm
1149         -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
1150         -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
1151         -del /f $(LIBDIR)\File\Glob.pm
1152         -del /f $(LIBDIR)\Storable.pm
1153         -del /f $(LIBDIR)\Sys\Hostname.pm
1154         -del /f $(LIBDIR)\Time\HiRes.pm
1155         -del /f $(LIBDIR)\Unicode\Normalize.pm
1156         -del /f $(LIBDIR)\Math\BigInt\FastCalc.pm
1157         -del /f $(LIBDIR)\Win32.pm
1158         -del /f $(LIBDIR)\Win32CORE.pm
1159         -del /f $(LIBDIR)\Win32API\File.pm
1160         -del /f $(LIBDIR)\Win32API\File\cFile.pc
1161         -del /f $(LIBDIR)\buildcustomize.pl
1162         -del /f $(DISTDIR)\XSLoader\XSLoader.pm
1163         -del /f *.def *.map
1164         -if exist $(LIBDIR)\App rmdir /s /q $(LIBDIR)\App
1165         -if exist $(LIBDIR)\Archive rmdir /s /q $(LIBDIR)\Archive
1166         -if exist $(LIBDIR)\Attribute rmdir /s /q $(LIBDIR)\Attribute
1167         -if exist $(LIBDIR)\autodie rmdir /s /q $(LIBDIR)\autodie
1168         -if exist $(LIBDIR)\Carp rmdir /s /q $(LIBDIR)\Carp
1169         -if exist $(LIBDIR)\Compress rmdir /s /q $(LIBDIR)\Compress
1170         -if exist $(LIBDIR)\Config\Perl rmdir /s /q $(LIBDIR)\Config\Perl
1171         -if exist $(LIBDIR)\CPAN rmdir /s /q $(LIBDIR)\CPAN
1172         -if exist $(LIBDIR)\Data rmdir /s /q $(LIBDIR)\Data
1173         -if exist $(LIBDIR)\Devel rmdir /s /q $(LIBDIR)\Devel
1174         -if exist $(LIBDIR)\Digest rmdir /s /q $(LIBDIR)\Digest
1175         -if exist $(LIBDIR)\Encode rmdir /s /q $(LIBDIR)\Encode
1176         -if exist $(LIBDIR)\encoding rmdir /s /q $(LIBDIR)\encoding
1177         -if exist $(LIBDIR)\Exporter rmdir /s /q $(LIBDIR)\Exporter
1178         -if exist $(LIBDIR)\ExtUtils\CBuilder rmdir /s /q $(LIBDIR)\ExtUtils\CBuilder
1179         -if exist $(LIBDIR)\ExtUtils\Command rmdir /s /q $(LIBDIR)\ExtUtils\Command
1180         -if exist $(LIBDIR)\ExtUtils\Constant rmdir /s /q $(LIBDIR)\ExtUtils\Constant
1181         -if exist $(LIBDIR)\ExtUtils\Liblist rmdir /s /q $(LIBDIR)\ExtUtils\Liblist
1182         -if exist $(LIBDIR)\ExtUtils\MakeMaker rmdir /s /q $(LIBDIR)\ExtUtils\MakeMaker
1183         -if exist $(LIBDIR)\ExtUtils\ParseXS rmdir /s /q $(LIBDIR)\ExtUtils\ParseXS
1184         -if exist $(LIBDIR)\ExtUtils\Typemaps rmdir /s /q $(LIBDIR)\ExtUtils\Typemaps
1185         -if exist $(LIBDIR)\File\Spec rmdir /s /q $(LIBDIR)\File\Spec
1186         -if exist $(LIBDIR)\Filter rmdir /s /q $(LIBDIR)\Filter
1187         -if exist $(LIBDIR)\Hash rmdir /s /q $(LIBDIR)\Hash
1188         -if exist $(LIBDIR)\HTTP rmdir /s /q $(LIBDIR)\HTTP
1189         -if exist $(LIBDIR)\I18N rmdir /s /q $(LIBDIR)\I18N
1190         -if exist $(LIBDIR)\IO rmdir /s /q $(LIBDIR)\IO
1191         -if exist $(LIBDIR)\IPC rmdir /s /q $(LIBDIR)\IPC
1192         -if exist $(LIBDIR)\JSON rmdir /s /q $(LIBDIR)\JSON
1193         -if exist $(LIBDIR)\List rmdir /s /q $(LIBDIR)\List
1194         -if exist $(LIBDIR)\Locale rmdir /s /q $(LIBDIR)\Locale
1195         -if exist $(LIBDIR)\Math rmdir /s /q $(LIBDIR)\Math
1196         -if exist $(LIBDIR)\Memoize rmdir /s /q $(LIBDIR)\Memoize
1197         -if exist $(LIBDIR)\MIME rmdir /s /q $(LIBDIR)\MIME
1198         -if exist $(LIBDIR)\Module rmdir /s /q $(LIBDIR)\Module
1199         -if exist $(LIBDIR)\Net\FTP rmdir /s /q $(LIBDIR)\Net\FTP
1200         -if exist $(LIBDIR)\Params rmdir /s /q $(LIBDIR)\Params
1201         -if exist $(LIBDIR)\Parse rmdir /s /q $(LIBDIR)\Parse
1202         -if exist $(LIBDIR)\Perl rmdir /s /q $(LIBDIR)\Perl
1203         -if exist $(LIBDIR)\PerlIO rmdir /s /q $(LIBDIR)\PerlIO
1204         -if exist $(LIBDIR)\Pod\Perldoc rmdir /s /q $(LIBDIR)\Pod\Perldoc
1205         -if exist $(LIBDIR)\Pod\Simple rmdir /s /q $(LIBDIR)\Pod\Simple
1206         -if exist $(LIBDIR)\Pod\Text rmdir /s /q $(LIBDIR)\Pod\Text
1207         -if exist $(LIBDIR)\Scalar rmdir /s /q $(LIBDIR)\Scalar
1208         -if exist $(LIBDIR)\Search rmdir /s /q $(LIBDIR)\Search
1209         -if exist $(LIBDIR)\Sub rmdir /s /q $(LIBDIR)\Sub
1210         -if exist $(LIBDIR)\Sys rmdir /s /q $(LIBDIR)\Sys
1211         -if exist $(LIBDIR)\TAP rmdir /s /q $(LIBDIR)\TAP
1212         -if exist $(LIBDIR)\Term rmdir /s /q $(LIBDIR)\Term
1213         -if exist $(LIBDIR)\Test rmdir /s /q $(LIBDIR)\Test
1214         -if exist $(LIBDIR)\Text rmdir /s /q $(LIBDIR)\Text
1215         -if exist $(LIBDIR)\Thread rmdir /s /q $(LIBDIR)\Thread
1216         -if exist $(LIBDIR)\threads rmdir /s /q $(LIBDIR)\threads
1217         -if exist $(LIBDIR)\Tie\Hash rmdir /s /q $(LIBDIR)\Tie\Hash
1218         -if exist $(LIBDIR)\Unicode\Collate rmdir /s /q $(LIBDIR)\Unicode\Collate
1219         -if exist $(LIBDIR)\Unicode\Collate\Locale rmdir /s /q $(LIBDIR)\Unicode\Collate\Locale
1220         -if exist $(LIBDIR)\version rmdir /s /q $(LIBDIR)\version
1221         -if exist $(LIBDIR)\VMS rmdir /s /q $(LIBDIR)\VMS
1222         -if exist $(LIBDIR)\Win32API rmdir /s /q $(LIBDIR)\Win32API
1223         -if exist $(LIBDIR)\XS rmdir /s /q $(LIBDIR)\XS
1224         -cd $(PODDIR) && del /f *.html *.bat roffitall \
1225             perl5236delta.pod perlaix.pod perlamiga.pod perlandroid.pod \
1226             perlapi.pod perlbs2000.pod perlce.pod perlcn.pod perlcygwin.pod \
1227             perldos.pod perlfreebsd.pod perlhaiku.pod perlhpux.pod \
1228             perlhurd.pod perlintern.pod perlirix.pod perljp.pod perlko.pod \
1229             perllinux.pod perlmacos.pod perlmacosx.pod perlmodlib.pod \
1230             perlnetware.pod perlopenbsd.pod perlos2.pod perlos390.pod \
1231             perlos400.pod perlplan9.pod perlqnx.pod perlriscos.pod \
1232             perlsolaris.pod perlsymbian.pod perlsynology.pod perltoc.pod \
1233             perltru64.pod perltw.pod perluniprops.pod perlvos.pod \
1234             perlwin32.pod
1235         -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph pstruct h2xs \
1236             perldoc perlivp libnetcfg enc2xs piconv cpan *.bat \
1237             xsubpp pod2html instmodsh json_pp prove ptar ptardiff ptargrep shasum corelist zipdetails
1238         -del /f ..\config.sh perlmain.c dlutils.c config.h.new \
1239             perlmainst.c
1240         -del /f $(CONFIGPM)
1241         -del /f ..\lib\Config_git.pl
1242         -del /f "bin\*.bat"
1243         -del /f perllibst.h
1244         -del /f $(PERLEXE_RES) perl.base
1245         -cd .. && del /s *$(a) *.map *.pdb *.ilk *.bs *$(o) .exists pm_to_blib ppport.h
1246         -cd $(EXTDIR) && del /s *.def Makefile Makefile.old
1247         -cd $(DISTDIR) && del /s *.def Makefile Makefile.old
1248         -cd $(CPANDIR) && del /s *.def Makefile Makefile.old
1249         -del /s ..\utils\Makefile
1250         -if exist $(AUTODIR) rmdir /s /q $(AUTODIR)
1251         -if exist $(COREDIR) rmdir /s /q $(COREDIR)
1252         -if exist pod2htmd.tmp del pod2htmd.tmp
1253         -if exist $(HTMLDIR) rmdir /s /q $(HTMLDIR)
1254         -del /f ..\t\test_state
1255
1256 install : all installbare installhtml
1257
1258 installbare : utils ..\pod\perltoc.pod
1259         $(PERLEXE) ..\installperl
1260         if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\$(NULL)
1261         if exist $(PERLEXESTATIC) $(XCOPY) $(PERLEXESTATIC) $(INST_BIN)\$(NULL)
1262         $(XCOPY) $(GLOBEXE) $(INST_BIN)\$(NULL)
1263         if exist ..\perl*.pdb $(XCOPY) ..\perl*.pdb $(INST_BIN)\$(NULL)
1264         $(XCOPY) "bin\*.bat" $(INST_SCRIPT)\$(NULL)
1265
1266 installhtml : doc
1267         $(RCOPY) $(HTMLDIR)\*.* $(INST_HTML)\$(NULL)
1268
1269 inst_lib : $(CONFIGPM)
1270         $(RCOPY) ..\lib $(INST_LIB)\$(NULL)
1271
1272 $(UNIDATAFILES) ..\pod\perluniprops.pod .UPDATEALL : $(MINIPERL) $(CONFIGPM) ..\lib\unicore\mktables Extensions_nonxs
1273         cd ..\lib\unicore && \
1274         ..\$(MINIPERL) -I.. -I..\..\dist\Cwd\lib -I..\..\dist\Cwd mktables -P ..\..\pod -maketest -makelist -p
1275
1276 minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) $(UNIDATAFILES) utils
1277         $(XCOPY) $(MINIPERL) ..\t\$(NULL)
1278         if exist ..\t\perl.exe del /f ..\t\perl.exe
1279         rename ..\t\miniperl.exe perl.exe
1280         $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1281         attrib -r "..\t\*.*"
1282         cd ..\t && \
1283         $(MINIPERL) -I..\lib harness base/*.t comp/*.t cmd/*.t io/*.t opbasic/*.t op/*.t pragma/*.t
1284
1285 test-prep : all utils ..\pod\perltoc.pod
1286         $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1287         $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1288         $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1289 # If building with gcc versions 4.x.x or greater, then
1290 # the GCC helper DLL will also need copied to the test directory.
1291 # The name of the dll can change, depending upon which vendor has supplied
1292 # your compiler, and upon the values of "x".
1293 # libstdc++-6.dll is copied if it exists as it, too, may then be needed.
1294 # Without this copying, the op/taint.t test script will fail.
1295         if exist $(CCDLLDIR)\libgcc_s_seh-1.dll $(XCOPY) $(CCDLLDIR)\libgcc_s_seh-1.dll ..\t\$(NULL)
1296         if exist $(CCDLLDIR)\libgcc_s_sjlj-1.dll $(XCOPY) $(CCDLLDIR)\libgcc_s_sjlj-1.dll ..\t\$(NULL)
1297         if exist $(CCDLLDIR)\libgcc_s_dw2-1.dll $(XCOPY) $(CCDLLDIR)\libgcc_s_dw2-1.dll ..\t\$(NULL)
1298         if exist $(CCDLLDIR)\libstdc++-6.dll $(XCOPY) $(CCDLLDIR)\libstdc++-6.dll ..\t\$(NULL)
1299         if exist $(CCDLLDIR)\libwinpthread-1.dll $(XCOPY) $(CCDLLDIR)\libwinpthread-1.dll ..\t\$(NULL)
1300
1301 test : test-prep
1302         set PERL_STATIC_EXT=$(STATIC_EXT) && \
1303             cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
1304
1305 test_porting : test-prep
1306         set PERL_STATIC_EXT=$(STATIC_EXT) && \
1307             cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) porting\*.t ..\lib\diagnostics.t
1308
1309 test-reonly : reonly utils
1310         $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1311         $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1312         $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1313         cd ..\t && \
1314         $(PERLEXE) -I..\lib harness $(OPT) -re \bpat\\/ $(EXTRA) && \
1315         cd ..\win32
1316
1317 regen :
1318         cd .. && regen.pl && cd win32
1319
1320 test-notty : test-prep
1321         set PERL_STATIC_EXT=$(STATIC_EXT) && \
1322             set PERL_SKIP_TTY_TEST=1 && \
1323             cd ..\t && $(PERLEXE) -I.\lib harness $(TEST_SWITCHES) $(TEST_FILES)
1324
1325 _test :
1326         $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1327         $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1328         $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1329         set PERL_STATIC_EXT=$(STATIC_EXT) && \
1330             cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
1331
1332 _clean :
1333         -@erase miniperlmain$(o)
1334         -@erase $(MINIPERL)
1335         -@erase perlglob$(o)
1336         -@erase perlmain$(o)
1337         -@erase perlmainst$(o)
1338         -@erase /f config.h
1339         -@erase /f ..\git_version.h
1340         -@erase $(GLOBEXE)
1341         -@erase $(PERLEXE)
1342         -@erase $(WPERLEXE)
1343         -@erase $(PERLEXESTATIC)
1344         -@erase $(PERLSTATICLIB)
1345         -@erase $(PERLDLL)
1346         -@erase $(CORE_OBJ)
1347         -@erase $(GENUUDMAP) $(GENUUDMAP_OBJ) $(GENERATED_HEADERS)
1348         -if exist $(MINIDIR) rmdir /s /q $(MINIDIR)
1349         -if exist $(UNIDATADIR1) rmdir /s /q $(UNIDATADIR1)
1350         -if exist $(UNIDATADIR2) rmdir /s /q $(UNIDATADIR2)
1351         -@erase $(UNIDATAFILES)
1352         -@erase $(WIN32_OBJ)
1353         -@erase $(DLL_OBJ)
1354         -@erase ..\*$(o) ..\*$(a) ..\*.exp *$(o) *$(a) *.exp *.res
1355         -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
1356         -@erase *.ilk
1357         -@erase *.pdb
1358         -@erase Extensions_static
1359
1360 clean : Extensions_clean _clean
1361
1362 realclean : Extensions_realclean _clean
1363
1364 # Handy way to run perlbug -ok without having to install and run the
1365 # installed perlbug. We don't re-run the tests here - we trust the user.
1366 # Please *don't* use this unless all tests pass.
1367 # If you want to report test failures, use "gmake nok" instead.
1368 ok: utils
1369         $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)"
1370
1371 okfile: utils
1372         $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)" -F perl.ok
1373
1374 nok: utils
1375         $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)"
1376
1377 nokfile: utils
1378         $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)" -F perl.nok