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