This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
change#3612 was buggy and failed to build Tk; applied Ilya's
[perl5.git] / win32 / makefile.mk
CommitLineData
08aa1457 1#
e7083a8c 2# Makefile to build perl on Windows NT using DMAKE.
d56e6723
GS
3# Supported compilers:
4# Visual C++ 2.0 thro 5.0
5# Borland C++ 5.02
a29d2910 6# Mingw32 with gcc-2.8.1 or egcs-1.0.2 **experimental**
08aa1457
PP
7#
8# This is set up to build a perl.exe that runs off a shared library
9# (perl.dll). Also makes individual DLLs for the XS extensions.
10#
11
e7083a8c 12##
69e1fe5e
GS
13## Make sure you read README.win32 *before* you mess with anything here!
14##
15
16##
e7083a8c
DL
17## Build configuration. Edit the values below to suit your needs.
18##
19
08aa1457
PP
20#
21# Set these to wherever you want "nmake install" to put your
22# newly built perl.
e7083a8c 23#
d56e6723 24INST_DRV *= c:
e5a95ffb
GS
25INST_TOP *= $(INST_DRV)\perl
26
e7083a8c 27#
e5a95ffb
GS
28# Comment this out if you DON'T want your perl installation to be versioned.
29# This means that the new installation will overwrite any files from the
30# old installation at the same INST_TOP location. Leaving it enabled is
31# the safest route, as perl adds the extra version directory to all the
32# locations it installs files to. If you disable it, an alternative
33# versioned installation can be obtained by setting INST_TOP above to a
34# path that includes an arbitrary version string.
e7083a8c 35#
ba7a42cf 36INST_VER *= \5.00557
d56e6723
GS
37
38#
0cb96387
GS
39# Comment this out if you DON'T want your perl installation to have
40# architecture specific components. This means that architecture-
41# specific files will be installed along with the architecture-neutral
42# files. Leaving it enabled is safer and more flexible, in case you
43# want to build multiple flavors of perl and install them together in
44# the same location. Commenting it out gives you a simpler
45# installation that is easier to understand for beginners.
46#
47INST_ARCH *= \$(ARCHNAME)
48
49#
d07c2202 50# uncomment to enable threads-capabilities
e7083a8c 51#
07ba5892 52#USE_THREADS *= define
08aa1457
PP
53
54#
b86a2fa7
GS
55# uncomment to enable multiple interpreters
56#
57#USE_MULTI *= define
58
59#
7fac1903
GS
60# uncomment exactly one of the following
61#
62# Visual C++ 2.x
d56e6723 63#CCTYPE *= MSVC20
7fac1903 64# Visual C++ > 2.x and < 6.x
d56e6723 65#CCTYPE *= MSVC
7fac1903
GS
66# Visual C++ >= 6.x
67#CCTYPE *= MSVC60
68# Borland 5.02 or later
4a52a3da 69CCTYPE *= BORLAND
7fac1903 70# mingw32/egcs or mingw32/gcc
4a52a3da 71#CCTYPE *= GCC
08aa1457
PP
72
73#
cea2e8a9
GS
74# XXX Do not enable. This is currently undergoing a rewrite and will
75# NOT work.
8f818fa0 76# uncomment next line if you want to use the perl object
a29d2910
A
77# Currently, this cannot be enabled if you ask for threads above, or
78# if you are using GCC or EGCS.
e7083a8c 79#
26ca90b6 80#OBJECT *= -DPERL_OBJECT
8f818fa0
GS
81
82#
08aa1457 83# uncomment next line if you want debug version of perl (big,slow)
7fac1903
GS
84# If not enabled, we automatically try to use maximum optimization
85# with all compilers that are known to have a working optimizer.
e7083a8c 86#
d56e6723 87#CFG *= Debug
08aa1457
PP
88
89#
e9ee4811
DL
90# uncomment to enable use of PerlCRT.DLL when using the Visual C compiler.
91# Highly recommended. It has patches that fix known bugs in MSVCRT.DLL.
7fac1903 92# This currently requires VC 5.0 with Service Pack 3 or later.
b89743e8 93# Get it from CPAN at http://www.perl.com/CPAN/authors/id/D/DO/DOUGL/
e9ee4811 94# and follow the directions in the package to install.
e7083a8c
DL
95#
96#USE_PERLCRT *= define
97
98#
baed7233
DL
99# uncomment to enable linking with setargv.obj under the Visual C
100# compiler. Setting this options enables perl to expand wildcards in
101# arguments, but it may be harder to use alternate methods like
102# File::DosGlob that are more powerful. This option is supported only with
103# Visual C.
104#
105#USE_SETARGV *= define
106
107#
26618a56 108# if you have the source for des_fcrypt(), uncomment this and make sure the
8d9b2e3c 109# file exists (see README.win32). File should be located in the same
ff95b63e 110# directory as this file.
e7083a8c 111#
2d77217b 112#CRYPT_SRC *= fcrypt.c
26618a56
GS
113
114#
115# if you didn't set CRYPT_SRC and if you have des_fcrypt() available in a
116# library, uncomment this, and make sure the library exists (see README.win32)
a1dd9325 117# Specify the full pathname of the library.
e7083a8c 118#
2d77217b 119#CRYPT_LIB *= fcrypt.lib
26618a56
GS
120
121#
1c1c7f20
GS
122# set this if you wish to use perl's malloc
123# WARNING: Turning this on/off WILL break binary compatibility with extensions
5fd76c3e
GS
124# you may have compiled with/without it. Be prepared to recompile all
125# extensions if you change the default. Currently, this cannot be enabled
126# if you ask for PERL_OBJECT above.
e7083a8c 127#
ac4c12e7 128#PERL_MALLOC *= define
1c1c7f20
GS
129
130#
08aa1457 131# set the install locations of the compiler include/libraries
69e1fe5e 132# Running VCVARS32.BAT is *required* when using Visual C.
95883bf3 133# Some versions of Visual C don't define MSVCDIR in the environment,
80252599
GS
134# so you may have to set CCHOME explicitly (spaces in the path name should
135# not be quoted)
a8deba26 136#
4a52a3da 137CCHOME *= C:\bc5
95883bf3 138#CCHOME *= $(MSVCDIR)
4a52a3da 139#CCHOME *= D:\packages\mingw32
d56e6723
GS
140CCINCDIR *= $(CCHOME)\include
141CCLIBDIR *= $(CCHOME)\lib
08aa1457
PP
142
143#
e02fdbd2
GS
144# additional compiler flags can be specified here.
145#
146# Adding -DPERL_POLLUTE enables support for old symbols, at the expense of
147# extreme pollution. You most probably want this if you're compiling modules
148# from CPAN, or other such serious uses of this experimental perl release.
149# We don't enable this by default because we want the modules to get fixed
150# instead of clinging to shortcuts like this one.
151#
152#BUILDOPT *= -DPERL_POLLUTE
0cb96387 153#BUILDOPT *= -DPERL_IMPLICIT_CONTEXT
e02fdbd2
GS
154
155#
80252599
GS
156# specify semicolon-separated list of extra directories that modules will
157# look for libraries (spaces in path names need not be quoted)
fa4efe8e
GS
158#
159EXTRALIBDIRS *=
160
161#
08aa1457
PP
162# set this to point to cmd.exe (only needed if you use some
163# alternate shell that doesn't grok cmd.exe style commands)
e7083a8c 164#
d56e6723 165#SHELL *= g:\winnt\system32\cmd.exe
08aa1457
PP
166
167#
168# set this to your email address (perl will guess a value from
169# from your loginname and your hostname, which may not be right)
e7083a8c 170#
eb480a0b 171#EMAIL *=
08aa1457 172
e7083a8c
DL
173##
174## Build configuration ends.
175##
176
08aa1457
PP
177##################### CHANGE THESE ONLY IF YOU MUST #####################
178
26618a56 179.IF "$(CRYPT_SRC)$(CRYPT_LIB)" == ""
eb480a0b 180D_CRYPT = undef
26618a56 181.ELSE
eb480a0b
GS
182D_CRYPT = define
183CRYPT_FLAG = -DHAVE_DES_FCRYPT
26618a56
GS
184.ENDIF
185
eb480a0b
GS
186.IF "$(OBJECT)" != ""
187PERL_MALLOC != undef
e2f80c04 188USE_THREADS != undef
b86a2fa7 189USE_MULTI != undef
1c1c7f20
GS
190.ENDIF
191
eb480a0b
GS
192PERL_MALLOC *= undef
193
194USE_THREADS *= undef
b86a2fa7 195USE_MULTI *= undef
eb480a0b 196
d07c2202
GS
197.IMPORT .IGNORE : PROCESSOR_ARCHITECTURE
198
199PROCESSOR_ARCHITECTURE *= x86
200
b83ac84c
GS
201.IF "$(OBJECT)" != ""
202ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-object
203.ELIF "$(USE_THREADS)" == "define"
d07c2202 204ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-thread
924b3ec4
GS
205.ELSE
206ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)
d07c2202
GS
207.ENDIF
208
7fac1903
GS
209# Visual Studio 98 specific
210.IF "$(CCTYPE)" == "MSVC60"
211
212# VC 6.0 can load the socket dll on demand. Makes the test suite
213# run in about 10% less time.
214DELAYLOAD *= -DELAYLOAD:wsock32.dll delayimp.lib
215
216# VC 6.0 seems capable of compiling perl correctly with optimizations
217# enabled. Anything earlier fails tests.
218CFG *= Optimize
219.ENDIF
220
d07c2202 221COREDIR = ..\lib\CORE
eb480a0b 222AUTODIR = ..\lib\auto
d07c2202 223
08aa1457
PP
224#
225# Programs to compile, build .lib files and link
226#
227
228.USESHELL :
229
230.IF "$(CCTYPE)" == "BORLAND"
231
eb480a0b
GS
232CC = bcc32
233LINK32 = tlink32
064a70d4 234LIB32 = tlib /P128
eb480a0b 235IMPLIB = implib -c
08aa1457
PP
236
237#
238# Options
239#
eb480a0b 240RUNTIME = -D_RTLDLL
80252599 241INCLUDES = -I$(COREDIR) -I.\include -I. -I.. -I"$(CCINCDIR)"
eb480a0b
GS
242#PCHFLAGS = -H -Hc -H=c:\temp\bcmoduls.pch
243DEFINES = -DWIN32 $(BUILDOPT) $(CRYPT_FLAG)
244LOCDEFS = -DPERLDLL -DPERL_CORE
245SUBSYS = console
246CXX_FLAG = -P
08aa1457 247
eb480a0b
GS
248LIBC = cw32mti.lib
249LIBFILES = $(CRYPT_LIB) import32.lib $(LIBC) odbc32.lib odbccp32.lib
08aa1457
PP
250
251.IF "$(CFG)" == "Debug"
eb480a0b
GS
252OPTIMIZE = -v $(RUNTIME) -DDEBUGGING
253LINK_DBG = -v
08aa1457 254.ELSE
6a6688c3 255OPTIMIZE = -O2 $(RUNTIME)
eb480a0b 256LINK_DBG =
08aa1457
PP
257.ENDIF
258
22c35a8c 259CFLAGS = -w -g0 -tWM -tWD $(INCLUDES) $(DEFINES) $(LOCDEFS) \
eb480a0b 260 $(PCHFLAGS) $(OPTIMIZE)
80252599 261LINK_FLAGS = $(LINK_DBG) -L"$(CCLIBDIR)"
eb480a0b
GS
262OBJOUT_FLAG = -o
263EXEOUT_FLAG = -e
064a70d4 264LIBOUT_FLAG =
d56e6723
GS
265
266.ELIF "$(CCTYPE)" == "GCC"
267
3b657871
GS
268CC = gcc
269LINK32 = gcc
064a70d4 270LIB32 = ar rc
eb480a0b 271IMPLIB = dlltool
d56e6723
GS
272
273o = .o
eda5ff31 274a = .a
d56e6723
GS
275
276#
277# Options
278#
eb480a0b 279RUNTIME =
9036c72f 280INCLUDES = -I$(COREDIR) -I.\include -I. -I..
eb480a0b
GS
281DEFINES = -DWIN32 $(BUILDOPT) $(CRYPT_FLAG)
282LOCDEFS = -DPERLDLL -DPERL_CORE
283SUBSYS = console
284CXX_FLAG = -xc++
d56e6723 285
eb480a0b 286LIBC = -lcrtdll
db15561c
GS
287LIBFILES = $(CRYPT_LIB) -ladvapi32 -luser32 -lnetapi32 -lwsock32 \
288 -lmingw32 -lgcc -lmoldname $(LIBC) -lkernel32
d56e6723
GS
289
290.IF "$(CFG)" == "Debug"
eb480a0b
GS
291OPTIMIZE = -g -O2 $(RUNTIME) -DDEBUGGING
292LINK_DBG = -g
d56e6723 293.ELSE
eb480a0b
GS
294OPTIMIZE = -g -O2 $(RUNTIME)
295LINK_DBG =
d56e6723
GS
296.ENDIF
297
eb480a0b 298CFLAGS = $(INCLUDES) $(DEFINES) $(LOCDEFS) $(OPTIMIZE)
80252599 299LINK_FLAGS = $(LINK_DBG) -L"$(CCLIBDIR)"
eb480a0b
GS
300OBJOUT_FLAG = -o
301EXEOUT_FLAG = -o
064a70d4 302LIBOUT_FLAG =
08aa1457
PP
303
304.ELSE
305
eb480a0b
GS
306CC = cl.exe
307LINK32 = link.exe
308LIB32 = $(LINK32) -lib
309
08aa1457
PP
310#
311# Options
312#
eb480a0b 313
af883608 314RUNTIME = -MD
9036c72f 315INCLUDES = -I$(COREDIR) -I.\include -I. -I..
eb480a0b 316#PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX
b3e5c95e 317DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT $(BUILDOPT) $(CRYPT_FLAG)
eb480a0b
GS
318LOCDEFS = -DPERLDLL -DPERL_CORE
319SUBSYS = console
320CXX_FLAG = -TP -GX
08aa1457 321
e7083a8c
DL
322.IF "$(USE_PERLCRT)" == ""
323.IF "$(CFG)" == "Debug"
324PERLCRTLIBC = msvcrtd.lib
325.ELSE
326PERLCRTLIBC = msvcrt.lib
327.ENDIF
328.ELSE
329.IF "$(CFG)" == "Debug"
330PERLCRTLIBC = PerlCRTD.lib
331.ELSE
332PERLCRTLIBC = PerlCRT.lib
333.ENDIF
334.ENDIF
335
08aa1457 336.IF "$(RUNTIME)" == "-MD"
e7083a8c 337LIBC = $(PERLCRTLIBC)
08aa1457 338.ELSE
eb480a0b 339LIBC = libcmt.lib
08aa1457
PP
340.ENDIF
341
342.IF "$(CFG)" == "Debug"
343.IF "$(CCTYPE)" == "MSVC20"
eb480a0b 344OPTIMIZE = -Od $(RUNTIME) -Z7 -D_DEBUG -DDEBUGGING
08aa1457 345.ELSE
3dfd1da1 346OPTIMIZE = -Od $(RUNTIME)d -Zi -D_DEBUG -DDEBUGGING
08aa1457 347.ENDIF
eb480a0b 348LINK_DBG = -debug -pdb:none
08aa1457 349.ELSE
74593e1f
GS
350.IF "$(CFG)" == "Optimize"
351OPTIMIZE = -O2 $(RUNTIME) -DNDEBUG
08aa1457 352.ELSE
af883608 353OPTIMIZE = -Od $(RUNTIME) -DNDEBUG
08aa1457 354.ENDIF
eb480a0b 355LINK_DBG = -release
08aa1457
PP
356.ENDIF
357
7fac1903
GS
358LIBBASEFILES = $(DELAYLOAD) $(CRYPT_LIB) \
359 oldnames.lib kernel32.lib user32.lib gdi32.lib \
eb480a0b
GS
360 winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib \
361 oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
362 version.lib odbc32.lib odbccp32.lib
08aa1457 363
e7083a8c
DL
364# we add LIBC here, since we may be using PerlCRT.dll
365LIBFILES = $(LIBBASEFILES) $(LIBC)
366
eb480a0b
GS
367CFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) \
368 $(PCHFLAGS) $(OPTIMIZE)
e7083a8c 369LINK_FLAGS = -nologo -nodefaultlib $(LINK_DBG) -machine:$(PROCESSOR_ARCHITECTURE)
eb480a0b
GS
370OBJOUT_FLAG = -Fo
371EXEOUT_FLAG = -Fe
064a70d4 372LIBOUT_FLAG = /out:
08aa1457
PP
373
374.ENDIF
375
eb480a0b
GS
376.IF "$(OBJECT)" != ""
377OPTIMIZE += $(CXX_FLAG)
378.ENDIF
379
380CFLAGS_O = $(CFLAGS) $(OBJECT)
381
08aa1457
PP
382#################### do not edit below this line #######################
383############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
384
d56e6723 385o *= .obj
eda5ff31 386a *= .lib
d56e6723 387
eb480a0b
GS
388LKPRE = INPUT (
389LKPOST = )
390
08aa1457
PP
391#
392# Rules
393#
08aa1457 394
eda5ff31 395.SUFFIXES : .c $(o) .dll $(a) .exe
d56e6723
GS
396
397.c$(o):
eb480a0b 398 $(CC) -c $(null,$(<:d) $(NULL) -I$(<:d)) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $<
d07c2202
GS
399
400.y.c:
401 $(NOOP)
08aa1457 402
d56e6723 403$(o).dll:
08aa1457 404.IF "$(CCTYPE)" == "BORLAND"
d56e6723 405 $(LINK32) -Tpd -ap $(LINK_FLAGS) c0d32$(o) $<,$@,,$(LIBFILES),$(*B).def
08aa1457 406 $(IMPLIB) $(*B).lib $@
d56e6723
GS
407.ELIF "$(CCTYPE)" == "GCC"
408 $(LINK32) -o $@ $(LINK_FLAGS) $< $(LIBFILES)
eda5ff31 409 $(IMPLIB) -def $(*B).def $(*B).a $@
08aa1457 410.ELSE
08aa1457 411 $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
dc050285 412 -out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
08aa1457
PP
413.ENDIF
414
415#
0cb96387 416INST_BIN = $(INST_TOP)$(INST_VER)\bin$(INST_ARCH)
e5a95ffb
GS
417INST_SCRIPT = $(INST_TOP)$(INST_VER)\bin
418INST_LIB = $(INST_TOP)$(INST_VER)\lib
eb480a0b
GS
419INST_POD = $(INST_LIB)\pod
420INST_HTML = $(INST_POD)\html
421LIBDIR = ..\lib
422EXTDIR = ..\ext
423PODDIR = ..\pod
424EXTUTILSDIR = $(LIBDIR)\extutils
08aa1457
PP
425
426#
427# various targets
eb480a0b
GS
428MINIPERL = ..\miniperl.exe
429MINIDIR = .\mini
430PERLEXE = ..\perl.exe
431GLOBEXE = ..\perlglob.exe
432CONFIGPM = ..\lib\Config.pm
433MINIMOD = ..\lib\ExtUtils\Miniperl.pm
434X2P = ..\x2p\a2p.exe
435
436PL2BAT = bin\pl2bat.pl
437GLOBBAT = bin\perlglob.bat
08aa1457 438
4a71ed0c
GS
439UTILS = \
440 ..\utils\h2ph \
441 ..\utils\splain \
442 ..\utils\perlbug \
443 ..\utils\pl2pm \
444 ..\utils\c2ph \
445 ..\utils\h2xs \
446 ..\utils\perldoc \
447 ..\utils\pstruct \
448 ..\utils\perlcc \
449 ..\pod\checkpods \
450 ..\pod\pod2html \
451 ..\pod\pod2latex \
452 ..\pod\pod2man \
453 ..\pod\pod2text \
360aca43
GS
454 ..\pod\pod2usage \
455 ..\pod\podchecker \
456 ..\pod\podselect \
4a71ed0c
GS
457 ..\x2p\find2perl \
458 ..\x2p\s2p \
4a71ed0c
GS
459 bin\runperl.pl \
460 bin\pl2bat.pl \
461 bin\perlglob.pl \
462 bin\search.pl
463
08aa1457
PP
464.IF "$(CCTYPE)" == "BORLAND"
465
eb480a0b
GS
466CFGSH_TMPL = config.bc
467CFGH_TMPL = config_H.bc
d56e6723
GS
468
469.ELIF "$(CCTYPE)" == "GCC"
470
eb480a0b
GS
471CFGSH_TMPL = config.gc
472CFGH_TMPL = config_H.gc
db15561c
GS
473.IF "$(OBJECT)" == "-DPERL_OBJECT"
474PERLIMPLIB = ..\libperlcore$(a)
475.ELSE
476PERLIMPLIB = ..\libperl$(a)
477.ENDIF
08aa1457
PP
478
479.ELSE
480
eb480a0b
GS
481CFGSH_TMPL = config.vc
482CFGH_TMPL = config_H.vc
e7083a8c 483.IF "$(USE_PERLCRT)" == ""
eb480a0b 484PERL95EXE = ..\perl95.exe
e7083a8c 485.ENDIF
08aa1457
PP
486
487.ENDIF
488
eda5ff31
GS
489.IF "$(OBJECT)" == "-DPERL_OBJECT"
490PERLIMPLIB *= ..\perlcore$(a)
491PERLDLL = ..\perlcore.dll
6de196ee 492CAPILIB = $(COREDIR)\perlCAPI$(a)
eda5ff31
GS
493.ELSE
494PERLIMPLIB *= ..\perl$(a)
495PERLDLL = ..\perl.dll
496CAPILIB =
497.ENDIF
498
eb480a0b
GS
499XCOPY = xcopy /f /r /i /d
500RCOPY = xcopy /f /r /i /e /d
501NOOP = @echo
08aa1457 502
eb480a0b
GS
503#
504# filenames given to xsubpp must have forward slashes (since it puts
505# full pathnames in #line strings)
506XSUBPP = ..\$(MINIPERL) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp \
507 -C++ -prototypes
508
852c2e52 509MICROCORE_SRC = \
eb480a0b 510 ..\av.c \
eb480a0b
GS
511 ..\deb.c \
512 ..\doio.c \
513 ..\doop.c \
514 ..\dump.c \
515 ..\globals.c \
516 ..\gv.c \
517 ..\hv.c \
518 ..\mg.c \
519 ..\op.c \
520 ..\perl.c \
521 ..\perly.c \
522 ..\pp.c \
523 ..\pp_ctl.c \
524 ..\pp_hot.c \
525 ..\pp_sys.c \
526 ..\regcomp.c \
527 ..\regexec.c \
528 ..\run.c \
529 ..\scope.c \
530 ..\sv.c \
531 ..\taint.c \
532 ..\toke.c \
533 ..\universal.c \
a176fa2a 534 ..\utf8.c \
eb480a0b
GS
535 ..\util.c
536
1c1c7f20 537.IF "$(PERL_MALLOC)" == "define"
852c2e52 538EXTRACORE_SRC += ..\malloc.c
1c1c7f20
GS
539.ENDIF
540
eb480a0b 541.IF "$(OBJECT)" == ""
852c2e52 542EXTRACORE_SRC += ..\perlio.c
eb480a0b
GS
543.ENDIF
544
545WIN32_SRC = \
546 .\win32.c \
547 .\win32sck.c
548
549.IF "$(USE_THREADS)" == "define"
550WIN32_SRC += .\win32thread.c
551.ENDIF
552
8d9b2e3c
GS
553.IF "$(CRYPT_SRC)" != ""
554WIN32_SRC += .\$(CRYPT_SRC)
555.ENDIF
556
eb480a0b
GS
557PERL95_SRC = \
558 perl95.c \
559 win32mt.c \
560 win32sckmt.c
561
a1dd9325 562.IF "$(CRYPT_SRC)" != ""
8d9b2e3c 563PERL95_SRC += .\$(CRYPT_SRC)
a1dd9325
GS
564.ENDIF
565
eb480a0b
GS
566DLL_SRC = $(DYNALOADER).c
567
568
569.IF "$(OBJECT)" == ""
570DLL_SRC += perllib.c
571.ENDIF
572
573X2P_SRC = \
574 ..\x2p\a2p.c \
575 ..\x2p\hash.c \
576 ..\x2p\str.c \
577 ..\x2p\util.c \
578 ..\x2p\walk.c
579
852c2e52 580CORE_NOCFG_H = \
eb480a0b 581 ..\av.h \
eb480a0b
GS
582 ..\cop.h \
583 ..\cv.h \
584 ..\dosish.h \
585 ..\embed.h \
586 ..\form.h \
587 ..\gv.h \
588 ..\handy.h \
589 ..\hv.h \
0f4eea8f 590 ..\iperlsys.h \
eb480a0b
GS
591 ..\mg.h \
592 ..\nostdio.h \
593 ..\op.h \
594 ..\opcode.h \
595 ..\perl.h \
eb480a0b
GS
596 ..\perlsdio.h \
597 ..\perlsfio.h \
598 ..\perly.h \
599 ..\pp.h \
600 ..\proto.h \
601 ..\regexp.h \
602 ..\scope.h \
603 ..\sv.h \
604 ..\thread.h \
605 ..\unixish.h \
a176fa2a 606 ..\utf8.h \
eb480a0b 607 ..\util.h \
dfe13c55 608 ..\warning.h \
eb480a0b 609 ..\XSUB.h \
eb480a0b
GS
610 ..\EXTERN.h \
611 ..\perlvars.h \
612 ..\intrpvar.h \
613 ..\thrdvar.h \
614 .\include\dirent.h \
615 .\include\netdb.h \
616 .\include\sys\socket.h \
617 .\win32.h
618
852c2e52
GS
619CORE_H = $(CORE_NOCFG_H) .\config.h
620
621MICROCORE_OBJ = $(MICROCORE_SRC:db:+$(o))
622CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:db:+$(o))
eb480a0b 623WIN32_OBJ = $(WIN32_SRC:db:+$(o))
5fd76c3e 624MINICORE_OBJ = $(MINIDIR)\{$(MICROCORE_OBJ:f) miniperlmain$(o) perlio$(o)}
eb480a0b
GS
625MINIWIN32_OBJ = $(MINIDIR)\{$(WIN32_OBJ:f)}
626MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
af883608 627PERL95_OBJ = $(PERL95_SRC:db:+$(o))
eb480a0b
GS
628DLL_OBJ = $(DLL_SRC:db:+$(o))
629X2P_OBJ = $(X2P_SRC:db:+$(o))
630
eb480a0b
GS
631PERLDLL_OBJ = $(CORE_OBJ)
632PERLEXE_OBJ = perlmain$(o)
633
634.IF "$(OBJECT)" == ""
635PERLDLL_OBJ += $(WIN32_OBJ) $(DLL_OBJ)
636.ELSE
637PERLEXE_OBJ += $(WIN32_OBJ) $(DLL_OBJ)
af883608 638PERL95_OBJ += DynaLoadmt$(o)
eb480a0b
GS
639.ENDIF
640
baed7233
DL
641.IF "$(USE_SETARGV)" != ""
642SETARGV_OBJ = setargv$(o)
643.ENDIF
644
823edd99 645DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
b295d113 646 Data/Dumper Devel/Peek ByteLoader
eb480a0b 647STATIC_EXT = DynaLoader
eab60bb1 648NONXS_EXT = Errno
eb480a0b
GS
649
650DYNALOADER = $(EXTDIR)\DynaLoader\DynaLoader
651SOCKET = $(EXTDIR)\Socket\Socket
652FCNTL = $(EXTDIR)\Fcntl\Fcntl
653OPCODE = $(EXTDIR)\Opcode\Opcode
654SDBM_FILE = $(EXTDIR)\SDBM_File\SDBM_File
655IO = $(EXTDIR)\IO\IO
656POSIX = $(EXTDIR)\POSIX\POSIX
657ATTRS = $(EXTDIR)\attrs\attrs
658THREAD = $(EXTDIR)\Thread\Thread
659B = $(EXTDIR)\B\B
15e52e56 660RE = $(EXTDIR)\re\re
823edd99 661DUMPER = $(EXTDIR)\Data\Dumper\Dumper
eab60bb1 662ERRNO = $(EXTDIR)\Errno\Errno
3967c732 663PEEK = $(EXTDIR)\Devel\Peek\Peek
a6c40364 664BYTELOADER = $(EXTDIR)\ByteLoader\ByteLoader
eb480a0b
GS
665
666SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll
667FCNTL_DLL = $(AUTODIR)\Fcntl\Fcntl.dll
668OPCODE_DLL = $(AUTODIR)\Opcode\Opcode.dll
669SDBM_FILE_DLL = $(AUTODIR)\SDBM_File\SDBM_File.dll
670IO_DLL = $(AUTODIR)\IO\IO.dll
671POSIX_DLL = $(AUTODIR)\POSIX\POSIX.dll
672ATTRS_DLL = $(AUTODIR)\attrs\attrs.dll
673THREAD_DLL = $(AUTODIR)\Thread\Thread.dll
674B_DLL = $(AUTODIR)\B\B.dll
823edd99 675DUMPER_DLL = $(AUTODIR)\Data\Dumper\Dumper.dll
3967c732 676PEEK_DLL = $(AUTODIR)\Devel\Peek\Peek.dll
15e52e56 677RE_DLL = $(AUTODIR)\re\re.dll
b295d113 678BYTELOADER_DLL = $(AUTODIR)\ByteLoader\ByteLoader.dll
eb480a0b 679
eab60bb1
GS
680ERRNO_PM = $(LIBDIR)\Errno.pm
681
ac4c12e7 682EXTENSION_C = \
eb480a0b
GS
683 $(SOCKET).c \
684 $(FCNTL).c \
685 $(OPCODE).c \
686 $(SDBM_FILE).c \
687 $(IO).c \
688 $(POSIX).c \
689 $(ATTRS).c \
690 $(THREAD).c \
15e52e56 691 $(RE).c \
823edd99 692 $(DUMPER).c \
3967c732 693 $(PEEK).c \
b295d113
TH
694 $(B).c \
695 $(BYTELOADER).c
eb480a0b 696
ac4c12e7 697EXTENSION_DLL = \
eb480a0b
GS
698 $(SOCKET_DLL) \
699 $(FCNTL_DLL) \
700 $(OPCODE_DLL) \
701 $(SDBM_FILE_DLL)\
702 $(IO_DLL) \
703 $(POSIX_DLL) \
51aa15f3 704 $(ATTRS_DLL) \
823edd99 705 $(DUMPER_DLL) \
3967c732 706 $(PEEK_DLL) \
b295d113
TH
707 $(B_DLL) \
708 $(BYTELOADER_DLL)
26ca90b6 709
eab60bb1
GS
710EXTENSION_PM = \
711 $(ERRNO_PM)
712
15e52e56 713# re.dll doesn't build with PERL_OBJECT yet
26ca90b6
GS
714.IF "$(OBJECT)" == ""
715EXTENSION_DLL += \
15e52e56
GS
716 $(THREAD_DLL) \
717 $(RE_DLL)
26ca90b6 718.ENDIF
eb480a0b
GS
719
720POD2HTML = $(PODDIR)\pod2html
721POD2MAN = $(PODDIR)\pod2man
722POD2LATEX = $(PODDIR)\pod2latex
723POD2TEXT = $(PODDIR)\pod2text
724
725CFG_VARS = \
726 "INST_DRV=$(INST_DRV)" \
727 "INST_TOP=$(INST_TOP)" \
e5a95ffb 728 "INST_VER=$(INST_VER)" \
0cb96387 729 "INST_ARCH=$(INST_ARCH)" \
eb480a0b
GS
730 "archname=$(ARCHNAME)" \
731 "cc=$(CC)" \
80252599 732 "ccflags=$(OPTIMIZE:s/"/\"/) $(DEFINES) $(OBJECT)" \
eb480a0b
GS
733 "cf_email=$(EMAIL)" \
734 "d_crypt=$(D_CRYPT)" \
735 "d_mymalloc=$(PERL_MALLOC)" \
736 "libs=$(LIBFILES:f)" \
80252599 737 "incpath=$(CCINCDIR:s/"/\"/)" \
eda5ff31 738 "libperl=$(PERLIMPLIB:f)" \
80252599 739 "libpth=$(CCLIBDIR:s/"/\"/);$(EXTRALIBDIRS:s/"/\"/)" \
eb480a0b
GS
740 "libc=$(LIBC)" \
741 "make=dmake" \
eda5ff31
GS
742 "_o=$(o)" "obj_ext=$(o)" \
743 "_a=$(a)" "lib_ext=$(a)" \
eb480a0b
GS
744 "static_ext=$(STATIC_EXT)" \
745 "dynamic_ext=$(DYNAMIC_EXT)" \
eab60bb1 746 "nonxs_ext=$(NONXS_EXT)" \
eb480a0b 747 "usethreads=$(USE_THREADS)" \
b86a2fa7 748 "usemultiplicity=$(USE_MULTI)" \
80252599
GS
749 "LINK_FLAGS=$(LINK_FLAGS:s/"/\"/)" \
750 "optimize=$(OPTIMIZE:s/"/\"/)"
924b3ec4 751
08aa1457
PP
752#
753# Top targets
754#
755
852c2e52 756all : .\config.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) $(PERL95EXE) \
eab60bb1 757 $(CAPILIB) $(X2P) $(EXTENSION_DLL) $(EXTENSION_PM)
08aa1457 758
d56e6723 759$(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
08aa1457
PP
760
761#------------------------------------------------------------
762
eb480a0b 763$(GLOBEXE) : perlglob$(o)
08aa1457 764.IF "$(CCTYPE)" == "BORLAND"
80252599 765 $(CC) -c -w -v -tWM -I"$(CCINCDIR)" perlglob.c
d56e6723 766 $(LINK32) -Tpe -ap $(LINK_FLAGS) c0x32$(o) perlglob$(o) \
80252599 767 "$(CCLIBDIR)\32BIT\wildargs$(o)",$@,,import32.lib cw32mt.lib,
d56e6723
GS
768.ELIF "$(CCTYPE)" == "GCC"
769 $(LINK32) $(LINK_FLAGS) -o $@ perlglob$(o) $(LIBFILES)
08aa1457 770.ELSE
dc050285 771 $(LINK32) $(LINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
d56e6723 772 perlglob$(o) setargv$(o)
08aa1457
PP
773.ENDIF
774
d56e6723 775perlglob$(o) : perlglob.c
08aa1457 776
08aa1457
PP
777config.w32 : $(CFGSH_TMPL)
778 copy $(CFGSH_TMPL) config.w32
779
852c2e52 780.\config.h : $(CFGH_TMPL) $(CORE_NOCFG_H)
08aa1457
PP
781 -del /f config.h
782 copy $(CFGH_TMPL) config.h
783
784..\config.sh : config.w32 $(MINIPERL) config_sh.PL
924b3ec4
GS
785 $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) config.w32 > ..\config.sh
786
787# this target is for when changes to the main config.sh happen
788# edit config.{b,v,g}c and make this target once for each supported
789# compiler (e.g. `dmake CCTYPE=BORLAND regen_config_h`)
790regen_config_h:
791 perl config_sh.PL $(CFG_VARS) $(CFGSH_TMPL) > ..\config.sh
792 -cd .. && del /f perl.exe
793 cd .. && perl configpm
794 -del /f $(CFGH_TMPL)
80252599 795 -mkdir $(COREDIR)
e5a95ffb 796 -perl -I..\lib config_h.PL "INST_VER=$(INST_VER)"
924b3ec4 797 rename config.h $(CFGH_TMPL)
08aa1457
PP
798
799$(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
800 cd .. && miniperl configpm
801 if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
d07c2202
GS
802 $(XCOPY) ..\*.h $(COREDIR)\*.*
803 $(XCOPY) *.h $(COREDIR)\*.*
15e52e56 804 $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.*
d07c2202 805 $(RCOPY) include $(COREDIR)\*.*
e5a95ffb
GS
806 $(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \
807 || $(MAKE) $(MAKEMACROS) $(CONFIGPM)
08aa1457 808
eb480a0b 809$(MINIPERL) : $(MINIDIR) $(MINI_OBJ)
08aa1457
PP
810.IF "$(CCTYPE)" == "BORLAND"
811 $(LINK32) -Tpe -ap $(LINK_FLAGS) \
eb480a0b 812 @$(mktmp c0x32$(o) $(MINI_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
d56e6723
GS
813.ELIF "$(CCTYPE)" == "GCC"
814 $(LINK32) -v -o $@ $(LINK_FLAGS) \
eb480a0b 815 $(mktmp $(LKPRE) $(MINI_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
08aa1457
PP
816.ELSE
817 $(LINK32) -subsystem:console -out:$@ \
eb480a0b 818 @$(mktmp $(LINK_FLAGS) $(LIBFILES) $(MINI_OBJ:s,\,\\))
08aa1457
PP
819.ENDIF
820
eb480a0b
GS
821$(MINIDIR) :
822 if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
823
852c2e52 824$(MINICORE_OBJ) : $(CORE_NOCFG_H)
eb480a0b
GS
825 $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ ..\$(*B).c
826
852c2e52 827$(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
eb480a0b
GS
828 $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*B).c
829
852c2e52
GS
830# 1. we don't want to rebuild miniperl.exe when config.h changes
831# 2. we don't want to rebuild miniperl.exe with non-default config.h
832$(MINI_OBJ) : $(CORE_NOCFG_H)
833
eb480a0b
GS
834$(WIN32_OBJ) : $(CORE_H)
835$(CORE_OBJ) : $(CORE_H)
eb480a0b
GS
836$(DLL_OBJ) : $(CORE_H)
837$(PERL95_OBJ) : $(CORE_H)
838$(X2P_OBJ) : $(CORE_H)
08aa1457 839
22c35a8c 840perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym makedef.pl
eb480a0b 841 $(MINIPERL) -w makedef.pl $(OPTIMIZE) $(DEFINES) $(OBJECT) \
910dfcc8 842 CCTYPE=$(CCTYPE) > perldll.def
08aa1457 843
eb480a0b 844$(PERLDLL): perldll.def $(PERLDLL_OBJ)
08aa1457
PP
845.IF "$(CCTYPE)" == "BORLAND"
846 $(LINK32) -Tpd -ap $(LINK_FLAGS) \
eb480a0b 847 @$(mktmp c0d32$(o) $(PERLDLL_OBJ:s,\,\\)\n \
08aa1457
PP
848 $@,\n \
849 $(LIBFILES)\n \
850 perldll.def\n)
851 $(IMPLIB) $*.lib $@
d56e6723 852.ELIF "$(CCTYPE)" == "GCC"
3730b96e 853 $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(LINK_FLAGS) \
eb480a0b 854 $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
d56e6723
GS
855 dlltool --output-lib $(PERLIMPLIB) \
856 --dllname perl.dll \
857 --def perldll.def \
858 --base-file perl.base \
859 --output-exp perl.exp
3730b96e 860 $(LINK32) -mdll -o $@ $(LINK_FLAGS) \
eb480a0b
GS
861 $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) \
862 perl.exp $(LKPOST))
08aa1457
PP
863.ELSE
864 $(LINK32) -dll -def:perldll.def -out:$@ \
eb480a0b 865 @$(mktmp $(LINK_FLAGS) $(LIBFILES) $(PERLDLL_OBJ:s,\,\\))
08aa1457 866.ENDIF
d07c2202 867 $(XCOPY) $(PERLIMPLIB) $(COREDIR)
08aa1457
PP
868
869perl.def : $(MINIPERL) makeperldef.pl
870 $(MINIPERL) -I..\lib makeperldef.pl $(NULL) > perl.def
871
872$(MINIMOD) : $(MINIPERL) ..\minimod.pl
873 cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
874
eb480a0b
GS
875..\x2p\a2p$(o) : ..\x2p\a2p.c
876 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\a2p.c
877
878..\x2p\hash$(o) : ..\x2p\hash.c
879 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\hash.c
880
881..\x2p\str$(o) : ..\x2p\str.c
882 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\str.c
883
884..\x2p\util$(o) : ..\x2p\util.c
885 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\util.c
886
887..\x2p\walk$(o) : ..\x2p\walk.c
888 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\walk.c
889
890$(X2P) : $(MINIPERL) $(X2P_OBJ)
d07c2202
GS
891 $(MINIPERL) ..\x2p\find2perl.PL
892 $(MINIPERL) ..\x2p\s2p.PL
893.IF "$(CCTYPE)" == "BORLAND"
894 $(LINK32) -Tpe -ap $(LINK_FLAGS) \
895 @$(mktmp c0x32$(o) $(X2P_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
896.ELIF "$(CCTYPE)" == "GCC"
897 $(LINK32) -v -o $@ $(LINK_FLAGS) \
898 $(mktmp $(LKPRE) $(X2P_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
899.ELSE
900 $(LINK32) -subsystem:console -out:$@ \
422938c9 901 @$(mktmp $(LINK_FLAGS) $(LIBFILES) $(X2P_OBJ:s,\,\\))
d07c2202
GS
902.ENDIF
903
08aa1457
PP
904perlmain.c : runperl.c
905 copy runperl.c perlmain.c
906
d56e6723 907perlmain$(o) : perlmain.c
8957be0a 908 $(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c
08aa1457 909
eb480a0b 910$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ)
08aa1457
PP
911.IF "$(CCTYPE)" == "BORLAND"
912 $(LINK32) -Tpe -ap $(LINK_FLAGS) \
8957be0a
GS
913 @$(mktmp c0x32$(o) $(PERLEXE_OBJ:s,\,\\)\n \
914 $(@:s,\,\\),\n \
08aa1457 915 $(PERLIMPLIB) $(LIBFILES)\n)
d56e6723
GS
916.ELIF "$(CCTYPE)" == "GCC"
917 $(LINK32) -o $@ $(LINK_FLAGS) \
eb480a0b 918 $(PERLEXE_OBJ) $(PERLIMPLIB) $(LIBFILES)
08aa1457 919.ELSE
d56e6723 920 $(LINK32) -subsystem:console -out:$@ $(LINK_FLAGS) $(LIBFILES) \
baed7233 921 $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB)
08aa1457
PP
922.ENDIF
923 copy splittree.pl ..
eb480a0b 924 $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
08aa1457
PP
925
926.IF "$(CCTYPE)" != "BORLAND"
d56e6723 927.IF "$(CCTYPE)" != "GCC"
e7083a8c 928.IF "$(USE_PERLCRT)" == ""
08aa1457
PP
929
930perl95.c : runperl.c
931 copy runperl.c perl95.c
932
d56e6723 933perl95$(o) : perl95.c
eb480a0b 934 $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c perl95.c
08aa1457 935
d56e6723 936win32sckmt$(o) : win32sck.c
eb480a0b
GS
937 $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
938 $(OBJOUT_FLAG)win32sckmt$(o) win32sck.c
fb73857a 939
d56e6723 940win32mt$(o) : win32.c
eb480a0b
GS
941 $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
942 $(OBJOUT_FLAG)win32mt$(o) win32.c
fb73857a 943
ac4c12e7
GS
944DynaLoadmt$(o) : $(DYNALOADER).c
945 $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
946 $(OBJOUT_FLAG)DynaLoadmt$(o) $(DYNALOADER).c
fb73857a
PP
947
948$(PERL95EXE): $(PERLDLL) $(CONFIGPM) $(PERL95_OBJ)
eb480a0b 949 $(LINK32) -subsystem:console -nodefaultlib -out:$@ $(LINK_FLAGS) \
baed7233
DL
950 $(LIBBASEFILES) $(PERL95_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) \
951 libcmt.lib
08aa1457
PP
952
953.ENDIF
d56e6723 954.ENDIF
e7083a8c 955.ENDIF
08aa1457
PP
956
957$(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
eb480a0b 958 if not exist $(AUTODIR) mkdir $(AUTODIR)
bfab39a2 959 cd $(EXTDIR)\$(*B) && ..\$(MINIPERL) -I..\..\lib $(*B)_pm.PL
08aa1457
PP
960 $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
961 cd $(EXTDIR)\$(*B) && $(XSUBPP) dl_win32.xs > $(*B).c
962 $(XCOPY) $(EXTDIR)\$(*B)\dlutils.c .
963
064a70d4
GS
964.IF "$(OBJECT)" == "-DPERL_OBJECT"
965
6de196ee 966perlCAPI.cpp : $(MINIPERL)
58a50f62
GS
967 $(MINIPERL) GenCAPI.pl $(COREDIR)
968
6de196ee 969perlCAPI$(o) : perlCAPI.cpp
064a70d4 970.IF "$(CCTYPE)" == "BORLAND"
6de196ee 971 $(CC) $(CFLAGS_O) -c $(OBJOUT_FLAG)perlCAPI$(o) perlCAPI.cpp
064a70d4 972.ELIF "$(CCTYPE)" == "GCC"
6de196ee 973 $(CC) $(CFLAGS_O) -c $(OBJOUT_FLAG)perlCAPI$(o) perlCAPI.cpp
064a70d4 974.ELSE
d17537aa 975 $(CC) $(CFLAGS_O) $(RUNTIME) -UPERLDLL -c \
6de196ee 976 $(OBJOUT_FLAG)perlCAPI$(o) perlCAPI.cpp
064a70d4 977.ENDIF
58a50f62 978
6de196ee 979$(CAPILIB) : perlCAPI.cpp perlCAPI$(o)
064a70d4 980.IF "$(CCTYPE)" == "BORLAND"
6de196ee 981 $(LIB32) $(LIBOUT_FLAG)$(CAPILIB) +perlCAPI$(o)
064a70d4 982.ELSE
6de196ee 983 $(LIB32) $(LIBOUT_FLAG)$(CAPILIB) perlCAPI$(o)
064a70d4
GS
984.ENDIF
985
986.ENDIF
58a50f62 987
08aa1457
PP
988$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
989 copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
990
823edd99
GS
991$(DUMPER_DLL): $(PERLEXE) $(DUMPER).xs
992 cd $(EXTDIR)\Data\$(*B) && \
993 ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
994 cd $(EXTDIR)\Data\$(*B) && $(MAKE)
995
35ef4773 996$(PEEK_DLL): $(PERLEXE) $(PEEK).xs
3967c732
JD
997 cd $(EXTDIR)\Devel\$(*B) && \
998 ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
999 cd $(EXTDIR)\Devel\$(*B) && $(MAKE)
1000
15e52e56
GS
1001$(RE_DLL): $(PERLEXE) $(RE).xs
1002 cd $(EXTDIR)\$(*B) && \
1003 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1004 cd $(EXTDIR)\$(*B) && $(MAKE)
1005
2a321948
GS
1006$(B_DLL): $(PERLEXE) $(B).xs
1007 cd $(EXTDIR)\$(*B) && \
1008 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1009 cd $(EXTDIR)\$(*B) && $(MAKE)
1010
a98bd6f4
GS
1011$(THREAD_DLL): $(PERLEXE) $(THREAD).xs
1012 cd $(EXTDIR)\$(*B) && \
1013 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1014 cd $(EXTDIR)\$(*B) && $(MAKE)
1015
5d925967
GS
1016$(ATTRS_DLL): $(PERLEXE) $(ATTRS).xs
1017 cd $(EXTDIR)\$(*B) && \
1018 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1019 cd $(EXTDIR)\$(*B) && $(MAKE)
1020
6dead956
GS
1021$(POSIX_DLL): $(PERLEXE) $(POSIX).xs
1022 cd $(EXTDIR)\$(*B) && \
1023 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1024 cd $(EXTDIR)\$(*B) && $(MAKE)
1025
5d925967 1026$(IO_DLL): $(PERLEXE) $(IO).xs
08aa1457
PP
1027 cd $(EXTDIR)\$(*B) && \
1028 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1029 cd $(EXTDIR)\$(*B) && $(MAKE)
1030
1031$(SDBM_FILE_DLL) : $(PERLEXE) $(SDBM_FILE).xs
1032 cd $(EXTDIR)\$(*B) && \
1033 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1034 cd $(EXTDIR)\$(*B) && $(MAKE)
1035
1036$(FCNTL_DLL): $(PERLEXE) $(FCNTL).xs
1037 cd $(EXTDIR)\$(*B) && \
1038 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1039 cd $(EXTDIR)\$(*B) && $(MAKE)
1040
1041$(OPCODE_DLL): $(PERLEXE) $(OPCODE).xs
1042 cd $(EXTDIR)\$(*B) && \
1043 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1044 cd $(EXTDIR)\$(*B) && $(MAKE)
1045
5d925967 1046$(SOCKET_DLL): $(PERLEXE) $(SOCKET).xs
08aa1457
PP
1047 cd $(EXTDIR)\$(*B) && \
1048 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1049 cd $(EXTDIR)\$(*B) && $(MAKE)
1050
b295d113
TH
1051$(BYTELOADER_DLL): $(PERLEXE) $(BYTELOADER).xs
1052 cd $(EXTDIR)\$(*B) && \
1053 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1054 cd $(EXTDIR)\$(*B) && $(MAKE)
1055
eab60bb1
GS
1056$(ERRNO_PM): $(PERLEXE) $(ERRNO)_pm.PL
1057 cd $(EXTDIR)\$(*B) && \
1058 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1059 cd $(EXTDIR)\$(*B) && $(MAKE)
1060
08aa1457 1061doc: $(PERLEXE)
d07c2202 1062 $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=./html \
b3b61bd8 1063 --podpath=pod:lib:ext:utils --htmlroot="file://$(INST_HTML:s,:,|,)"\
08aa1457
PP
1064 --libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse
1065
4a71ed0c 1066utils: $(PERLEXE) $(X2P)
08aa1457 1067 cd ..\utils && $(MAKE) PERL=$(MINIPERL)
66aa1127 1068 copy ..\README.win32 ..\pod\perlwin32.pod
4a71ed0c
GS
1069 cd ..\pod && $(MAKE) -f ..\win32\pod.mak converters
1070 $(PERLEXE) $(PL2BAT) $(UTILS)
08aa1457
PP
1071
1072distclean: clean
dc050285 1073 -del /f $(MINIPERL) $(PERLEXE) $(PERL95EXE) $(PERLDLL) $(GLOBEXE) \
eda5ff31 1074 $(PERLIMPLIB) ..\miniperl$(a) $(MINIMOD)
08aa1457 1075 -del /f *.def *.map
eab60bb1
GS
1076 -del /f $(EXTENSION_DLL) $(EXTENSION_PM)
1077 -del /f $(EXTENSION_C) $(DYNALOADER).c $(ERRNO).pm
eb480a0b
GS
1078 -del /f $(EXTDIR)\DynaLoader\dl_win32.xs
1079 -del /f $(LIBDIR)\.exists $(LIBDIR)\attrs.pm $(LIBDIR)\DynaLoader.pm
1080 -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
1081 -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm $(LIBDIR)\Thread.pm
1082 -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
15e52e56 1083 -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
b295d113 1084 -del /f $(LIBDIR)\Data\Dumper.pm $(LIBDIR)\ByteLoader.pm
3967c732 1085 -del /f $(LIBDIR)\Devel\Peek.pm
eb480a0b
GS
1086 -rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO
1087 -rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread
1088 -rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B
823edd99 1089 -rmdir /s /q $(LIBDIR)\Data || rmdir /s $(LIBDIR)\Data
08aa1457
PP
1090 -del /f $(PODDIR)\*.html
1091 -del /f $(PODDIR)\*.bat
22c35a8c
GS
1092 -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc \
1093 pstruct *.bat
eb480a0b 1094 -cd ..\x2p && del /f find2perl s2p *.bat
d444a431 1095 -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
eb480a0b 1096 -del /f $(CONFIGPM)
d444a431
TB
1097.IF "$(PERL95EXE)" != ""
1098 -del /f perl95.c
1099.ENDIF
1100 -del /f bin\*.bat
22c35a8c
GS
1101 -cd $(EXTDIR) && del /s *$(a) *.def *.map *.pdb *.bs Makefile *$(o) \
1102 pm_to_blib
eb480a0b 1103 -rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR)
d07c2202 1104 -rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR)
08aa1457 1105
4a71ed0c 1106install : all installbare installhtml
6dead956 1107
4a71ed0c 1108installbare : utils
d07c2202 1109 $(PERLEXE) ..\installperl
08aa1457
PP
1110.IF "$(PERL95EXE)" != ""
1111 $(XCOPY) $(PERL95EXE) $(INST_BIN)\*.*
1112.ENDIF
1113 $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
e5a95ffb 1114 $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.*
6dead956
GS
1115
1116installhtml : doc
08aa1457
PP
1117 $(RCOPY) html\*.* $(INST_HTML)\*.*
1118
1119inst_lib : $(CONFIGPM)
1120 copy splittree.pl ..
eb480a0b 1121 $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
08aa1457
PP
1122 $(RCOPY) ..\lib $(INST_LIB)\*.*
1123
dfb634a9 1124minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) utils
08aa1457
PP
1125 $(XCOPY) $(MINIPERL) ..\t\perl.exe
1126.IF "$(CCTYPE)" == "BORLAND"
1127 $(XCOPY) $(GLOBBAT) ..\t\$(NULL)
1128.ELSE
1129 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1130.ENDIF
1131 attrib -r ..\t\*.*
1132 copy test ..\t
1133 cd ..\t && \
1134 $(MINIPERL) -I..\lib test base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t
1135
dfb634a9 1136test-prep : all utils
08aa1457
PP
1137 $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1138 $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1139.IF "$(CCTYPE)" == "BORLAND"
1140 $(XCOPY) $(GLOBBAT) ..\t\$(NULL)
1141.ELSE
1142 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1143.ENDIF
32f822de
GS
1144
1145test : test-prep
08aa1457
PP
1146 cd ..\t && $(PERLEXE) -I..\lib harness
1147
32f822de
GS
1148test-notty : test-prep
1149 set PERL_SKIP_TTY_TEST=1 && \
1150 cd ..\t && $(PERLEXE) -I.\lib harness
1151
08aa1457 1152clean :
d56e6723 1153 -@erase miniperlmain$(o)
08aa1457 1154 -@erase $(MINIPERL)
d56e6723
GS
1155 -@erase perlglob$(o)
1156 -@erase perlmain$(o)
6de196ee 1157 -@erase perlCAPI.cpp
08aa1457
PP
1158 -@erase config.w32
1159 -@erase /f config.h
1160 -@erase $(GLOBEXE)
1161 -@erase $(PERLEXE)
1162 -@erase $(PERLDLL)
1163 -@erase $(CORE_OBJ)
eb480a0b 1164 -rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR)
08aa1457
PP
1165 -@erase $(WIN32_OBJ)
1166 -@erase $(DLL_OBJ)
d07c2202 1167 -@erase $(X2P_OBJ)
eda5ff31 1168 -@erase ..\*$(o) ..\*$(a) ..\*.exp *$(o) *$(a) *.exp
d444a431 1169 -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
d07c2202 1170 -@erase ..\x2p\*.exe ..\x2p\*.bat
08aa1457
PP
1171 -@erase *.ilk
1172 -@erase *.pdb