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