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