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