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