This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[win32] various cleanups so that B can be built as "just another extension"
[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
4a52a3da
GS
26CCTYPE *= BORLAND
27#CCTYPE *= 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
4a52a3da
GS
46CCHOME *= C:\bc5
47#CCHOME *= 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
4a52a3da 131LINK32 = gcc -pipe
d56e6723
GS
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"
31948633 198OPTIMIZE = -O1 $(RUNTIME) -DNDEBUG
08aa1457 199.ELSE
31948633 200OPTIMIZE = -O1 $(RUNTIME) -DNDEBUG
08aa1457
PP
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
2a321948 421DYNAMIC_EXT=Socket IO Fcntl Opcode SDBM_File attrs Thread B
dc050285 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
2a321948 432B=$(EXTDIR)\B\B
08aa1457
PP
433
434SOCKET_DLL=..\lib\auto\Socket\Socket.dll
435FCNTL_DLL=..\lib\auto\Fcntl\Fcntl.dll
436OPCODE_DLL=..\lib\auto\Opcode\Opcode.dll
437SDBM_FILE_DLL=..\lib\auto\SDBM_File\SDBM_File.dll
438IO_DLL=..\lib\auto\IO\IO.dll
5d925967 439ATTRS_DLL=..\lib\auto\attrs\attrs.dll
a98bd6f4 440THREAD_DLL=..\lib\auto\Thread\Thread.dll
2a321948 441B_DLL=..\lib\auto\B\B.dll
08aa1457
PP
442
443STATICLINKMODULES=DynaLoader
444DYNALOADMODULES= \
445 $(SOCKET_DLL) \
446 $(FCNTL_DLL) \
447 $(OPCODE_DLL) \
448 $(SDBM_FILE_DLL)\
5d925967 449 $(IO_DLL) \
a98bd6f4 450 $(ATTRS_DLL) \
2a321948
GS
451 $(THREAD_DLL) \
452 $(B_DLL)
08aa1457
PP
453
454POD2HTML=$(PODDIR)\pod2html
455POD2MAN=$(PODDIR)\pod2man
456POD2LATEX=$(PODDIR)\pod2latex
457POD2TEXT=$(PODDIR)\pod2text
458
459#
460# Top targets
461#
462
d07c2202 463all: $(PERLEXE) $(PERL95EXE) $(GLOBEXE) $(DYNALOADMODULES) $(MINIMOD) \
dfb634a9 464 $(X2P)
08aa1457 465
d56e6723 466$(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
08aa1457
PP
467
468#------------------------------------------------------------
469
d56e6723 470$(GLOBEXE): perlglob$(o)
08aa1457
PP
471.IF "$(CCTYPE)" == "BORLAND"
472 $(CC) -c -w -v -tWM -I$(CCINCDIR) perlglob.c
d56e6723
GS
473 $(LINK32) -Tpe -ap $(LINK_FLAGS) c0x32$(o) perlglob$(o) \
474 $(CCLIBDIR)\32BIT\wildargs$(o),$@,,import32.lib cw32mt.lib,
475.ELIF "$(CCTYPE)" == "GCC"
476 $(LINK32) $(LINK_FLAGS) -o $@ perlglob$(o) $(LIBFILES)
08aa1457 477.ELSE
dc050285 478 $(LINK32) $(LINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
d56e6723 479 perlglob$(o) setargv$(o)
08aa1457
PP
480.ENDIF
481
d56e6723 482perlglob$(o) : perlglob.c
08aa1457 483
d56e6723 484..\miniperlmain$(o) : ..\miniperlmain.c $(CORE_H)
08aa1457
PP
485
486config.w32 : $(CFGSH_TMPL)
487 copy $(CFGSH_TMPL) config.w32
488
d55594ae 489.\config.h : $(CFGH_TMPL)
08aa1457
PP
490 -del /f config.h
491 copy $(CFGH_TMPL) config.h
492
493..\config.sh : config.w32 $(MINIPERL) config_sh.PL
910dfcc8
GS
494 $(MINIPERL) -I..\lib config_sh.PL \
495 "INST_DRV=$(INST_DRV)" \
496 "INST_TOP=$(INST_TOP)" \
d07c2202 497 "archname=$(ARCHNAME)" \
910dfcc8
GS
498 "cc=$(CC)" \
499 "ccflags=$(OPTIMIZE) $(DEFINES)" \
500 "cf_email=$(EMAIL)" \
26618a56 501 "d_crypt=$(D_CRYPT)" \
910dfcc8
GS
502 "libs=$(LIBFILES:f)" \
503 "incpath=$(CCINCDIR)" \
504 "libpth=$(strip $(CCLIBDIR) $(LIBFILES:d))" \
505 "libc=$(LIBC)" \
506 "static_ext=$(STATIC_EXT)" \
507 "dynamic_ext=$(DYNAMIC_EXT)" \
aa4575bf 508 "LINK_FLAGS=$(LINK_FLAGS)" \
910dfcc8
GS
509 "optimize=$(OPTIMIZE)" \
510 config.w32 > ..\config.sh
08aa1457
PP
511
512$(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
513 cd .. && miniperl configpm
514 if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
d07c2202
GS
515 $(XCOPY) ..\*.h $(COREDIR)\*.*
516 $(XCOPY) *.h $(COREDIR)\*.*
517 $(RCOPY) include $(COREDIR)\*.*
08aa1457 518 $(MINIPERL) -I..\lib config_h.PL || $(MAKE) CCTYPE=$(CCTYPE) \
d56e6723 519 CFG=$(CFG) $(CONFIGPM)
08aa1457 520
d56e6723
GS
521LKPRE = INPUT (
522LKPOST = )
523
524$(MINIPERL) : ..\miniperlmain$(o) $(CORE_OBJ) $(WIN32_OBJ)
08aa1457
PP
525.IF "$(CCTYPE)" == "BORLAND"
526 $(LINK32) -Tpe -ap $(LINK_FLAGS) \
d56e6723 527 @$(mktmp c0x32$(o) ..\miniperlmain$(o) \
d07c2202 528 $(CORE_OBJ:s,\,\\) $(WIN32_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
d56e6723
GS
529.ELIF "$(CCTYPE)" == "GCC"
530 $(LINK32) -v -o $@ $(LINK_FLAGS) \
531 $(mktmp $(LKPRE) ..\miniperlmain$(o) \
532 $(CORE_OBJ:s,\,\\) $(WIN32_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
08aa1457
PP
533.ELSE
534 $(LINK32) -subsystem:console -out:$@ \
d56e6723 535 @$(mktmp $(LINK_FLAGS) $(LIBFILES) ..\miniperlmain$(o) \
08aa1457
PP
536 $(CORE_OBJ:s,\,\\) $(WIN32_OBJ:s,\,\\))
537.ENDIF
538
539$(WIN32_OBJ) : $(CORE_H)
540$(CORE_OBJ) : $(CORE_H)
541$(DLL_OBJ) : $(CORE_H)
d07c2202 542$(X2P_OBJ) : $(CORE_H)
08aa1457 543
d55594ae 544perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym makedef.pl
910dfcc8
GS
545 $(MINIPERL) -w makedef.pl $(OPTIMIZE) $(DEFINES) \
546 CCTYPE=$(CCTYPE) > perldll.def
08aa1457
PP
547
548$(PERLDLL): perldll.def $(CORE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
549.IF "$(CCTYPE)" == "BORLAND"
550 $(LINK32) -Tpd -ap $(LINK_FLAGS) \
d56e6723 551 @$(mktmp c0d32$(o) $(CORE_OBJ:s,\,\\) \
08aa1457
PP
552 $(WIN32_OBJ:s,\,\\) $(DLL_OBJ:s,\,\\)\n \
553 $@,\n \
554 $(LIBFILES)\n \
555 perldll.def\n)
556 $(IMPLIB) $*.lib $@
d56e6723 557.ELIF "$(CCTYPE)" == "GCC"
3730b96e 558 $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(LINK_FLAGS) \
d56e6723
GS
559 $(mktmp $(LKPRE) $(CORE_OBJ:s,\,\\) $(WIN32_OBJ:s,\,\\) \
560 $(DLL_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
561 dlltool --output-lib $(PERLIMPLIB) \
562 --dllname perl.dll \
563 --def perldll.def \
564 --base-file perl.base \
565 --output-exp perl.exp
3730b96e 566 $(LINK32) -mdll -o $@ $(LINK_FLAGS) \
d56e6723
GS
567 $(mktmp $(LKPRE) $(CORE_OBJ:s,\,\\) $(WIN32_OBJ:s,\,\\) \
568 $(DLL_OBJ:s,\,\\) $(LIBFILES) perl.exp $(LKPOST))
08aa1457
PP
569.ELSE
570 $(LINK32) -dll -def:perldll.def -out:$@ \
dc050285 571 @$(mktmp $(LINK_FLAGS) $(LIBFILES) $(CORE_OBJ:s,\,\\) \
08aa1457
PP
572 $(WIN32_OBJ:s,\,\\) $(DLL_OBJ:s,\,\\))
573.ENDIF
d07c2202 574 $(XCOPY) $(PERLIMPLIB) $(COREDIR)
08aa1457
PP
575
576perl.def : $(MINIPERL) makeperldef.pl
577 $(MINIPERL) -I..\lib makeperldef.pl $(NULL) > perl.def
578
579$(MINIMOD) : $(MINIPERL) ..\minimod.pl
580 cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
581
d07c2202
GS
582$(X2P) : $(X2P_OBJ)
583 $(MINIPERL) ..\x2p\find2perl.PL
584 $(MINIPERL) ..\x2p\s2p.PL
585.IF "$(CCTYPE)" == "BORLAND"
586 $(LINK32) -Tpe -ap $(LINK_FLAGS) \
587 @$(mktmp c0x32$(o) $(X2P_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
588.ELIF "$(CCTYPE)" == "GCC"
589 $(LINK32) -v -o $@ $(LINK_FLAGS) \
590 $(mktmp $(LKPRE) $(X2P_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
591.ELSE
592 $(LINK32) -subsystem:console -out:$@ \
593 @$(mktmp $(LINK_FLAGS) $(LIBFILES) $(X2P_OBJ:s,\,\\)
594.ENDIF
595
08aa1457
PP
596perlmain.c : runperl.c
597 copy runperl.c perlmain.c
598
d56e6723
GS
599perlmain$(o) : perlmain.c
600 $(CC) $(CFLAGS) -UPERLDLL $(EXEOUT_FLAG)$@ -c perlmain.c
08aa1457 601
d56e6723 602$(PERLEXE): $(PERLDLL) $(CONFIGPM) perlmain$(o)
08aa1457
PP
603.IF "$(CCTYPE)" == "BORLAND"
604 $(LINK32) -Tpe -ap $(LINK_FLAGS) \
d56e6723 605 @$(mktmp c0x32$(o) perlmain$(o) $(WINIOMAYBE)\n \
08aa1457
PP
606 $@,\n \
607 $(PERLIMPLIB) $(LIBFILES)\n)
d56e6723
GS
608.ELIF "$(CCTYPE)" == "GCC"
609 $(LINK32) -o $@ $(LINK_FLAGS) \
610 perlmain.o $(WINIOMAYBE) $(PERLIMPLIB) $(LIBFILES)
08aa1457 611.ELSE
d56e6723
GS
612 $(LINK32) -subsystem:console -out:$@ $(LINK_FLAGS) $(LIBFILES) \
613 perlmain$(o) $(WINIOMAYBE) $(PERLIMPLIB)
08aa1457
PP
614.ENDIF
615 copy splittree.pl ..
616 $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" "../LIB/auto"
08aa1457
PP
617
618.IF "$(CCTYPE)" != "BORLAND"
d56e6723 619.IF "$(CCTYPE)" != "GCC"
08aa1457
PP
620
621perl95.c : runperl.c
622 copy runperl.c perl95.c
623
d56e6723 624perl95$(o) : perl95.c
910dfcc8 625 $(CC) $(CFLAGS) -MT -UPERLDLL -DWIN95FIX -c perl95.c
08aa1457 626
d56e6723
GS
627win32sckmt$(o) : win32sck.c
628 $(CC) $(CFLAGS) -MT -UPERLDLL -DWIN95FIX -c $(OBJOUT_FLAG)win32sckmt$(o) win32sck.c
fb73857a 629
d56e6723
GS
630win32mt$(o) : win32.c
631 $(CC) $(CFLAGS) -MT -UPERLDLL -DWIN95FIX -c $(OBJOUT_FLAG)win32mt$(o) win32.c
fb73857a
PP
632
633$(PERL95EXE): $(PERLDLL) $(CONFIGPM) $(PERL95_OBJ)
d56e6723 634 $(LINK32) -subsystem:console -out:$@ $(LINK_FLAGS) $(LIBFILES) \
fb73857a 635 $(PERL95_OBJ) $(PERLIMPLIB)
08aa1457
PP
636
637.ENDIF
d56e6723 638.ENDIF
08aa1457
PP
639
640$(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
641 if not exist ..\lib\auto mkdir ..\lib\auto
642 $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
643 cd $(EXTDIR)\$(*B) && $(XSUBPP) dl_win32.xs > $(*B).c
644 $(XCOPY) $(EXTDIR)\$(*B)\dlutils.c .
645
646$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
647 copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
648
2a321948
GS
649$(B_DLL): $(PERLEXE) $(B).xs
650 cd $(EXTDIR)\$(*B) && \
651 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
652 cd $(EXTDIR)\$(*B) && $(MAKE)
653
a98bd6f4
GS
654$(THREAD_DLL): $(PERLEXE) $(THREAD).xs
655 cd $(EXTDIR)\$(*B) && \
656 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
657 cd $(EXTDIR)\$(*B) && $(MAKE)
658
5d925967
GS
659$(ATTRS_DLL): $(PERLEXE) $(ATTRS).xs
660 cd $(EXTDIR)\$(*B) && \
661 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
662 cd $(EXTDIR)\$(*B) && $(MAKE)
663
664$(IO_DLL): $(PERLEXE) $(IO).xs
08aa1457
PP
665 cd $(EXTDIR)\$(*B) && \
666 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
667 cd $(EXTDIR)\$(*B) && $(MAKE)
668
669$(SDBM_FILE_DLL) : $(PERLEXE) $(SDBM_FILE).xs
670 cd $(EXTDIR)\$(*B) && \
671 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
672 cd $(EXTDIR)\$(*B) && $(MAKE)
673
674$(FCNTL_DLL): $(PERLEXE) $(FCNTL).xs
675 cd $(EXTDIR)\$(*B) && \
676 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
677 cd $(EXTDIR)\$(*B) && $(MAKE)
678
679$(OPCODE_DLL): $(PERLEXE) $(OPCODE).xs
680 cd $(EXTDIR)\$(*B) && \
681 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
682 cd $(EXTDIR)\$(*B) && $(MAKE)
683
5d925967 684$(SOCKET_DLL): $(PERLEXE) $(SOCKET).xs
08aa1457
PP
685 cd $(EXTDIR)\$(*B) && \
686 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
687 cd $(EXTDIR)\$(*B) && $(MAKE)
688
689doc: $(PERLEXE)
84902520
TB
690 cd ..\pod && $(MAKE) -f ..\win32\pod.mak checkpods \
691 pod2html pod2latex pod2man pod2text
692 cd ..\pod && $(XCOPY) *.bat ..\win32\bin\*.*
08aa1457 693 copy ..\README.win32 ..\pod\perlwin32.pod
d07c2202 694 $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=./html \
08aa1457
PP
695 --podpath=pod:lib:ext:utils --htmlroot="//$(INST_HTML:s,:,|,)" \
696 --libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse
697
698utils: $(PERLEXE)
699 cd ..\utils && $(MAKE) PERL=$(MINIPERL)
700 cd ..\utils && $(PERLEXE) ..\win32\$(PL2BAT) h2ph splain perlbug \
701 pl2pm c2ph h2xs perldoc pstruct
d444a431 702 $(XCOPY) ..\utils\*.bat bin\*.*
d07c2202 703 $(PERLEXE) -I..\lib $(PL2BAT) bin\network.pl bin\www.pl bin\runperl.pl \
dfb634a9 704 bin\pl2bat.pl bin\perlglob.pl
08aa1457
PP
705
706distclean: clean
dc050285 707 -del /f $(MINIPERL) $(PERLEXE) $(PERL95EXE) $(PERLDLL) $(GLOBEXE) \
08aa1457
PP
708 $(PERLIMPLIB) ..\miniperl.lib $(MINIMOD)
709 -del /f *.def *.map
710 -del /f $(SOCKET_DLL) $(IO_DLL) $(SDBM_FILE_DLL) $(FCNTL_DLL) \
2a321948 711 $(OPCODE_DLL) $(ATTRS_DLL) $(THREAD_DLL) $(B_DLL)
08aa1457 712 -del /f $(SOCKET).c $(IO).c $(SDBM_FILE).c $(FCNTL).c $(OPCODE).c \
2a321948 713 $(DYNALOADER).c $(ATTRS).c $(THREAD).c $(B).c
08aa1457
PP
714 -del /f $(PODDIR)\*.html
715 -del /f $(PODDIR)\*.bat
d444a431
TB
716 -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
717.IF "$(PERL95EXE)" != ""
718 -del /f perl95.c
719.ENDIF
720 -del /f bin\*.bat
d56e6723 721 -cd $(EXTDIR) && del /s *.lib *.def *.map *.bs Makefile *$(o) pm_to_blib
d07c2202
GS
722 -rmdir /s /q ..\lib\auto || rmdir /s ..\lib\auto
723 -rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR)
08aa1457
PP
724
725install : all doc utils
d07c2202 726 $(PERLEXE) ..\installperl
08aa1457
PP
727.IF "$(PERL95EXE)" != ""
728 $(XCOPY) $(PERL95EXE) $(INST_BIN)\*.*
729.ENDIF
730 $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
d444a431 731 $(XCOPY) bin\*.bat $(INST_BIN)\*.*
08aa1457 732 $(XCOPY) ..\pod\*.bat $(INST_BIN)\*.*
08aa1457
PP
733 $(RCOPY) html\*.* $(INST_HTML)\*.*
734
735inst_lib : $(CONFIGPM)
736 copy splittree.pl ..
737 $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" "../LIB/auto"
738 $(RCOPY) ..\lib $(INST_LIB)\*.*
739
dfb634a9 740minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) utils
08aa1457
PP
741 $(XCOPY) $(MINIPERL) ..\t\perl.exe
742.IF "$(CCTYPE)" == "BORLAND"
743 $(XCOPY) $(GLOBBAT) ..\t\$(NULL)
744.ELSE
745 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
746.ENDIF
747 attrib -r ..\t\*.*
748 copy test ..\t
749 cd ..\t && \
750 $(MINIPERL) -I..\lib test base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t
751
dfb634a9 752test-prep : all utils
08aa1457
PP
753 $(XCOPY) $(PERLEXE) ..\t\$(NULL)
754 $(XCOPY) $(PERLDLL) ..\t\$(NULL)
755.IF "$(CCTYPE)" == "BORLAND"
756 $(XCOPY) $(GLOBBAT) ..\t\$(NULL)
757.ELSE
758 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
759.ENDIF
32f822de
GS
760
761test : test-prep
08aa1457
PP
762 cd ..\t && $(PERLEXE) -I..\lib harness
763
32f822de
GS
764test-notty : test-prep
765 set PERL_SKIP_TTY_TEST=1 && \
766 cd ..\t && $(PERLEXE) -I.\lib harness
767
08aa1457 768clean :
d56e6723 769 -@erase miniperlmain$(o)
08aa1457 770 -@erase $(MINIPERL)
d56e6723
GS
771 -@erase perlglob$(o)
772 -@erase perlmain$(o)
08aa1457
PP
773 -@erase config.w32
774 -@erase /f config.h
775 -@erase $(GLOBEXE)
776 -@erase $(PERLEXE)
777 -@erase $(PERLDLL)
778 -@erase $(CORE_OBJ)
779 -@erase $(WIN32_OBJ)
780 -@erase $(DLL_OBJ)
d07c2202 781 -@erase $(X2P_OBJ)
d56e6723 782 -@erase ..\*$(o) ..\*.lib ..\*.exp *$(o) *.lib *.exp
d444a431 783 -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
d07c2202 784 -@erase ..\x2p\*.exe ..\x2p\*.bat
08aa1457
PP
785 -@erase *.ilk
786 -@erase *.pdb
787
788