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