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