produce redeclaration warning on C<our $foo; { our $foo; ... }>
[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#
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
4a52a3da 102CCTYPE *= BORLAND
5db10396 103# mingw32/gcc-2.95.2 or better
4a52a3da 104#CCTYPE *= 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#
fd9459bc 168CCHOME *= c:\bc5
95883bf3 169#CCHOME *= $(MSVCDIR)
4a52a3da 170#CCHOME *= D:\packages\mingw32
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
aaacdc8b 291.IF "$(USE_OBJECT)" == "define"
292ARCHNAME = $(ARCHNAME)-thread
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.
300DELAYLOAD *= -DELAYLOAD:wsock32.dll delayimp.lib
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#
eb480a0b 341RUNTIME = -D_RTLDLL
80252599 342INCLUDES = -I$(COREDIR) -I.\include -I. -I.. -I"$(CCINCDIR)"
eb480a0b 343#PCHFLAGS = -H -Hc -H=c:\temp\bcmoduls.pch
c5be433b 344DEFINES = -DWIN32 $(CRYPT_FLAG)
eb480a0b 345LOCDEFS = -DPERLDLL -DPERL_CORE
346SUBSYS = console
347CXX_FLAG = -P
08aa1457 348
eb480a0b 349LIBC = cw32mti.lib
350LIBFILES = $(CRYPT_LIB) import32.lib $(LIBC) odbc32.lib odbccp32.lib
08aa1457 351
352.IF "$(CFG)" == "Debug"
eb480a0b 353OPTIMIZE = -v $(RUNTIME) -DDEBUGGING
354LINK_DBG = -v
08aa1457 355.ELSE
6a6688c3 356OPTIMIZE = -O2 $(RUNTIME)
eb480a0b 357LINK_DBG =
08aa1457 358.ENDIF
359
a88c3d7c 360CFLAGS = -w -g0 -tWM -tWD $(INCLUDES) $(DEFINES) $(LOCDEFS) \
eb480a0b 361 $(PCHFLAGS) $(OPTIMIZE)
28004758 362LINK_FLAGS = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)"
eb480a0b 363OBJOUT_FLAG = -o
364EXEOUT_FLAG = -e
064a70d4 365LIBOUT_FLAG =
d56e6723 366
367.ELIF "$(CCTYPE)" == "GCC"
368
3b657871 369CC = gcc
370LINK32 = gcc
064a70d4 371LIB32 = ar rc
eb480a0b 372IMPLIB = dlltool
fd9459bc 373RSC = rc
d56e6723 374
375o = .o
eda5ff31 376a = .a
d56e6723 377
378#
379# Options
380#
7a958ec3 381
5db10396 382RUNTIME =
9036c72f 383INCLUDES = -I$(COREDIR) -I.\include -I. -I..
c5be433b 384DEFINES = -DWIN32 $(CRYPT_FLAG)
eb480a0b 385LOCDEFS = -DPERLDLL -DPERL_CORE
386SUBSYS = console
387CXX_FLAG = -xc++
d56e6723 388
5db10396 389LIBC = -lmsvcrt
7a958ec3 390
5db10396 391# same libs as MSVC
392LIBFILES = $(CRYPT_LIB) $(LIBC) \
393 -lmoldname -lkernel32 -luser32 -lgdi32 \
394 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 \
395 -loleaut32 -lnetapi32 -luuid -lwsock32 -lmpr \
396 -lwinmm -lversion -lodbc32
d56e6723 397
398.IF "$(CFG)" == "Debug"
2b260de0 399OPTIMIZE = -g $(RUNTIME) -DDEBUGGING
eb480a0b 400LINK_DBG = -g
d56e6723 401.ELSE
eb480a0b 402OPTIMIZE = -g -O2 $(RUNTIME)
403LINK_DBG =
d56e6723 404.ENDIF
405
eb480a0b 406CFLAGS = $(INCLUDES) $(DEFINES) $(LOCDEFS) $(OPTIMIZE)
28004758 407LINK_FLAGS = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)"
eb480a0b 408OBJOUT_FLAG = -o
409EXEOUT_FLAG = -o
064a70d4 410LIBOUT_FLAG =
08aa1457 411
412.ELSE
413
045453ec 414CC = cl
415LINK32 = link
eb480a0b 416LIB32 = $(LINK32) -lib
fd9459bc 417RSC = rc
eb480a0b 418
08aa1457 419#
420# Options
421#
eb480a0b 422
af883608 423RUNTIME = -MD
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"
e7083a8c 432.IF "$(CFG)" == "Debug"
433PERLCRTLIBC = msvcrtd.lib
434.ELSE
435PERLCRTLIBC = msvcrt.lib
436.ENDIF
437.ELSE
438.IF "$(CFG)" == "Debug"
439PERLCRTLIBC = PerlCRTD.lib
440.ELSE
441PERLCRTLIBC = PerlCRT.lib
442.ENDIF
443.ENDIF
444
fd9459bc 445PERLEXE_RES =
446PERLDLL_RES =
447
08aa1457 448.IF "$(RUNTIME)" == "-MD"
e7083a8c 449LIBC = $(PERLCRTLIBC)
08aa1457 450.ELSE
eb480a0b 451LIBC = libcmt.lib
08aa1457 452.ENDIF
453
454.IF "$(CFG)" == "Debug"
455.IF "$(CCTYPE)" == "MSVC20"
eb480a0b 456OPTIMIZE = -Od $(RUNTIME) -Z7 -D_DEBUG -DDEBUGGING
08aa1457 457.ELSE
3dfd1da1 458OPTIMIZE = -Od $(RUNTIME)d -Zi -D_DEBUG -DDEBUGGING
08aa1457 459.ENDIF
eb480a0b 460LINK_DBG = -debug -pdb:none
08aa1457 461.ELSE
74593e1f 462.IF "$(CFG)" == "Optimize"
c5be433b 463# -O1 yields smaller code, which turns out to be faster than -O2
464#OPTIMIZE = -O2 $(RUNTIME) -DNDEBUG
465OPTIMIZE = -O1 $(RUNTIME) -DNDEBUG
08aa1457 466.ELSE
af883608 467OPTIMIZE = -Od $(RUNTIME) -DNDEBUG
08aa1457 468.ENDIF
eb480a0b 469LINK_DBG = -release
08aa1457 470.ENDIF
471
7fac1903 472LIBBASEFILES = $(DELAYLOAD) $(CRYPT_LIB) \
f7aeb604 473 oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
474 comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
475 netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
476 version.lib odbc32.lib odbccp32.lib
08aa1457 477
e7083a8c 478# we add LIBC here, since we may be using PerlCRT.dll
479LIBFILES = $(LIBBASEFILES) $(LIBC)
480
eb480a0b 481CFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) \
482 $(PCHFLAGS) $(OPTIMIZE)
28004758 483LINK_FLAGS = -nologo -nodefaultlib $(LINK_DBG) \
484 -libpath:"$(INST_COREDIR)" \
485 -machine:$(PROCESSOR_ARCHITECTURE)
eb480a0b 486OBJOUT_FLAG = -Fo
487EXEOUT_FLAG = -Fe
064a70d4 488LIBOUT_FLAG = /out:
08aa1457 489
f7aeb604 490.IF "$(USE_PERLCRT)" != "define"
491BUILDOPT += -DPERL_MSVCRT_READFIX
492.ENDIF
493
08aa1457 494.ENDIF
495
c5be433b 496.IF "$(USE_OBJECT)" == "define"
eb480a0b 497OPTIMIZE += $(CXX_FLAG)
c5be433b 498BUILDOPT += -DPERL_OBJECT
eb480a0b 499.ENDIF
500
c5be433b 501CFLAGS_O = $(CFLAGS) $(BUILDOPT)
eb480a0b 502
5db10396 503# used to allow local linking flags that are not propogated into Config.pm,
504# currently unused
505# -- BKS, 12-12-1999
7a958ec3 506PRIV_LINK_FLAGS *=
507BLINK_FLAGS = $(PRIV_LINK_FLAGS) $(LINK_FLAGS)
508
08aa1457 509#################### do not edit below this line #######################
510############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
511
d56e6723 512o *= .obj
eda5ff31 513a *= .lib
d56e6723 514
eb480a0b 515LKPRE = INPUT (
516LKPOST = )
517
08aa1457 518#
519# Rules
520#
08aa1457 521
fd9459bc 522.SUFFIXES : .c $(o) .dll $(a) .exe .rc .res
d56e6723 523
524.c$(o):
eb480a0b 525 $(CC) -c $(null,$(<:d) $(NULL) -I$(<:d)) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $<
d07c2202 526
527.y.c:
528 $(NOOP)
08aa1457 529
d56e6723 530$(o).dll:
08aa1457 531.IF "$(CCTYPE)" == "BORLAND"
7a958ec3 532 $(LINK32) -Tpd -ap $(BLINK_FLAGS) c0d32$(o) $<,$@,,$(LIBFILES),$(*B).def
08aa1457 533 $(IMPLIB) $(*B).lib $@
d56e6723 534.ELIF "$(CCTYPE)" == "GCC"
7a958ec3 535 $(LINK32) -o $@ $(BLINK_FLAGS) $< $(LIBFILES)
5db10396 536 $(IMPLIB) --input-def $(*B).def --output-lib $(*B).a $@
08aa1457 537.ELSE
08aa1457 538 $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
7a958ec3 539 -out:$@ $(BLINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
08aa1457 540.ENDIF
541
fd9459bc 542.rc.res:
543 $(RSC) $<
544
08aa1457 545#
08aa1457 546# various targets
eb480a0b 547MINIPERL = ..\miniperl.exe
548MINIDIR = .\mini
549PERLEXE = ..\perl.exe
7766f137 550WPERLEXE = ..\wperl.exe
eb480a0b 551GLOBEXE = ..\perlglob.exe
552CONFIGPM = ..\lib\Config.pm
553MINIMOD = ..\lib\ExtUtils\Miniperl.pm
554X2P = ..\x2p\a2p.exe
555
556PL2BAT = bin\pl2bat.pl
557GLOBBAT = bin\perlglob.bat
08aa1457 558
4a71ed0c 559UTILS = \
560 ..\utils\h2ph \
561 ..\utils\splain \
95667ae4 562 ..\utils\dprofpp \
4a71ed0c 563 ..\utils\perlbug \
564 ..\utils\pl2pm \
565 ..\utils\c2ph \
566 ..\utils\h2xs \
567 ..\utils\perldoc \
4a71ed0c 568 ..\utils\perlcc \
569 ..\pod\checkpods \
570 ..\pod\pod2html \
571 ..\pod\pod2latex \
572 ..\pod\pod2man \
573 ..\pod\pod2text \
360aca43 574 ..\pod\pod2usage \
575 ..\pod\podchecker \
576 ..\pod\podselect \
4a71ed0c 577 ..\x2p\find2perl \
578 ..\x2p\s2p \
4a71ed0c 579 bin\runperl.pl \
580 bin\pl2bat.pl \
581 bin\perlglob.pl \
582 bin\search.pl
583
08aa1457 584.IF "$(CCTYPE)" == "BORLAND"
585
eb480a0b 586CFGSH_TMPL = config.bc
587CFGH_TMPL = config_H.bc
d56e6723 588
589.ELIF "$(CCTYPE)" == "GCC"
590
eb480a0b 591CFGSH_TMPL = config.gc
592CFGH_TMPL = config_H.gc
c5be433b 593.IF "$(USE_OBJECT)" == "define"
db15561c 594PERLIMPLIB = ..\libperlcore$(a)
595.ELSE
596PERLIMPLIB = ..\libperl$(a)
597.ENDIF
08aa1457 598
599.ELSE
600
eb480a0b 601CFGSH_TMPL = config.vc
602CFGH_TMPL = config_H.vc
f7aeb604 603.IF "$(USE_PERLCRT)" != "define"
eb480a0b 604PERL95EXE = ..\perl95.exe
e7083a8c 605.ENDIF
08aa1457 606
607.ENDIF
608
3075ddba 609PERLIMPLIB *= ..\perl56$(a)
610PERLDLL = ..\perl56.dll
eda5ff31 611
eb480a0b 612XCOPY = xcopy /f /r /i /d
613RCOPY = xcopy /f /r /i /e /d
614NOOP = @echo
08aa1457 615
eb480a0b 616#
617# filenames given to xsubpp must have forward slashes (since it puts
618# full pathnames in #line strings)
619XSUBPP = ..\$(MINIPERL) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp \
620 -C++ -prototypes
621
852c2e52 622MICROCORE_SRC = \
eb480a0b 623 ..\av.c \
eb480a0b 624 ..\deb.c \
625 ..\doio.c \
626 ..\doop.c \
627 ..\dump.c \
628 ..\globals.c \
629 ..\gv.c \
630 ..\hv.c \
631 ..\mg.c \
632 ..\op.c \
633 ..\perl.c \
c5be433b 634 ..\perlapi.c \
eb480a0b 635 ..\perly.c \
636 ..\pp.c \
637 ..\pp_ctl.c \
638 ..\pp_hot.c \
639 ..\pp_sys.c \
640 ..\regcomp.c \
641 ..\regexec.c \
642 ..\run.c \
643 ..\scope.c \
644 ..\sv.c \
645 ..\taint.c \
646 ..\toke.c \
647 ..\universal.c \
a176fa2a 648 ..\utf8.c \
349fd7b7 649 ..\util.c \
650 ..\xsutils.c
eb480a0b 651
c5be433b 652EXTRACORE_SRC += perllib.c
653
1c1c7f20 654.IF "$(PERL_MALLOC)" == "define"
852c2e52 655EXTRACORE_SRC += ..\malloc.c
1c1c7f20 656.ENDIF
657
c5be433b 658.IF "$(USE_OBJECT)" != "define"
852c2e52 659EXTRACORE_SRC += ..\perlio.c
eb480a0b 660.ENDIF
661
662WIN32_SRC = \
663 .\win32.c \
664 .\win32sck.c
665
aaacdc8b 666.IF "$(USE_5005THREADS)" == "define"
eb480a0b 667WIN32_SRC += .\win32thread.c
668.ENDIF
669
8d9b2e3c 670.IF "$(CRYPT_SRC)" != ""
671WIN32_SRC += .\$(CRYPT_SRC)
672.ENDIF
673
eb480a0b 674PERL95_SRC = \
675 perl95.c \
676 win32mt.c \
677 win32sckmt.c
678
a1dd9325 679.IF "$(CRYPT_SRC)" != ""
8d9b2e3c 680PERL95_SRC += .\$(CRYPT_SRC)
a1dd9325 681.ENDIF
682
eb480a0b 683DLL_SRC = $(DYNALOADER).c
684
eb480a0b 685X2P_SRC = \
686 ..\x2p\a2p.c \
687 ..\x2p\hash.c \
688 ..\x2p\str.c \
689 ..\x2p\util.c \
690 ..\x2p\walk.c
691
852c2e52 692CORE_NOCFG_H = \
eb480a0b 693 ..\av.h \
eb480a0b 694 ..\cop.h \
695 ..\cv.h \
696 ..\dosish.h \
697 ..\embed.h \
698 ..\form.h \
699 ..\gv.h \
700 ..\handy.h \
701 ..\hv.h \
0f4eea8f 702 ..\iperlsys.h \
eb480a0b 703 ..\mg.h \
704 ..\nostdio.h \
705 ..\op.h \
706 ..\opcode.h \
707 ..\perl.h \
c5be433b 708 ..\perlapi.h \
eb480a0b 709 ..\perlsdio.h \
710 ..\perlsfio.h \
711 ..\perly.h \
712 ..\pp.h \
713 ..\proto.h \
714 ..\regexp.h \
715 ..\scope.h \
716 ..\sv.h \
717 ..\thread.h \
718 ..\unixish.h \
a176fa2a 719 ..\utf8.h \
eb480a0b 720 ..\util.h \
2985053f 721 ..\warnings.h \
eb480a0b 722 ..\XSUB.h \
eb480a0b 723 ..\EXTERN.h \
724 ..\perlvars.h \
725 ..\intrpvar.h \
726 ..\thrdvar.h \
727 .\include\dirent.h \
728 .\include\netdb.h \
729 .\include\sys\socket.h \
7766f137 730 .\win32.h \
731 .\perlhost.h \
732 .\vdir.h \
733 .\vmem.h
eb480a0b 734
852c2e52 735CORE_H = $(CORE_NOCFG_H) .\config.h
736
737MICROCORE_OBJ = $(MICROCORE_SRC:db:+$(o))
738CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:db:+$(o))
eb480a0b 739WIN32_OBJ = $(WIN32_SRC:db:+$(o))
5fd76c3e 740MINICORE_OBJ = $(MINIDIR)\{$(MICROCORE_OBJ:f) miniperlmain$(o) perlio$(o)}
eb480a0b 741MINIWIN32_OBJ = $(MINIDIR)\{$(WIN32_OBJ:f)}
742MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
af883608 743PERL95_OBJ = $(PERL95_SRC:db:+$(o))
eb480a0b 744DLL_OBJ = $(DLL_SRC:db:+$(o))
745X2P_OBJ = $(X2P_SRC:db:+$(o))
746
eb480a0b 747PERLDLL_OBJ = $(CORE_OBJ)
748PERLEXE_OBJ = perlmain$(o)
749
eb480a0b 750PERLDLL_OBJ += $(WIN32_OBJ) $(DLL_OBJ)
eb480a0b 751
baed7233 752.IF "$(USE_SETARGV)" != ""
753SETARGV_OBJ = setargv$(o)
754.ENDIF
755
823edd99 756DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
4f49e16e 757 Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob
eb480a0b 758STATIC_EXT = DynaLoader
eab60bb1 759NONXS_EXT = Errno
eb480a0b 760
761DYNALOADER = $(EXTDIR)\DynaLoader\DynaLoader
762SOCKET = $(EXTDIR)\Socket\Socket
763FCNTL = $(EXTDIR)\Fcntl\Fcntl
764OPCODE = $(EXTDIR)\Opcode\Opcode
765SDBM_FILE = $(EXTDIR)\SDBM_File\SDBM_File
766IO = $(EXTDIR)\IO\IO
767POSIX = $(EXTDIR)\POSIX\POSIX
768ATTRS = $(EXTDIR)\attrs\attrs
769THREAD = $(EXTDIR)\Thread\Thread
770B = $(EXTDIR)\B\B
15e52e56 771RE = $(EXTDIR)\re\re
823edd99 772DUMPER = $(EXTDIR)\Data\Dumper\Dumper
eab60bb1 773ERRNO = $(EXTDIR)\Errno\Errno
3967c732 774PEEK = $(EXTDIR)\Devel\Peek\Peek
a6c40364 775BYTELOADER = $(EXTDIR)\ByteLoader\ByteLoader
38b3a85b 776DPROF = $(EXTDIR)\Devel\DProf\DProf
4f49e16e 777GLOB = $(EXTDIR)\File\Glob\Glob
eb480a0b 778
779SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll
780FCNTL_DLL = $(AUTODIR)\Fcntl\Fcntl.dll
781OPCODE_DLL = $(AUTODIR)\Opcode\Opcode.dll
782SDBM_FILE_DLL = $(AUTODIR)\SDBM_File\SDBM_File.dll
783IO_DLL = $(AUTODIR)\IO\IO.dll
784POSIX_DLL = $(AUTODIR)\POSIX\POSIX.dll
785ATTRS_DLL = $(AUTODIR)\attrs\attrs.dll
786THREAD_DLL = $(AUTODIR)\Thread\Thread.dll
787B_DLL = $(AUTODIR)\B\B.dll
823edd99 788DUMPER_DLL = $(AUTODIR)\Data\Dumper\Dumper.dll
3967c732 789PEEK_DLL = $(AUTODIR)\Devel\Peek\Peek.dll
15e52e56 790RE_DLL = $(AUTODIR)\re\re.dll
b295d113 791BYTELOADER_DLL = $(AUTODIR)\ByteLoader\ByteLoader.dll
38b3a85b 792DPROF_DLL = $(AUTODIR)\Devel\DProf\DProf.dll
4f49e16e 793GLOB_DLL = $(AUTODIR)\File\Glob\Glob.dll
eb480a0b 794
eab60bb1 795ERRNO_PM = $(LIBDIR)\Errno.pm
796
ac4c12e7 797EXTENSION_C = \
eb480a0b 798 $(SOCKET).c \
799 $(FCNTL).c \
800 $(OPCODE).c \
801 $(SDBM_FILE).c \
802 $(IO).c \
803 $(POSIX).c \
804 $(ATTRS).c \
805 $(THREAD).c \
15e52e56 806 $(RE).c \
823edd99 807 $(DUMPER).c \
3967c732 808 $(PEEK).c \
b295d113 809 $(B).c \
38b3a85b 810 $(BYTELOADER).c \
4f49e16e 811 $(DPROF).c \
812 $(GLOB).c
eb480a0b 813
ac4c12e7 814EXTENSION_DLL = \
eb480a0b 815 $(SOCKET_DLL) \
816 $(FCNTL_DLL) \
817 $(OPCODE_DLL) \
818 $(SDBM_FILE_DLL)\
819 $(IO_DLL) \
820 $(POSIX_DLL) \
51aa15f3 821 $(ATTRS_DLL) \
823edd99 822 $(DUMPER_DLL) \
3967c732 823 $(PEEK_DLL) \
b295d113 824 $(B_DLL) \
c5be433b 825 $(RE_DLL) \
826 $(THREAD_DLL) \
38b3a85b 827 $(BYTELOADER_DLL) \
4f49e16e 828 $(DPROF_DLL) \
829 $(GLOB_DLL)
26ca90b6 830
eab60bb1 831EXTENSION_PM = \
832 $(ERRNO_PM)
833
eb480a0b 834POD2HTML = $(PODDIR)\pod2html
835POD2MAN = $(PODDIR)\pod2man
836POD2LATEX = $(PODDIR)\pod2latex
837POD2TEXT = $(PODDIR)\pod2text
838
7a958ec3 839# vars must be separated by "\t+~\t+", since we're using the tempfile
840# version of config_sh.pl (we were overflowing someone's buffer by
841# trying to fit them all on the command line)
842# -- BKS 10-17-1999
eb480a0b 843CFG_VARS = \
7a958ec3 844 INST_DRV=$(INST_DRV) ~ \
845 INST_TOP=$(INST_TOP) ~ \
846 INST_VER=$(INST_VER:s/\/\\/) ~ \
847 INST_ARCH=$(INST_ARCH) ~ \
848 archname=$(ARCHNAME) ~ \
849 cc=$(CC) ~ \
850 ccflags=$(OPTIMIZE) $(DEFINES) $(BUILDOPT) ~ \
851 cf_email=$(EMAIL) ~ \
852 d_crypt=$(D_CRYPT) ~ \
853 d_mymalloc=$(PERL_MALLOC) ~ \
854 libs=$(LIBFILES:f) ~ \
855 incpath=$(CCINCDIR) ~ \
856 libperl=$(PERLIMPLIB:f) ~ \
857 libpth=$(CCLIBDIR);$(EXTRALIBDIRS) ~ \
858 libc=$(LIBC) ~ \
859 make=dmake ~ \
860 _o=$(o) obj_ext=$(o) ~ \
861 _a=$(a) lib_ext=$(a) ~ \
862 static_ext=$(STATIC_EXT) ~ \
863 dynamic_ext=$(DYNAMIC_EXT) ~ \
864 nonxs_ext=$(NONXS_EXT) ~ \
aaacdc8b 865 use5005threads=$(USE_5005THREADS) ~ \
866 useithreads=$(USE_ITHREADS) ~ \
867 usethreads=$(USE_5005THREADS) ~ \
7a958ec3 868 usemultiplicity=$(USE_MULTI) ~ \
869 LINK_FLAGS=$(LINK_FLAGS:s/\/\\/) ~ \
870 optimize=$(OPTIMIZE)
871
872#
873# set up targets varying between Win95 and WinNT builds
874#
875
876.IF "$(IS_WIN95)" == "define"
877MK2 = .\makefile.95
878RIGHTMAKE = __switch_makefiles
879NOOP = @rem
880.ELSE
881MK2 = __not_needed
882RIGHTMAKE = __not_needed
883.ENDIF
924b3ec4 884
08aa1457 885#
886# Top targets
887#
888
5db10396 889all : .\config.h $(GLOBEXE) $(MINIPERL) $(MK2) \
7a958ec3 890 $(RIGHTMAKE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) $(PERL95EXE) \
891 $(X2P) $(EXTENSION_DLL) $(EXTENSION_PM)
892
893$(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
894
895#----------------------------------------------------------------
896
897#-------------------- BEGIN Win95 SPECIFIC ----------------------
898
899# this target is a jump-off point for Win95
900# 1. it switches to the Win95-specific makefile if it exists
5db10396 901# (__do_switch_makefiles)
7a958ec3 902# 2. it prints a message when the Win95-specific one finishes (__done)
903# 3. it then kills this makefile by trying to make __no_such_target
8ec44883 904
7a958ec3 905__switch_makefiles: __do_switch_makefiles __done __no_such_target
906
907__do_switch_makefiles:
908.IF "$(NOTFIRST)" != "true"
909 if exist $(MK2) $(MAKE:s/-S//) -f $(MK2) $(MAKETARGETS) NOTFIRST=true
8ec44883 910.ELSE
7a958ec3 911 $(NOOP)
8ec44883 912.ENDIF
08aa1457 913
7a958ec3 914.IF "$(NOTFIRST)" != "true"
915__done:
916 @echo Build process complete. Ignore any errors after this message.
917 @echo Run "dmake test" to test and "dmake install" to install
918
919.ELSE
920# dummy targets for Win95-specific makefile
08aa1457 921
7a958ec3 922__done:
923 $(NOOP)
924
925__no_such_target:
926 $(NOOP)
08aa1457 927
8ec44883 928.ENDIF
929
7a958ec3 930# This target is used to generate the new makefile (.\makefile.95) for Win95
931
932.\makefile.95: .\makefile.mk
933 $(MINIPERL) genmk95.pl makefile.mk $(MK2)
934
935#--------------------- END Win95 SPECIFIC ---------------------
936
7a958ec3 937# a blank target for when builds don't need to do certain things
938# this target added for Win95 port but used to keep the WinNT port able to
939# use this file
940__not_needed:
4ce4f76e 941 $(NOOP)
7a958ec3 942
eb480a0b 943$(GLOBEXE) : perlglob$(o)
08aa1457 944.IF "$(CCTYPE)" == "BORLAND"
80252599 945 $(CC) -c -w -v -tWM -I"$(CCINCDIR)" perlglob.c
7a958ec3 946 $(LINK32) -Tpe -ap $(BLINK_FLAGS) c0x32$(o) perlglob$(o) \
80252599 947 "$(CCLIBDIR)\32BIT\wildargs$(o)",$@,,import32.lib cw32mt.lib,
d56e6723 948.ELIF "$(CCTYPE)" == "GCC"
5db10396 949 $(LINK32) $(BLINK_FLAGS) -mconsole -o $@ perlglob$(o) $(LIBFILES)
08aa1457 950.ELSE
7a958ec3 951 $(LINK32) $(BLINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
d56e6723 952 perlglob$(o) setargv$(o)
08aa1457 953.ENDIF
954
d56e6723 955perlglob$(o) : perlglob.c
08aa1457 956
08aa1457 957config.w32 : $(CFGSH_TMPL)
958 copy $(CFGSH_TMPL) config.w32
959
852c2e52 960.\config.h : $(CFGH_TMPL) $(CORE_NOCFG_H)
08aa1457 961 -del /f config.h
962 copy $(CFGH_TMPL) config.h
963
964..\config.sh : config.w32 $(MINIPERL) config_sh.PL
7a958ec3 965 $(MINIPERL) -I..\lib config_sh.PL --cfgsh-option-file \
966 $(mktmp $(CFG_VARS)) config.w32 > ..\config.sh
924b3ec4 967
968# this target is for when changes to the main config.sh happen
969# edit config.{b,v,g}c and make this target once for each supported
970# compiler (e.g. `dmake CCTYPE=BORLAND regen_config_h`)
971regen_config_h:
bbda9c9d 972 perl config_sh.PL --cfgsh-option-file $(mktmp $(CFG_VARS)) \
973 $(CFGSH_TMPL) > ..\config.sh
924b3ec4 974 -cd .. && del /f perl.exe
975 cd .. && perl configpm
976 -del /f $(CFGH_TMPL)
80252599 977 -mkdir $(COREDIR)
e5a95ffb 978 -perl -I..\lib config_h.PL "INST_VER=$(INST_VER)"
924b3ec4 979 rename config.h $(CFGH_TMPL)
08aa1457 980
981$(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
982 cd .. && miniperl configpm
983 if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
d07c2202 984 $(XCOPY) ..\*.h $(COREDIR)\*.*
985 $(XCOPY) *.h $(COREDIR)\*.*
15e52e56 986 $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.*
d07c2202 987 $(RCOPY) include $(COREDIR)\*.*
e5a95ffb 988 $(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \
d543acb6 989 || $(MAKE) $(MAKEMACROS) $(CONFIGPM) $(MAKEFILE)
08aa1457 990
7a958ec3 991$(MINIPERL) : $(MINIDIR) $(MINI_OBJ) $(CRTIPMLIBS)
08aa1457 992.IF "$(CCTYPE)" == "BORLAND"
7a958ec3 993 $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
eb480a0b 994 @$(mktmp c0x32$(o) $(MINI_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
d56e6723 995.ELIF "$(CCTYPE)" == "GCC"
5db10396 996 $(LINK32) -v -mconsole -o $@ $(BLINK_FLAGS) \
7a958ec3 997 $(mktmp $(LKPRE) $(MINI_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
08aa1457 998.ELSE
999 $(LINK32) -subsystem:console -out:$@ \
7a958ec3 1000 @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(MINI_OBJ:s,\,\\))
08aa1457 1001.ENDIF
1002
eb480a0b 1003$(MINIDIR) :
1004 if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
1005
852c2e52 1006$(MINICORE_OBJ) : $(CORE_NOCFG_H)
fe0bfefd 1007 $(CC) -c $(CFLAGS) -DPERL_EXTERNAL_GLOB $(OBJOUT_FLAG)$@ ..\$(*B).c
eb480a0b 1008
852c2e52 1009$(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
eb480a0b 1010 $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*B).c
1011
7766f137 1012# -DPERL_IMPLICIT_SYS needs C++ for perllib.c
5db10396 1013# rules wrapped in .IFs break Win9X build (we end up with unbalanced []s unless
1014# unless the .IF is true), so instead we use a .ELSE with the default
7766f137 1015perllib$(o) : perllib.c
5db10396 1016.IF "$(USE_IMP_SYS)$(USE_OBJECT)" == "defineundef"
7766f137 1017 $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
5db10396 1018.ELSE
1019 $(CC) -c -I. $(CFLAGS_O) $(OBJOUT_FLAG)$@ perllib.c
7766f137 1020.ENDIF
1021
852c2e52 1022# 1. we don't want to rebuild miniperl.exe when config.h changes
1023# 2. we don't want to rebuild miniperl.exe with non-default config.h
1024$(MINI_OBJ) : $(CORE_NOCFG_H)
1025
eb480a0b 1026$(WIN32_OBJ) : $(CORE_H)
1027$(CORE_OBJ) : $(CORE_H)
eb480a0b 1028$(DLL_OBJ) : $(CORE_H)
1029$(PERL95_OBJ) : $(CORE_H)
1030$(X2P_OBJ) : $(CORE_H)
08aa1457 1031
549a6b10 1032perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl
e2207946 1033 $(MINIPERL) -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) \
1034 $(BUILDOPT) CCTYPE=$(CCTYPE) > perldll.def
08aa1457 1035
fd9459bc 1036$(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES)
08aa1457 1037.IF "$(CCTYPE)" == "BORLAND"
e2207946 1038 $(LINK32) -Tpd -ap $(BLINK_FLAGS) \
eb480a0b 1039 @$(mktmp c0d32$(o) $(PERLDLL_OBJ:s,\,\\)\n \
08aa1457 1040 $@,\n \
1041 $(LIBFILES)\n \
1042 perldll.def\n)
1043 $(IMPLIB) $*.lib $@
d56e6723 1044.ELIF "$(CCTYPE)" == "GCC"
e2207946 1045 $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(BLINK_FLAGS) \
eb480a0b 1046 $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
d56e6723 1047 dlltool --output-lib $(PERLIMPLIB) \
5db10396 1048 --dllname $(PERLDLL:b).dll \
1049 --def perldll.def \
1050 --base-file perl.base \
1051 --output-exp perl.exp
e2207946 1052 $(LINK32) -mdll -o $@ $(BLINK_FLAGS) \
eb480a0b 1053 $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) \
1054 perl.exp $(LKPOST))
08aa1457 1055.ELSE
1056 $(LINK32) -dll -def:perldll.def -out:$@ \
fd9459bc 1057 @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(PERLDLL_RES) $(PERLDLL_OBJ:s,\,\\))
08aa1457 1058.ENDIF
d07c2202 1059 $(XCOPY) $(PERLIMPLIB) $(COREDIR)
08aa1457 1060
08aa1457 1061$(MINIMOD) : $(MINIPERL) ..\minimod.pl
1062 cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
1063
eb480a0b 1064..\x2p\a2p$(o) : ..\x2p\a2p.c
1065 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\a2p.c
1066
1067..\x2p\hash$(o) : ..\x2p\hash.c
1068 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\hash.c
1069
1070..\x2p\str$(o) : ..\x2p\str.c
1071 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\str.c
1072
1073..\x2p\util$(o) : ..\x2p\util.c
1074 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\util.c
1075
1076..\x2p\walk$(o) : ..\x2p\walk.c
1077 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\walk.c
1078
1079$(X2P) : $(MINIPERL) $(X2P_OBJ)
d07c2202 1080 $(MINIPERL) ..\x2p\find2perl.PL
1081 $(MINIPERL) ..\x2p\s2p.PL
1082.IF "$(CCTYPE)" == "BORLAND"
7a958ec3 1083 $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
d07c2202 1084 @$(mktmp c0x32$(o) $(X2P_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
1085.ELIF "$(CCTYPE)" == "GCC"
7a958ec3 1086 $(LINK32) -v -o $@ $(BLINK_FLAGS) \
d07c2202 1087 $(mktmp $(LKPRE) $(X2P_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
1088.ELSE
1089 $(LINK32) -subsystem:console -out:$@ \
7a958ec3 1090 @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(X2P_OBJ:s,\,\\))
d07c2202 1091.ENDIF
1092
08aa1457 1093perlmain.c : runperl.c
1094 copy runperl.c perlmain.c
1095
d56e6723 1096perlmain$(o) : perlmain.c
8957be0a 1097 $(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c
08aa1457 1098
fd9459bc 1099$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES)
08aa1457 1100.IF "$(CCTYPE)" == "BORLAND"
7a958ec3 1101 $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
8957be0a 1102 @$(mktmp c0x32$(o) $(PERLEXE_OBJ:s,\,\\)\n \
1103 $(@:s,\,\\),\n \
08aa1457 1104 $(PERLIMPLIB) $(LIBFILES)\n)
d56e6723 1105.ELIF "$(CCTYPE)" == "GCC"
5db10396 1106 $(LINK32) -mconsole -o $@ $(BLINK_FLAGS) \
eb480a0b 1107 $(PERLEXE_OBJ) $(PERLIMPLIB) $(LIBFILES)
08aa1457 1108.ELSE
7a958ec3 1109 $(LINK32) -subsystem:console -out:$@ $(BLINK_FLAGS) $(LIBFILES) \
fd9459bc 1110 $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES)
7766f137 1111 copy $(PERLEXE) $(WPERLEXE)
1112 editbin /subsystem:windows $(WPERLEXE)
08aa1457 1113.ENDIF
1114 copy splittree.pl ..
eb480a0b 1115 $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
08aa1457 1116
1117.IF "$(CCTYPE)" != "BORLAND"
d56e6723 1118.IF "$(CCTYPE)" != "GCC"
f7aeb604 1119.IF "$(USE_PERLCRT)" != "define"
08aa1457 1120
1121perl95.c : runperl.c
1122 copy runperl.c perl95.c
1123
d56e6723 1124perl95$(o) : perl95.c
eb480a0b 1125 $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c perl95.c
08aa1457 1126
d56e6723 1127win32sckmt$(o) : win32sck.c
eb480a0b 1128 $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
1129 $(OBJOUT_FLAG)win32sckmt$(o) win32sck.c
fb73857a 1130
d56e6723 1131win32mt$(o) : win32.c
eb480a0b 1132 $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
1133 $(OBJOUT_FLAG)win32mt$(o) win32.c
fb73857a 1134
ac4c12e7 1135DynaLoadmt$(o) : $(DYNALOADER).c
1136 $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
1137 $(OBJOUT_FLAG)DynaLoadmt$(o) $(DYNALOADER).c
fb73857a 1138
1139$(PERL95EXE): $(PERLDLL) $(CONFIGPM) $(PERL95_OBJ)
7a958ec3 1140 $(LINK32) -subsystem:console -nodefaultlib -out:$@ $(BLINK_FLAGS) \
baed7233 1141 $(LIBBASEFILES) $(PERL95_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) \
1142 libcmt.lib
08aa1457 1143
1144.ENDIF
d56e6723 1145.ENDIF
e7083a8c 1146.ENDIF
08aa1457 1147
1148$(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
eb480a0b 1149 if not exist $(AUTODIR) mkdir $(AUTODIR)
bfab39a2 1150 cd $(EXTDIR)\$(*B) && ..\$(MINIPERL) -I..\..\lib $(*B)_pm.PL
8454a2ba 1151 cd $(EXTDIR)\$(*B) && ..\$(MINIPERL) -I..\..\lib XSLoader_pm.PL
08aa1457 1152 $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
8454a2ba 1153 $(XCOPY) $(EXTDIR)\$(*B)\XSLoader.pm $(LIBDIR)\$(NULL)
08aa1457 1154 cd $(EXTDIR)\$(*B) && $(XSUBPP) dl_win32.xs > $(*B).c
1155 $(XCOPY) $(EXTDIR)\$(*B)\dlutils.c .
1156
1157$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
1158 copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
1159
823edd99 1160$(DUMPER_DLL): $(PERLEXE) $(DUMPER).xs
1161 cd $(EXTDIR)\Data\$(*B) && \
1162 ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
1163 cd $(EXTDIR)\Data\$(*B) && $(MAKE)
1164
38b3a85b 1165$(DPROF_DLL): $(PERLEXE) $(DPROF).xs
1166 cd $(EXTDIR)\Devel\$(*B) && \
1167 ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
1168 cd $(EXTDIR)\Devel\$(*B) && $(MAKE)
1169
4f49e16e 1170$(GLOB_DLL): $(PERLEXE) $(GLOB).xs
1171 cd $(EXTDIR)\File\$(*B) && \
1172 ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
1173 cd $(EXTDIR)\File\$(*B) && $(MAKE)
1174
35ef4773 1175$(PEEK_DLL): $(PERLEXE) $(PEEK).xs
3967c732 1176 cd $(EXTDIR)\Devel\$(*B) && \
1177 ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
1178 cd $(EXTDIR)\Devel\$(*B) && $(MAKE)
1179
15e52e56 1180$(RE_DLL): $(PERLEXE) $(RE).xs
1181 cd $(EXTDIR)\$(*B) && \
1182 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1183 cd $(EXTDIR)\$(*B) && $(MAKE)
1184
2a321948 1185$(B_DLL): $(PERLEXE) $(B).xs
1186 cd $(EXTDIR)\$(*B) && \
1187 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1188 cd $(EXTDIR)\$(*B) && $(MAKE)
1189
a98bd6f4 1190$(THREAD_DLL): $(PERLEXE) $(THREAD).xs
1191 cd $(EXTDIR)\$(*B) && \
1192 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1193 cd $(EXTDIR)\$(*B) && $(MAKE)
1194
5d925967 1195$(ATTRS_DLL): $(PERLEXE) $(ATTRS).xs
1196 cd $(EXTDIR)\$(*B) && \
1197 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1198 cd $(EXTDIR)\$(*B) && $(MAKE)
1199
6dead956 1200$(POSIX_DLL): $(PERLEXE) $(POSIX).xs
1201 cd $(EXTDIR)\$(*B) && \
1202 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1203 cd $(EXTDIR)\$(*B) && $(MAKE)
1204
5d925967 1205$(IO_DLL): $(PERLEXE) $(IO).xs
08aa1457 1206 cd $(EXTDIR)\$(*B) && \
1207 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1208 cd $(EXTDIR)\$(*B) && $(MAKE)
1209
1210$(SDBM_FILE_DLL) : $(PERLEXE) $(SDBM_FILE).xs
1211 cd $(EXTDIR)\$(*B) && \
1212 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1213 cd $(EXTDIR)\$(*B) && $(MAKE)
1214
1215$(FCNTL_DLL): $(PERLEXE) $(FCNTL).xs
1216 cd $(EXTDIR)\$(*B) && \
1217 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1218 cd $(EXTDIR)\$(*B) && $(MAKE)
1219
1220$(OPCODE_DLL): $(PERLEXE) $(OPCODE).xs
1221 cd $(EXTDIR)\$(*B) && \
1222 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1223 cd $(EXTDIR)\$(*B) && $(MAKE)
1224
5d925967 1225$(SOCKET_DLL): $(PERLEXE) $(SOCKET).xs
08aa1457 1226 cd $(EXTDIR)\$(*B) && \
1227 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1228 cd $(EXTDIR)\$(*B) && $(MAKE)
1229
b295d113 1230$(BYTELOADER_DLL): $(PERLEXE) $(BYTELOADER).xs
1231 cd $(EXTDIR)\$(*B) && \
1232 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1233 cd $(EXTDIR)\$(*B) && $(MAKE)
1234
eab60bb1 1235$(ERRNO_PM): $(PERLEXE) $(ERRNO)_pm.PL
1236 cd $(EXTDIR)\$(*B) && \
1237 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1238 cd $(EXTDIR)\$(*B) && $(MAKE)
1239
08aa1457 1240doc: $(PERLEXE)
d07c2202 1241 $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=./html \
b3b61bd8 1242 --podpath=pod:lib:ext:utils --htmlroot="file://$(INST_HTML:s,:,|,)"\
08aa1457 1243 --libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse
1244
4a71ed0c 1245utils: $(PERLEXE) $(X2P)
08aa1457 1246 cd ..\utils && $(MAKE) PERL=$(MINIPERL)
66aa1127 1247 copy ..\README.win32 ..\pod\perlwin32.pod
4a71ed0c 1248 cd ..\pod && $(MAKE) -f ..\win32\pod.mak converters
1249 $(PERLEXE) $(PL2BAT) $(UTILS)
08aa1457 1250
1251distclean: clean
dc050285 1252 -del /f $(MINIPERL) $(PERLEXE) $(PERL95EXE) $(PERLDLL) $(GLOBEXE) \
eda5ff31 1253 $(PERLIMPLIB) ..\miniperl$(a) $(MINIMOD)
08aa1457 1254 -del /f *.def *.map
eab60bb1 1255 -del /f $(EXTENSION_DLL) $(EXTENSION_PM)
1256 -del /f $(EXTENSION_C) $(DYNALOADER).c $(ERRNO).pm
eb480a0b 1257 -del /f $(EXTDIR)\DynaLoader\dl_win32.xs
1258 -del /f $(LIBDIR)\.exists $(LIBDIR)\attrs.pm $(LIBDIR)\DynaLoader.pm
8454a2ba 1259 -del /f $(LIBDIR)\XSLoader.pm
eb480a0b 1260 -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
1261 -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm $(LIBDIR)\Thread.pm
1262 -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
15e52e56 1263 -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
b295d113 1264 -del /f $(LIBDIR)\Data\Dumper.pm $(LIBDIR)\ByteLoader.pm
38b3a85b 1265 -del /f $(LIBDIR)\Devel\Peek.pm $(LIBDIR)\Devel\DProf.pm
4f49e16e 1266 -del /f $(LIBDIR)\File\Glob.pm
eb480a0b 1267 -rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO
1268 -rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread
1269 -rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B
823edd99 1270 -rmdir /s /q $(LIBDIR)\Data || rmdir /s $(LIBDIR)\Data
08aa1457 1271 -del /f $(PODDIR)\*.html
1272 -del /f $(PODDIR)\*.bat
22c35a8c 1273 -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc \
5920a0ba 1274 dprofpp *.bat
eb480a0b 1275 -cd ..\x2p && del /f find2perl s2p *.bat
d444a431 1276 -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
eb480a0b 1277 -del /f $(CONFIGPM)
d444a431 1278.IF "$(PERL95EXE)" != ""
1279 -del /f perl95.c
1280.ENDIF
1281 -del /f bin\*.bat
22c35a8c 1282 -cd $(EXTDIR) && del /s *$(a) *.def *.map *.pdb *.bs Makefile *$(o) \
1283 pm_to_blib
eb480a0b 1284 -rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR)
d07c2202 1285 -rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR)
08aa1457 1286
4a71ed0c 1287install : all installbare installhtml
6dead956 1288
7a958ec3 1289installbare : $(RIGHTMAKE) utils
d07c2202 1290 $(PERLEXE) ..\installperl
08aa1457 1291.IF "$(PERL95EXE)" != ""
1292 $(XCOPY) $(PERL95EXE) $(INST_BIN)\*.*
1293.ENDIF
7766f137 1294 if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\*.*
08aa1457 1295 $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
e5a95ffb 1296 $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.*
6dead956 1297
1298installhtml : doc
08aa1457 1299 $(RCOPY) html\*.* $(INST_HTML)\*.*
1300
1301inst_lib : $(CONFIGPM)
1302 copy splittree.pl ..
eb480a0b 1303 $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
08aa1457 1304 $(RCOPY) ..\lib $(INST_LIB)\*.*
1305
dfb634a9 1306minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) utils
08aa1457 1307 $(XCOPY) $(MINIPERL) ..\t\perl.exe
1308.IF "$(CCTYPE)" == "BORLAND"
1309 $(XCOPY) $(GLOBBAT) ..\t\$(NULL)
1310.ELSE
1311 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1312.ENDIF
1313 attrib -r ..\t\*.*
1314 copy test ..\t
1315 cd ..\t && \
1316 $(MINIPERL) -I..\lib test base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t
1317
dfb634a9 1318test-prep : all utils
08aa1457 1319 $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1320 $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1321.IF "$(CCTYPE)" == "BORLAND"
1322 $(XCOPY) $(GLOBBAT) ..\t\$(NULL)
1323.ELSE
1324 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1325.ENDIF
32f822de 1326
7a958ec3 1327test : $(RIGHTMAKE) test-prep
08aa1457 1328 cd ..\t && $(PERLEXE) -I..\lib harness
1329
32f822de 1330test-notty : test-prep
1331 set PERL_SKIP_TTY_TEST=1 && \
1332 cd ..\t && $(PERLEXE) -I.\lib harness
1333
08aa1457 1334clean :
d56e6723 1335 -@erase miniperlmain$(o)
08aa1457 1336 -@erase $(MINIPERL)
d56e6723 1337 -@erase perlglob$(o)
1338 -@erase perlmain$(o)
08aa1457 1339 -@erase config.w32
1340 -@erase /f config.h
1341 -@erase $(GLOBEXE)
1342 -@erase $(PERLEXE)
7766f137 1343 -@erase $(WPERLEXE)
08aa1457 1344 -@erase $(PERLDLL)
1345 -@erase $(CORE_OBJ)
eb480a0b 1346 -rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR)
08aa1457 1347 -@erase $(WIN32_OBJ)
1348 -@erase $(DLL_OBJ)
d07c2202 1349 -@erase $(X2P_OBJ)
c5be433b 1350 -@erase ..\*$(o) ..\*$(a) ..\*.exp *$(o) *$(a) *.exp *.res
d444a431 1351 -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
d07c2202 1352 -@erase ..\x2p\*.exe ..\x2p\*.bat
08aa1457 1353 -@erase *.ilk
1354 -@erase *.pdb