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