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