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