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