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