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