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