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