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