This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
intuit @INC pathnames from exe location only if dll location
[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.
193fb0af 22INST_VER = \5.00467
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
852c2e52 245MICROCORE_SRC = \
eb480a0b
GS
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 273!IF "$(CRYPT_SRC)" != ""
852c2e52 274MICROCORE_SRC = $(MICROCORE_SRC) ..\$(CRYPT_SRC)
a1dd9325 275!ENDIF
eb480a0b
GS
276
277!IF "$(PERL_MALLOC)" == "define"
852c2e52 278EXTRACORE_SRC = $(EXTRACORE_SRC) ..\malloc.c
eb480a0b
GS
279!ENDIF
280
281!IF "$(OBJECT)" == ""
852c2e52 282EXTRACORE_SRC = $(EXTRACORE_SRC) ..\perlio.c
eb480a0b
GS
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
852c2e52 316CORE_NOCFG_H = \
eb480a0b
GS
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 \
eb480a0b
GS
346 ..\EXTERN.h \
347 ..\perlvars.h \
348 ..\intrpvar.h \
349 ..\thrdvar.h \
350 .\include\dirent.h \
351 .\include\netdb.h \
352 .\include\sys\socket.h \
353 .\win32.h
354
852c2e52
GS
355CORE_H = $(CORE_NOCFG_H) .\config.h
356
357MICROCORE_OBJ = $(MICROCORE_SRC:.c=.obj)
358CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:.c=.obj)
eb480a0b 359WIN32_OBJ = $(WIN32_SRC:.c=.obj)
852c2e52
GS
360MINICORE_OBJ = $(MICROCORE_OBJ:..\=.\mini\) \
361 $(MINIDIR)\miniperlmain$(o) \
362 $(MINIDIR)\perlio$(o)
eb480a0b
GS
363MINIWIN32_OBJ = $(WIN32_OBJ:.\=.\mini\)
364MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
af883608 365PERL95_OBJ = $(PERL95_SRC:.c=.obj)
eb480a0b
GS
366DLL_OBJ = $(DLL_SRC:.c=.obj)
367X2P_OBJ = $(X2P_SRC:.c=.obj)
368
eb480a0b
GS
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
852c2e52
GS
461all : .\config.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) $(PERL95EXE) \
462 $(CAPILIB) $(X2P) $(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
852c2e52 515$(MINICORE_OBJ) : $(CORE_NOCFG_H)
eb480a0b
GS
516 $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ ..\$(*F).c
517
852c2e52 518$(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
eb480a0b
GS
519 $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*F).c
520
852c2e52
GS
521# 1. we don't want to rebuild miniperl.exe when config.h changes
522# 2. we don't want to rebuild miniperl.exe with non-default config.h
523$(MINI_OBJ) : $(CORE_NOCFG_H)
524
eb480a0b
GS
525$(WIN32_OBJ) : $(CORE_H)
526$(CORE_OBJ) : $(CORE_H)
eb480a0b
GS
527$(DLL_OBJ) : $(CORE_H)
528$(PERL95_OBJ) : $(CORE_H)
529$(X2P_OBJ) : $(CORE_H)
0a753a76 530
910dfcc8 531perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym makedef.pl
eb480a0b 532 $(MINIPERL) -w makedef.pl $(OPTIMIZE) $(DEFINES) $(OBJECT) \
910dfcc8 533 CCTYPE=$(CCTYPE) > perldll.def
0a753a76 534
eb480a0b 535$(PERLDLL): perldll.def $(PERLDLL_OBJ)
137443ea 536 $(LINK32) -dll -def:perldll.def -out:$@ @<<
eb480a0b 537 $(LINK_FLAGS) $(LIBFILES) $(PERLDLL_OBJ)
137443ea 538<<
d07c2202 539 $(XCOPY) $(PERLIMPLIB) $(COREDIR)
137443ea
PP
540
541perl.def : $(MINIPERL) makeperldef.pl
542 $(MINIPERL) -I..\lib makeperldef.pl $(NULL) > perl.def
543
83437bec
NIS
544$(MINIMOD) : $(MINIPERL) ..\minimod.pl
545 cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
546
eb480a0b
GS
547..\x2p\a2p$(o) : ..\x2p\a2p.c
548 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\a2p.c
549
550..\x2p\hash$(o) : ..\x2p\hash.c
551 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\hash.c
552
553..\x2p\str$(o) : ..\x2p\str.c
554 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\str.c
555
556..\x2p\util$(o) : ..\x2p\util.c
557 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\util.c
558
559..\x2p\walk$(o) : ..\x2p\walk.c
560 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\walk.c
561
562$(X2P) : $(MINIPERL) $(X2P_OBJ)
563 $(MINIPERL) ..\x2p\find2perl.PL
564 $(MINIPERL) ..\x2p\s2p.PL
d07c2202 565 $(LINK32) -subsystem:console -out:$@ @<<
eb480a0b 566 $(LINK_FLAGS) $(LIBFILES) $(X2P_OBJ)
d07c2202
GS
567<<
568
83437bec 569perlmain.c : runperl.c
0a753a76 570 copy runperl.c perlmain.c
137443ea 571
d56e6723 572perlmain$(o) : perlmain.c
8957be0a 573 $(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c
137443ea 574
eb480a0b
GS
575$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ)
576 $(LINK32) -subsystem:console -out:$@ $(LINK_FLAGS) $(LIBFILES) \
577 $(PERLEXE_OBJ) $(PERLIMPLIB)
0a753a76 578 copy splittree.pl ..
eb480a0b 579 $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
0a753a76 580
3e3baf6d
TB
581perl95.c : runperl.c
582 copy runperl.c perl95.c
583
d56e6723 584perl95$(o) : perl95.c
eb480a0b 585 $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c perl95.c
3e3baf6d 586
d56e6723 587win32sckmt$(o) : win32sck.c
eb480a0b
GS
588 $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
589 $(OBJOUT_FLAG)win32sckmt$(o) win32sck.c
fb73857a 590
d56e6723 591win32mt$(o) : win32.c
eb480a0b
GS
592 $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
593 $(OBJOUT_FLAG)win32mt$(o) win32.c
fb73857a 594
ac4c12e7
GS
595DynaLoadmt$(o) : $(DYNALOADER).c
596 $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
597 $(OBJOUT_FLAG)DynaLoadmt$(o) $(DYNALOADER).c
c69f6586 598
fb73857a 599$(PERL95EXE): $(PERLDLL) $(CONFIGPM) $(PERL95_OBJ)
eb480a0b
GS
600 $(LINK32) -subsystem:console -nodefaultlib -out:$@ $(LINK_FLAGS) \
601 $(LIBFILES) $(PERL95_OBJ) $(PERLIMPLIB) libcmt.lib
3e3baf6d 602
137443ea 603$(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
eb480a0b 604 if not exist $(AUTODIR) mkdir $(AUTODIR)
a1dd9325 605 cd $(EXTDIR)\$(*B)
bfab39a2 606 ..\$(MINIPERL) -I..\..\lib $(*B)_pm.PL
a1dd9325 607 cd ..\..\win32
68dc0745
PP
608 $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
609 cd $(EXTDIR)\$(*B)
610 $(XSUBPP) dl_win32.xs > $(*B).c
0a753a76
PP
611 cd ..\..\win32
612
e3b8966e
GS
613!IF "$(OBJECT)" == "-DPERL_OBJECT"
614PerlCAPI.cpp : $(MINIPERL)
615 $(MINIPERL) GenCAPI.pl $(COREDIR)
616
617PerlCAPI$(o) : PerlCAPI.cpp
d17537aa 618 $(CC) $(CFLAGS_O) $(RUNTIME) -UPERLDLL -c \
e3b8966e
GS
619 $(OBJOUT_FLAG)PerlCAPI$(o) PerlCAPI.cpp
620
621$(CAPILIB) : PerlCAPI.cpp PerlCAPI$(o)
622 lib /OUT:$(CAPILIB) PerlCAPI$(o)
623!ENDIF
624
68dc0745
PP
625$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
626 copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
0a753a76 627
2a321948 628$(B_DLL): $(PERLEXE) $(B).xs
a98bd6f4
GS
629 cd $(EXTDIR)\$(*B)
630 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
631 $(MAKE)
632 cd ..\..\win32
633
d55594ae 634$(THREAD_DLL): $(PERLEXE) $(THREAD).xs
059e4e88
GS
635 cd $(EXTDIR)\$(*B)
636 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
637 $(MAKE)
638 cd ..\..\win32
639
2a321948
GS
640$(ATTRS_DLL): $(PERLEXE) $(ATTRS).xs
641 cd $(EXTDIR)\$(*B)
642 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
643 $(MAKE)
644 cd ..\..\win32
d55594ae 645
6dead956
GS
646$(POSIX_DLL): $(PERLEXE) $(POSIX).xs
647 cd $(EXTDIR)\$(*B)
648 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
649 $(MAKE)
650 cd ..\..\win32
651
eb480a0b 652$(IO_DLL): $(PERLEXE) $(IO).xs
68dc0745 653 cd $(EXTDIR)\$(*B)
137443ea
PP
654 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
655 $(MAKE)
0a753a76
PP
656 cd ..\..\win32
657
137443ea 658$(SDBM_FILE_DLL) : $(PERLEXE) $(SDBM_FILE).xs
68dc0745 659 cd $(EXTDIR)\$(*B)
137443ea
PP
660 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
661 $(MAKE)
68dc0745 662 cd ..\..\win32
0a753a76 663
137443ea 664$(FCNTL_DLL): $(PERLEXE) $(FCNTL).xs
68dc0745 665 cd $(EXTDIR)\$(*B)
137443ea
PP
666 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
667 $(MAKE)
0a753a76
PP
668 cd ..\..\win32
669
137443ea 670$(OPCODE_DLL): $(PERLEXE) $(OPCODE).xs
68dc0745 671 cd $(EXTDIR)\$(*B)
137443ea
PP
672 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
673 $(MAKE)
68dc0745 674 cd ..\..\win32
0a753a76 675
059e4e88 676$(SOCKET_DLL): $(PERLEXE) $(SOCKET).xs
68dc0745 677 cd $(EXTDIR)\$(*B)
137443ea
PP
678 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
679 $(MAKE)
0a753a76
PP
680 cd ..\..\win32
681
68dc0745 682doc: $(PERLEXE)
84902520
TB
683 cd ..\pod
684 $(MAKE) -f ..\win32\pod.mak checkpods pod2html pod2latex \
685 pod2man pod2text
686 $(XCOPY) *.bat ..\win32\bin\*.*
687 cd ..\win32
3e3baf6d 688 copy ..\README.win32 ..\pod\perlwin32.pod
d07c2202 689 $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=./html \
b3b61bd8 690 --podpath=pod:lib:ext:utils --htmlroot="file://$(INST_HTML::=|)" \
3e3baf6d 691 --libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse
68dc0745 692
3fe9a6f1
PP
693utils: $(PERLEXE)
694 cd ..\utils
eb480a0b 695 $(MAKE) PERL=$(MINIPERL)
d07c2202 696 $(PERLEXE) -I..\lib ..\win32\$(PL2BAT) h2ph splain perlbug pl2pm c2ph
d444a431 697 $(PERLEXE) ..\win32\$(PL2BAT) h2xs perldoc pstruct
3fe9a6f1
PP
698 $(XCOPY) *.bat ..\win32\bin\*.*
699 cd ..\win32
d444a431 700 $(PERLEXE) $(PL2BAT) bin\network.pl bin\www.pl bin\runperl.pl \
dfb634a9 701 bin\pl2bat.pl bin\perlglob.pl
3fe9a6f1 702
137443ea 703distclean: clean
dc050285 704 -del /f $(MINIPERL) $(PERLEXE) $(PERL95EXE) $(PERLDLL) $(GLOBEXE) \
83437bec 705 $(PERLIMPLIB) ..\miniperl.lib $(MINIMOD)
3e3baf6d 706 -del /f *.def *.map
eb480a0b
GS
707 -del /f $(EXTENSION_DLL)
708 -del /f $(EXTENSION_C) $(DYNALOADER).c
709 -del /f $(EXTDIR)\DynaLoader\dl_win32.xs
710 -del /f $(LIBDIR)\.exists $(LIBDIR)\attrs.pm $(LIBDIR)\DynaLoader.pm
711 -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
712 -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm $(LIBDIR)\Thread.pm
713 -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
714 -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm
715 -rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO
716 -rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread
717 -rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B
68dc0745
PP
718 -del /f $(PODDIR)\*.html
719 -del /f $(PODDIR)\*.bat
eb480a0b
GS
720 cd ..\utils
721 -del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc pstruct
722 -del /f *.bat
723 cd ..\win32
724 cd ..\x2p
725 -del /f find2perl s2p
726 -del /f *.bat
727 cd ..\win32
728 -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
729 -del /f $(CONFIGPM)
730 -del /f perl95.c
d444a431 731 -del /f bin\*.bat
3e3baf6d 732 cd $(EXTDIR)
d56e6723 733 -del /s *.lib *.def *.map *.bs Makefile *$(o) pm_to_blib
3e3baf6d 734 cd ..\win32
eb480a0b
GS
735 -rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR)
736 -rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR)
68dc0745 737
6dead956
GS
738install : all installbare installutils installhtml
739
740installbare :
d07c2202 741 $(PERLEXE) ..\installperl
3e3baf6d 742 $(XCOPY) $(PERL95EXE) $(INST_BIN)\*.*
6dead956
GS
743
744installutils : utils
68dc0745 745 $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
e5a95ffb
GS
746 $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.*
747 $(XCOPY) ..\pod\*.bat $(INST_SCRIPT)\*.*
6dead956
GS
748
749installhtml : doc
3e3baf6d 750 $(RCOPY) html\*.* $(INST_HTML)\*.*
68dc0745 751
137443ea 752inst_lib : $(CONFIGPM)
68dc0745 753 copy splittree.pl ..
eb480a0b 754 $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
c90c0ff4 755 $(RCOPY) ..\lib $(INST_LIB)\*.*
0a753a76 756
dfb634a9 757minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) utils
137443ea
PP
758 $(XCOPY) $(MINIPERL) ..\t\perl.exe
759 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
760 attrib -r ..\t\*.*
761 copy test ..\t
762 cd ..\t
763 $(MINIPERL) -I..\lib test base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t
764 cd ..\win32
765
dfb634a9 766test-prep : all utils
68dc0745
PP
767 $(XCOPY) $(PERLEXE) ..\t\$(NULL)
768 $(XCOPY) $(PERLDLL) ..\t\$(NULL)
769 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
fb73857a
PP
770
771test : test-prep
772 cd ..\t
773 $(PERLEXE) -I..\lib harness
774 cd ..\win32
775
776test-notty : test-prep
777 set PERL_SKIP_TTY_TEST=1
137443ea
PP
778 cd ..\t
779 $(PERLEXE) -I..\lib harness
68dc0745 780 cd ..\win32
137443ea
PP
781
782clean :
d56e6723 783 -@erase miniperlmain$(o)
137443ea 784 -@erase $(MINIPERL)
d56e6723
GS
785 -@erase perlglob$(o)
786 -@erase perlmain$(o)
3e3baf6d
TB
787 -@erase config.w32
788 -@erase /f config.h
e3b8966e 789 -@erase PerlCAPI.cpp
137443ea
PP
790 -@erase $(GLOBEXE)
791 -@erase $(PERLEXE)
792 -@erase $(PERLDLL)
793 -@erase $(CORE_OBJ)
e3b8966e 794 -@erase $(CAPILIB)
eb480a0b 795 -rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR)
137443ea
PP
796 -@erase $(WIN32_OBJ)
797 -@erase $(DLL_OBJ)
d07c2202 798 -@erase $(X2P_OBJ)
d56e6723 799 -@erase ..\*$(o) ..\*.lib ..\*.exp *$(o) *.lib *.exp
d444a431 800 -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
d07c2202 801 -@erase ..\x2p\*.exe ..\x2p\*.bat
137443ea
PP
802 -@erase *.ilk
803 -@erase *.pdb