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