This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
UNOP opclass test in B.xs
[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#
0b2be3f5 28INST_VER = \5.00470
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
15e52e56 451DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re
eb480a0b 452STATIC_EXT = DynaLoader
eab60bb1 453NONXS_EXT = Errno
eb480a0b
GS
454
455DYNALOADER = $(EXTDIR)\DynaLoader\DynaLoader
456SOCKET = $(EXTDIR)\Socket\Socket
457FCNTL = $(EXTDIR)\Fcntl\Fcntl
458OPCODE = $(EXTDIR)\Opcode\Opcode
459SDBM_FILE = $(EXTDIR)\SDBM_File\SDBM_File
460IO = $(EXTDIR)\IO\IO
461POSIX = $(EXTDIR)\POSIX\POSIX
462ATTRS = $(EXTDIR)\attrs\attrs
463THREAD = $(EXTDIR)\Thread\Thread
464B = $(EXTDIR)\B\B
15e52e56 465RE = $(EXTDIR)\RE\RE
eab60bb1 466ERRNO = $(EXTDIR)\Errno\Errno
eb480a0b
GS
467
468SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll
469FCNTL_DLL = $(AUTODIR)\Fcntl\Fcntl.dll
470OPCODE_DLL = $(AUTODIR)\Opcode\Opcode.dll
471SDBM_FILE_DLL = $(AUTODIR)\SDBM_File\SDBM_File.dll
472IO_DLL = $(AUTODIR)\IO\IO.dll
473POSIX_DLL = $(AUTODIR)\POSIX\POSIX.dll
474ATTRS_DLL = $(AUTODIR)\attrs\attrs.dll
475THREAD_DLL = $(AUTODIR)\Thread\Thread.dll
476B_DLL = $(AUTODIR)\B\B.dll
15e52e56 477RE_DLL = $(AUTODIR)\re\re.dll
eb480a0b 478
eab60bb1
GS
479ERRNO_PM = $(LIBDIR)\Errno.pm
480
eb480a0b
GS
481EXTENSION_C = \
482 $(SOCKET).c \
483 $(FCNTL).c \
484 $(OPCODE).c \
485 $(SDBM_FILE).c \
486 $(IO).c \
487 $(POSIX).c \
488 $(ATTRS).c \
489 $(THREAD).c \
15e52e56 490 $(RE).c \
eb480a0b
GS
491 $(B).c
492
493EXTENSION_DLL = \
494 $(SOCKET_DLL) \
495 $(FCNTL_DLL) \
496 $(OPCODE_DLL) \
497 $(SDBM_FILE_DLL)\
498 $(IO_DLL) \
499 $(POSIX_DLL) \
51aa15f3
GS
500 $(ATTRS_DLL) \
501 $(B_DLL)
26ca90b6 502
eab60bb1
GS
503EXTENSION_PM = \
504 $(ERRNO_PM)
505
26ca90b6
GS
506!IF "$(OBJECT)" == ""
507EXTENSION_DLL = \
508 $(EXTENSION_DLL)\
15e52e56
GS
509 $(THREAD_DLL) \
510 $(RE_DLL)
26ca90b6 511!ENDIF
eb480a0b
GS
512
513POD2HTML = $(PODDIR)\pod2html
514POD2MAN = $(PODDIR)\pod2man
515POD2LATEX = $(PODDIR)\pod2latex
516POD2TEXT = $(PODDIR)\pod2text
517
518CFG_VARS = \
519 "INST_DRV=$(INST_DRV)" \
520 "INST_TOP=$(INST_TOP)" \
e5a95ffb 521 "INST_VER=$(INST_VER)" \
eb480a0b
GS
522 "archname=$(ARCHNAME)" \
523 "cc=$(CC)" \
ac4c12e7 524 "ccflags=$(OPTIMIZE) $(DEFINES) $(OBJECT)" \
eb480a0b
GS
525 "cf_email=$(EMAIL)" \
526 "d_crypt=$(D_CRYPT)" \
527 "d_mymalloc=$(PERL_MALLOC)" \
528 "libs=$(LIBFILES)" \
529 "incpath=$(CCINCDIR)" \
5fd76c3e 530 "libperl=$(PERLIMPLIB:..\=)" \
fa4efe8e 531 "libpth=$(CCLIBDIR) $(EXTRALIBDIRS)" \
eb480a0b
GS
532 "libc=$(LIBC)" \
533 "make=nmake" \
534 "static_ext=$(STATIC_EXT)" \
535 "dynamic_ext=$(DYNAMIC_EXT)" \
eab60bb1 536 "nonxs_ext=$(NONXS_EXT)" \
eb480a0b
GS
537 "usethreads=$(USE_THREADS)" \
538 "LINK_FLAGS=$(LINK_FLAGS)" \
539 "optimize=$(OPTIMIZE)"
924b3ec4 540
137443ea
PP
541#
542# Top targets
543#
0a753a76 544
852c2e52 545all : .\config.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) $(PERL95EXE) \
eab60bb1 546 $(CAPILIB) $(X2P) $(EXTENSION_DLL) $(EXTENSION_PM)
0a753a76 547
d56e6723 548$(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
0a753a76 549
137443ea 550#------------------------------------------------------------
0a753a76 551
eb480a0b 552$(GLOBEXE) : perlglob$(o)
dc050285 553 $(LINK32) $(LINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
d56e6723 554 perlglob$(o) setargv$(o)
0a753a76 555
d56e6723 556perlglob$(o) : perlglob.c
137443ea 557
3e3baf6d
TB
558config.w32 : $(CFGSH_TMPL)
559 copy $(CFGSH_TMPL) config.w32
560
d55594ae 561.\config.h : $(CFGH_TMPL)
3e3baf6d
TB
562 -del /f config.h
563 copy $(CFGH_TMPL) config.h
564
137443ea 565..\config.sh : config.w32 $(MINIPERL) config_sh.PL
924b3ec4 566 $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) config.w32 > ..\config.sh
137443ea 567
ac4c12e7
GS
568# this target is for when changes to the main config.sh happen
569# edit config.{b,v,g}c and make this target once for each supported
570# compiler (e.g. `dmake CCTYPE=BORLAND regen_config_h`)
571regen_config_h:
572 perl config_sh.PL $(CFG_VARS) $(CFGSH_TMPL) > ..\config.sh
573 cd ..
574 -del /f perl.exe
575 perl configpm
576 cd win32
577 -del /f $(CFGH_TMPL)
578 -mkdir ..\lib\CORE
e5a95ffb 579 -perl -I..\lib config_h.PL "INST_VER=$(INST_VER)"
ac4c12e7
GS
580 rename config.h $(CFGH_TMPL)
581
83437bec 582$(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
137443ea 583 cd .. && miniperl configpm
c90c0ff4 584 if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
d07c2202
GS
585 $(XCOPY) ..\*.h $(COREDIR)\*.*
586 $(XCOPY) *.h $(COREDIR)\*.*
15e52e56 587 $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.*
d07c2202 588 $(RCOPY) include $(COREDIR)\*.*
e5a95ffb
GS
589 $(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \
590 || $(MAKE) $(MAKEFLAGS) $(CONFIGPM)
137443ea 591
eb480a0b 592$(MINIPERL) : $(MINIDIR) $(MINI_OBJ)
137443ea 593 $(LINK32) -subsystem:console -out:$@ @<<
eb480a0b 594 $(LINK_FLAGS) $(LIBFILES) $(MINI_OBJ)
137443ea
PP
595<<
596
eb480a0b
GS
597$(MINIDIR) :
598 if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
599
852c2e52 600$(MINICORE_OBJ) : $(CORE_NOCFG_H)
eb480a0b
GS
601 $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ ..\$(*F).c
602
852c2e52 603$(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
eb480a0b
GS
604 $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*F).c
605
852c2e52
GS
606# 1. we don't want to rebuild miniperl.exe when config.h changes
607# 2. we don't want to rebuild miniperl.exe with non-default config.h
608$(MINI_OBJ) : $(CORE_NOCFG_H)
609
eb480a0b
GS
610$(WIN32_OBJ) : $(CORE_H)
611$(CORE_OBJ) : $(CORE_H)
eb480a0b
GS
612$(DLL_OBJ) : $(CORE_H)
613$(PERL95_OBJ) : $(CORE_H)
614$(X2P_OBJ) : $(CORE_H)
0a753a76 615
910dfcc8 616perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym makedef.pl
eb480a0b 617 $(MINIPERL) -w makedef.pl $(OPTIMIZE) $(DEFINES) $(OBJECT) \
910dfcc8 618 CCTYPE=$(CCTYPE) > perldll.def
0a753a76 619
eb480a0b 620$(PERLDLL): perldll.def $(PERLDLL_OBJ)
137443ea 621 $(LINK32) -dll -def:perldll.def -out:$@ @<<
eb480a0b 622 $(LINK_FLAGS) $(LIBFILES) $(PERLDLL_OBJ)
137443ea 623<<
d07c2202 624 $(XCOPY) $(PERLIMPLIB) $(COREDIR)
137443ea
PP
625
626perl.def : $(MINIPERL) makeperldef.pl
627 $(MINIPERL) -I..\lib makeperldef.pl $(NULL) > perl.def
628
83437bec
NIS
629$(MINIMOD) : $(MINIPERL) ..\minimod.pl
630 cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
631
eb480a0b
GS
632..\x2p\a2p$(o) : ..\x2p\a2p.c
633 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\a2p.c
634
635..\x2p\hash$(o) : ..\x2p\hash.c
636 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\hash.c
637
638..\x2p\str$(o) : ..\x2p\str.c
639 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\str.c
640
641..\x2p\util$(o) : ..\x2p\util.c
642 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\util.c
643
644..\x2p\walk$(o) : ..\x2p\walk.c
645 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\walk.c
646
647$(X2P) : $(MINIPERL) $(X2P_OBJ)
648 $(MINIPERL) ..\x2p\find2perl.PL
649 $(MINIPERL) ..\x2p\s2p.PL
d07c2202 650 $(LINK32) -subsystem:console -out:$@ @<<
eb480a0b 651 $(LINK_FLAGS) $(LIBFILES) $(X2P_OBJ)
d07c2202
GS
652<<
653
83437bec 654perlmain.c : runperl.c
0a753a76 655 copy runperl.c perlmain.c
137443ea 656
d56e6723 657perlmain$(o) : perlmain.c
8957be0a 658 $(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c
137443ea 659
eb480a0b
GS
660$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ)
661 $(LINK32) -subsystem:console -out:$@ $(LINK_FLAGS) $(LIBFILES) \
662 $(PERLEXE_OBJ) $(PERLIMPLIB)
0a753a76 663 copy splittree.pl ..
eb480a0b 664 $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
0a753a76 665
e7083a8c
DL
666!IF "$(USE_PERLCRT)" == ""
667
3e3baf6d
TB
668perl95.c : runperl.c
669 copy runperl.c perl95.c
670
d56e6723 671perl95$(o) : perl95.c
eb480a0b 672 $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c perl95.c
3e3baf6d 673
d56e6723 674win32sckmt$(o) : win32sck.c
eb480a0b
GS
675 $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
676 $(OBJOUT_FLAG)win32sckmt$(o) win32sck.c
fb73857a 677
d56e6723 678win32mt$(o) : win32.c
eb480a0b
GS
679 $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
680 $(OBJOUT_FLAG)win32mt$(o) win32.c
fb73857a 681
ac4c12e7
GS
682DynaLoadmt$(o) : $(DYNALOADER).c
683 $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
684 $(OBJOUT_FLAG)DynaLoadmt$(o) $(DYNALOADER).c
c69f6586 685
fb73857a 686$(PERL95EXE): $(PERLDLL) $(CONFIGPM) $(PERL95_OBJ)
eb480a0b 687 $(LINK32) -subsystem:console -nodefaultlib -out:$@ $(LINK_FLAGS) \
e7083a8c
DL
688 $(LIBBASEFILES) $(PERL95_OBJ) $(PERLIMPLIB) libcmt.lib
689
690!ENDIF
3e3baf6d 691
137443ea 692$(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
eb480a0b 693 if not exist $(AUTODIR) mkdir $(AUTODIR)
a1dd9325 694 cd $(EXTDIR)\$(*B)
bfab39a2 695 ..\$(MINIPERL) -I..\..\lib $(*B)_pm.PL
a1dd9325 696 cd ..\..\win32
68dc0745
PP
697 $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
698 cd $(EXTDIR)\$(*B)
699 $(XSUBPP) dl_win32.xs > $(*B).c
0a753a76
PP
700 cd ..\..\win32
701
e3b8966e
GS
702!IF "$(OBJECT)" == "-DPERL_OBJECT"
703PerlCAPI.cpp : $(MINIPERL)
704 $(MINIPERL) GenCAPI.pl $(COREDIR)
705
706PerlCAPI$(o) : PerlCAPI.cpp
d17537aa 707 $(CC) $(CFLAGS_O) $(RUNTIME) -UPERLDLL -c \
e3b8966e
GS
708 $(OBJOUT_FLAG)PerlCAPI$(o) PerlCAPI.cpp
709
710$(CAPILIB) : PerlCAPI.cpp PerlCAPI$(o)
711 lib /OUT:$(CAPILIB) PerlCAPI$(o)
712!ENDIF
713
68dc0745
PP
714$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
715 copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
0a753a76 716
15e52e56
GS
717$(RE_DLL): $(PERLEXE) $(RE).xs
718 cd $(EXTDIR)\$(*B)
719 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
720 $(MAKE)
721 cd ..\..\win32
722
2a321948 723$(B_DLL): $(PERLEXE) $(B).xs
a98bd6f4
GS
724 cd $(EXTDIR)\$(*B)
725 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
726 $(MAKE)
727 cd ..\..\win32
728
d55594ae 729$(THREAD_DLL): $(PERLEXE) $(THREAD).xs
059e4e88
GS
730 cd $(EXTDIR)\$(*B)
731 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
732 $(MAKE)
733 cd ..\..\win32
734
2a321948
GS
735$(ATTRS_DLL): $(PERLEXE) $(ATTRS).xs
736 cd $(EXTDIR)\$(*B)
737 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
738 $(MAKE)
739 cd ..\..\win32
d55594ae 740
6dead956
GS
741$(POSIX_DLL): $(PERLEXE) $(POSIX).xs
742 cd $(EXTDIR)\$(*B)
743 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
744 $(MAKE)
745 cd ..\..\win32
746
eb480a0b 747$(IO_DLL): $(PERLEXE) $(IO).xs
68dc0745 748 cd $(EXTDIR)\$(*B)
137443ea
PP
749 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
750 $(MAKE)
0a753a76
PP
751 cd ..\..\win32
752
137443ea 753$(SDBM_FILE_DLL) : $(PERLEXE) $(SDBM_FILE).xs
68dc0745 754 cd $(EXTDIR)\$(*B)
137443ea
PP
755 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
756 $(MAKE)
68dc0745 757 cd ..\..\win32
0a753a76 758
137443ea 759$(FCNTL_DLL): $(PERLEXE) $(FCNTL).xs
68dc0745 760 cd $(EXTDIR)\$(*B)
137443ea
PP
761 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
762 $(MAKE)
0a753a76
PP
763 cd ..\..\win32
764
137443ea 765$(OPCODE_DLL): $(PERLEXE) $(OPCODE).xs
68dc0745 766 cd $(EXTDIR)\$(*B)
137443ea
PP
767 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
768 $(MAKE)
68dc0745 769 cd ..\..\win32
0a753a76 770
059e4e88 771$(SOCKET_DLL): $(PERLEXE) $(SOCKET).xs
68dc0745 772 cd $(EXTDIR)\$(*B)
137443ea
PP
773 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
774 $(MAKE)
0a753a76
PP
775 cd ..\..\win32
776
eab60bb1
GS
777$(ERRNO_PM): $(PERLEXE) $(ERRNO)_pm.PL
778 cd $(EXTDIR)\$(*B)
779 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
780 $(MAKE)
781 cd ..\..\win32
782
68dc0745 783doc: $(PERLEXE)
3e3baf6d 784 copy ..\README.win32 ..\pod\perlwin32.pod
d07c2202 785 $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=./html \
b3b61bd8 786 --podpath=pod:lib:ext:utils --htmlroot="file://$(INST_HTML::=|)" \
3e3baf6d 787 --libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse
68dc0745 788
4a71ed0c 789utils: $(PERLEXE) $(X2P)
3fe9a6f1 790 cd ..\utils
eb480a0b 791 $(MAKE) PERL=$(MINIPERL)
4a71ed0c
GS
792 cd ..\pod
793 $(MAKE) -f ..\win32\pod.mak converters
3fe9a6f1 794 cd ..\win32
4a71ed0c 795 $(PERLEXE) $(PL2BAT) $(UTILS)
3fe9a6f1 796
137443ea 797distclean: clean
dc050285 798 -del /f $(MINIPERL) $(PERLEXE) $(PERL95EXE) $(PERLDLL) $(GLOBEXE) \
83437bec 799 $(PERLIMPLIB) ..\miniperl.lib $(MINIMOD)
3e3baf6d 800 -del /f *.def *.map
eab60bb1
GS
801 -del /f $(EXTENSION_DLL) $(EXTENSION_PM)
802 -del /f $(EXTENSION_C) $(DYNALOADER).c $(ERRNO).pm
eb480a0b
GS
803 -del /f $(EXTDIR)\DynaLoader\dl_win32.xs
804 -del /f $(LIBDIR)\.exists $(LIBDIR)\attrs.pm $(LIBDIR)\DynaLoader.pm
805 -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
806 -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm $(LIBDIR)\Thread.pm
807 -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
15e52e56 808 -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
eb480a0b
GS
809 -rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO
810 -rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread
811 -rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B
68dc0745
PP
812 -del /f $(PODDIR)\*.html
813 -del /f $(PODDIR)\*.bat
eb480a0b
GS
814 cd ..\utils
815 -del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc pstruct
816 -del /f *.bat
817 cd ..\win32
818 cd ..\x2p
819 -del /f find2perl s2p
820 -del /f *.bat
821 cd ..\win32
822 -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
823 -del /f $(CONFIGPM)
824 -del /f perl95.c
d444a431 825 -del /f bin\*.bat
3e3baf6d 826 cd $(EXTDIR)
d56e6723 827 -del /s *.lib *.def *.map *.bs Makefile *$(o) pm_to_blib
3e3baf6d 828 cd ..\win32
eb480a0b
GS
829 -rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR)
830 -rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR)
68dc0745 831
4a71ed0c 832install : all installbare installhtml
6dead956 833
4a71ed0c 834installbare : utils
d07c2202 835 $(PERLEXE) ..\installperl
e7083a8c 836!IF "$(USE_PERLCRT)" == ""
3e3baf6d 837 $(XCOPY) $(PERL95EXE) $(INST_BIN)\*.*
e7083a8c 838!ENDIF
68dc0745 839 $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
e5a95ffb 840 $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.*
4a71ed0c 841 $(XCOPY) bin\network.pl $(INST_LIB)\*.*
6dead956
GS
842
843installhtml : doc
3e3baf6d 844 $(RCOPY) html\*.* $(INST_HTML)\*.*
68dc0745 845
137443ea 846inst_lib : $(CONFIGPM)
68dc0745 847 copy splittree.pl ..
eb480a0b 848 $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
c90c0ff4 849 $(RCOPY) ..\lib $(INST_LIB)\*.*
0a753a76 850
dfb634a9 851minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) utils
137443ea
PP
852 $(XCOPY) $(MINIPERL) ..\t\perl.exe
853 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
854 attrib -r ..\t\*.*
855 copy test ..\t
856 cd ..\t
857 $(MINIPERL) -I..\lib test base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t
858 cd ..\win32
859
dfb634a9 860test-prep : all utils
68dc0745
PP
861 $(XCOPY) $(PERLEXE) ..\t\$(NULL)
862 $(XCOPY) $(PERLDLL) ..\t\$(NULL)
863 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
fb73857a
PP
864
865test : test-prep
866 cd ..\t
867 $(PERLEXE) -I..\lib harness
868 cd ..\win32
869
870test-notty : test-prep
871 set PERL_SKIP_TTY_TEST=1
137443ea
PP
872 cd ..\t
873 $(PERLEXE) -I..\lib harness
68dc0745 874 cd ..\win32
137443ea
PP
875
876clean :
d56e6723 877 -@erase miniperlmain$(o)
137443ea 878 -@erase $(MINIPERL)
d56e6723
GS
879 -@erase perlglob$(o)
880 -@erase perlmain$(o)
3e3baf6d
TB
881 -@erase config.w32
882 -@erase /f config.h
e3b8966e 883 -@erase PerlCAPI.cpp
137443ea
PP
884 -@erase $(GLOBEXE)
885 -@erase $(PERLEXE)
886 -@erase $(PERLDLL)
887 -@erase $(CORE_OBJ)
e3b8966e 888 -@erase $(CAPILIB)
eb480a0b 889 -rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR)
137443ea
PP
890 -@erase $(WIN32_OBJ)
891 -@erase $(DLL_OBJ)
d07c2202 892 -@erase $(X2P_OBJ)
d56e6723 893 -@erase ..\*$(o) ..\*.lib ..\*.exp *$(o) *.lib *.exp
d444a431 894 -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
d07c2202 895 -@erase ..\x2p\*.exe ..\x2p\*.bat
137443ea
PP
896 -@erase *.ilk
897 -@erase *.pdb