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