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