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