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