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