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