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