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