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