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