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