2 # Makefile to build perl on Windows NT using DMAKE.
4 # Visual C++ 2.0 thro 6.0
6 # Mingw32 with gcc-2.95.2 or better **experimental**
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.
13 ## Make sure you read README.win32 *before* you mess with anything here!
17 ## Build configuration. Edit the values below to suit your needs.
21 # Set these to wherever you want "dmake install" to put your
25 INST_TOP *= $(INST_DRV)\perl
28 # Comment this out if you DON'T want your perl installation to be versioned.
29 # This means that the new installation will overwrite any files from the
30 # old installation at the same INST_TOP location. Leaving it enabled is
31 # the safest route, as perl adds the extra version directory to all the
32 # locations it installs files to. If you disable it, an alternative
33 # versioned installation can be obtained by setting INST_TOP above to a
34 # path that includes an arbitrary version string.
39 # Comment this out if you DON'T want your perl installation to have
40 # architecture specific components. This means that architecture-
41 # specific files will be installed along with the architecture-neutral
42 # files. Leaving it enabled is safer and more flexible, in case you
43 # want to build multiple flavors of perl and install them together in
44 # the same location. Commenting it out gives you a simpler
45 # installation that is easier to understand for beginners.
47 INST_ARCH *= \$(ARCHNAME)
50 # uncomment to enable multiple interpreters. This is need for fork()
56 # XXX WARNING! This option is still very experimental. May be broken.
58 # Beginnings of interpreter cloning/threads; still very incomplete.
59 # This should be enabled to get the fork() emulation. This needs
62 #USE_ITHREADS *= define
65 # uncomment to enable the implicit "host" layer for all system calls
66 # made by perl. This needs USE_MULTI above. This is also needed to
69 #USE_IMP_SYS *= define
72 # WARNING! This option is deprecated and will eventually go away (enable
73 # USE_ITHREADS instead).
75 # uncomment to enable threads-capabilities. This is incompatible with
76 # USE_ITHREADS, and is only here for people who may have come to rely
77 # on the experimental Thread support that was in 5.005.
79 #USE_5005THREADS *= define
82 # WARNING! This option is deprecated and will eventually go away (enable
85 # uncomment next line if you want to use the PERL_OBJECT build option.
86 # DO NOT ENABLE unless you have legacy code that relies on the C++
87 # CPerlObj class that was available in 5.005. This cannot be enabled
88 # if you ask for USE_5005THREADS above.
93 # uncomment exactly one of the following
97 # Visual C++ > 2.x and < 6.x
101 # Borland 5.02 or later
103 # mingw32+gcc-2.95.2 or better
107 # uncomment this if you are compiling under Windows 95/98 and command.com
108 # (not needed if you're running under 4DOS/NT 6.01 or later)
112 # uncomment next line if you want debug version of perl (big,slow)
113 # If not enabled, we automatically try to use maximum optimization
114 # with all compilers that are known to have a working optimizer.
119 # uncomment to enable use of PerlCRT.DLL when using the Visual C compiler.
120 # It has patches that fix known bugs in older versions of MSVCRT.DLL.
121 # This currently requires VC 5.0 with Service Pack 3 or later.
122 # Get it from CPAN at http://www.perl.com/CPAN/authors/id/D/DO/DOUGL/
123 # and follow the directions in the package to install.
125 # Not recommended if you have VC 6.x and you're not running Windows 9x.
127 #USE_PERLCRT *= define
130 # uncomment to enable linking with setargv.obj under the Visual C
131 # compiler. Setting this options enables perl to expand wildcards in
132 # arguments, but it may be harder to use alternate methods like
133 # File::DosGlob that are more powerful. This option is supported only with
136 #USE_SETARGV *= define
139 # if you have the source for des_fcrypt(), uncomment this and make sure the
140 # file exists (see README.win32). File should be located in the same
141 # directory as this file.
143 #CRYPT_SRC *= fcrypt.c
146 # if you didn't set CRYPT_SRC and if you have des_fcrypt() available in a
147 # library, uncomment this, and make sure the library exists (see README.win32)
148 # Specify the full pathname of the library.
150 #CRYPT_LIB *= fcrypt.lib
153 # set this if you wish to use perl's malloc
154 # WARNING: Turning this on/off WILL break binary compatibility with extensions
155 # you may have compiled with/without it. Be prepared to recompile all
156 # extensions if you change the default. Currently, this cannot be enabled
157 # if you ask for USE_IMP_SYS above.
159 #PERL_MALLOC *= define
162 # set the install locations of the compiler include/libraries
163 # Running VCVARS32.BAT is *required* when using Visual C.
164 # Some versions of Visual C don't define MSVCDIR in the environment,
165 # so you may have to set CCHOME explicitly (spaces in the path name should
169 #CCHOME *= $(MSVCDIR)
170 CCHOME *= c:\gcc-2.95.2-msvcrt
171 CCINCDIR *= $(CCHOME)\include
172 CCLIBDIR *= $(CCHOME)\lib
175 # Additional compiler flags can be specified here.
179 # This should normally be disabled. Adding -DPERL_POLLUTE enables support
180 # for old symbols by default, at the expense of extreme pollution. You most
181 # probably just want to build modules that won't compile with
182 # perl Makefile.PL POLLUTE=1
183 # instead of enabling this. Please report such modules to the respective
186 #BUILDOPT += -DPERL_POLLUTE
189 # This should normally be disabled. Enabling it will disable the File::Glob
190 # implementation of CORE::glob.
192 #BUILDOPT += -DPERL_EXTERNAL_GLOB
195 # This should normally be disabled. Enabling it causes perl to read scripts
196 # in text mode (which is the 5.005 behavior) and will break ByteLoader.
197 #BUILDOPT += -DPERL_TEXTMODE_SCRIPTS
200 # This should normally be disabled. Enabling it runs a cloned toplevel
201 # interpreter (*EXPERIMENTAL*, fails tests)
202 #BUILDOPT += -DTOP_CLONE
205 # specify semicolon-separated list of extra directories that modules will
206 # look for libraries (spaces in path names need not be quoted)
211 # set this to point to cmd.exe (only needed if you use some
212 # alternate shell that doesn't grok cmd.exe style commands)
214 #SHELL *= g:\winnt\system32\cmd.exe
217 # set this to your email address (perl will guess a value from
218 # from your loginname and your hostname, which may not be right)
223 ## Build configuration ends.
226 ##################### CHANGE THESE ONLY IF YOU MUST #####################
228 .IF "$(CRYPT_SRC)$(CRYPT_LIB)" == ""
232 CRYPT_FLAG = -DHAVE_DES_FCRYPT
235 .IF "$(USE_OBJECT)" == "define"
237 USE_5005THREADS != undef
239 USE_IMP_SYS != define
244 USE_5005THREADS *= undef
246 .IF "$(USE_5005THREADS)" == "define"
247 USE_ITHREADS != undef
250 .IF "$(USE_IMP_SYS)" == "define"
256 USE_ITHREADS *= undef
260 .IF "$(USE_IMP_SYS)$(USE_MULTI)$(USE_5005THREADS)$(USE_OBJECT)" == "defineundefundefundef"
264 .IF "$(USE_ITHREADS)$(USE_MULTI)$(USE_OBJECT)" == "defineundefundef"
266 USE_5005THREADS != undef
269 .IF "$(USE_MULTI)$(USE_5005THREADS)$(USE_OBJECT)" != "undefundefundef"
270 BUILDOPT += -DPERL_IMPLICIT_CONTEXT
273 .IF "$(USE_IMP_SYS)" != "undef"
274 BUILDOPT += -DPERL_IMPLICIT_SYS
277 .IMPORT .IGNORE : PROCESSOR_ARCHITECTURE
279 PROCESSOR_ARCHITECTURE *= x86
281 .IF "$(USE_OBJECT)" == "define"
282 ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-object
283 .ELIF "$(USE_5005THREADS)" == "define"
284 ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-thread
285 .ELIF "$(USE_MULTI)" == "define"
286 ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-multi
288 ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)
291 .IF "$(USE_ITHREADS)" == "define"
292 ARCHNAME !:= $(ARCHNAME)-thread
295 # Visual Studio 98 specific
296 .IF "$(CCTYPE)" == "MSVC60"
298 # VC 6.0 can load the socket dll on demand. Makes the test suite
299 # run in about 10% less time.
300 DELAYLOAD *= -DELAYLOAD:wsock32.dll -DELAYLOAD:shell32.dll delayimp.lib
302 # VC 6.0 seems capable of compiling perl correctly with optimizations
303 # enabled. Anything earlier fails tests.
307 ARCHDIR = ..\lib\$(ARCHNAME)
308 COREDIR = ..\lib\CORE
309 AUTODIR = ..\lib\auto
313 EXTUTILSDIR = $(LIBDIR)\ExtUtils
316 INST_SCRIPT = $(INST_TOP)$(INST_VER)\bin
317 INST_BIN = $(INST_SCRIPT)$(INST_ARCH)
318 INST_LIB = $(INST_TOP)$(INST_VER)\lib
319 INST_ARCHLIB = $(INST_LIB)$(INST_ARCH)
320 INST_COREDIR = $(INST_ARCHLIB)\CORE
321 INST_POD = $(INST_LIB)\pod
322 INST_HTML = $(INST_POD)\html
325 # Programs to compile, build .lib files and link
330 .IF "$(CCTYPE)" == "BORLAND"
342 INCLUDES = -I$(COREDIR) -I.\include -I. -I.. -I"$(CCINCDIR)"
343 #PCHFLAGS = -H -Hc -H=c:\temp\bcmoduls.pch
344 DEFINES = -DWIN32 $(CRYPT_FLAG)
345 LOCDEFS = -DPERLDLL -DPERL_CORE
350 LIBFILES = $(CRYPT_LIB) import32.lib $(LIBC) odbc32.lib odbccp32.lib
352 .IF "$(CFG)" == "Debug"
353 OPTIMIZE = -v $(RUNTIME) -DDEBUGGING
356 OPTIMIZE = -O2 $(RUNTIME)
360 CFLAGS = -w -g0 -tWM -tWD $(INCLUDES) $(DEFINES) $(LOCDEFS) \
361 $(PCHFLAGS) $(OPTIMIZE)
362 LINK_FLAGS = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)"
367 .ELIF "$(CCTYPE)" == "GCC"
383 INCLUDES = -I$(COREDIR) -I.\include -I. -I..
384 DEFINES = -DWIN32 $(CRYPT_FLAG)
385 LOCDEFS = -DPERLDLL -DPERL_CORE
392 LIBFILES = $(CRYPT_LIB) $(LIBC) \
393 -lmoldname -lkernel32 -luser32 -lgdi32 \
394 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 \
395 -loleaut32 -lnetapi32 -luuid -lwsock32 -lmpr \
396 -lwinmm -lversion -lodbc32
398 .IF "$(CFG)" == "Debug"
399 OPTIMIZE = -g $(RUNTIME) -DDEBUGGING
402 OPTIMIZE = -g -O2 $(RUNTIME)
406 CFLAGS = $(INCLUDES) $(DEFINES) $(LOCDEFS) $(OPTIMIZE)
407 LINK_FLAGS = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)"
412 # NOTE: we assume that GCC uses MSVCRT.DLL
413 BUILDOPT += -fno-strict-aliasing -DPERL_MSVCRT_READFIX
419 LIB32 = $(LINK32) -lib
427 INCLUDES = -I$(COREDIR) -I.\include -I. -I..
428 #PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX
429 DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT $(CRYPT_FLAG)
430 LOCDEFS = -DPERLDLL -DPERL_CORE
434 .IF "$(USE_PERLCRT)" != "define"
435 .IF "$(CFG)" == "Debug"
436 PERLCRTLIBC = msvcrtd.lib
438 PERLCRTLIBC = msvcrt.lib
441 .IF "$(CFG)" == "Debug"
442 PERLCRTLIBC = PerlCRTD.lib
444 PERLCRTLIBC = PerlCRT.lib
451 .IF "$(RUNTIME)" == "-MD"
452 LIBC = $(PERLCRTLIBC)
457 .IF "$(CFG)" == "Debug"
458 .IF "$(CCTYPE)" == "MSVC20"
459 OPTIMIZE = -Od $(RUNTIME) -Z7 -D_DEBUG -DDEBUGGING
461 OPTIMIZE = -Od $(RUNTIME)d -Zi -D_DEBUG -DDEBUGGING
463 LINK_DBG = -debug -pdb:none
465 .IF "$(CFG)" == "Optimize"
466 # -O1 yields smaller code, which turns out to be faster than -O2
467 #OPTIMIZE = -O2 $(RUNTIME) -DNDEBUG
468 OPTIMIZE = -O1 $(RUNTIME) -DNDEBUG
470 OPTIMIZE = -Od $(RUNTIME) -DNDEBUG
475 LIBBASEFILES = $(DELAYLOAD) $(CRYPT_LIB) \
476 oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
477 comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
478 netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
479 version.lib odbc32.lib odbccp32.lib
481 # we add LIBC here, since we may be using PerlCRT.dll
482 LIBFILES = $(LIBBASEFILES) $(LIBC)
484 CFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) \
485 $(PCHFLAGS) $(OPTIMIZE)
486 LINK_FLAGS = -nologo -nodefaultlib $(LINK_DBG) \
487 -libpath:"$(INST_COREDIR)" \
488 -machine:$(PROCESSOR_ARCHITECTURE)
493 .IF "$(USE_PERLCRT)" != "define"
494 BUILDOPT += -DPERL_MSVCRT_READFIX
499 .IF "$(USE_OBJECT)" == "define"
500 OPTIMIZE += $(CXX_FLAG)
501 BUILDOPT += -DPERL_OBJECT
504 CFLAGS_O = $(CFLAGS) $(BUILDOPT)
506 # used to allow local linking flags that are not propogated into Config.pm,
510 BLINK_FLAGS = $(PRIV_LINK_FLAGS) $(LINK_FLAGS)
512 #################### do not edit below this line #######################
513 ############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
525 .SUFFIXES : .c $(o) .dll $(a) .exe .rc .res
528 $(CC) -c $(null,$(<:d) $(NULL) -I$(<:d)) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $<
534 .IF "$(CCTYPE)" == "BORLAND"
535 $(LINK32) -Tpd -ap $(BLINK_FLAGS) c0d32$(o) $<,$@,,$(LIBFILES),$(*B).def
536 $(IMPLIB) $(*B).lib $@
537 .ELIF "$(CCTYPE)" == "GCC"
538 $(LINK32) -o $@ $(BLINK_FLAGS) $< $(LIBFILES)
539 $(IMPLIB) --input-def $(*B).def --output-lib $(*B).a $@
541 $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
542 -out:$@ $(BLINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
550 MINIPERL = ..\miniperl.exe
552 PERLEXE = ..\perl.exe
553 WPERLEXE = ..\wperl.exe
554 GLOBEXE = ..\perlglob.exe
555 CONFIGPM = ..\lib\Config.pm
556 MINIMOD = ..\lib\ExtUtils\Miniperl.pm
559 PL2BAT = bin\pl2bat.pl
560 GLOBBAT = bin\perlglob.bat
588 .IF "$(CCTYPE)" == "BORLAND"
590 CFGSH_TMPL = config.bc
591 CFGH_TMPL = config_H.bc
593 .ELIF "$(CCTYPE)" == "GCC"
595 CFGSH_TMPL = config.gc
596 CFGH_TMPL = config_H.gc
597 PERLIMPLIB = ..\libperl56$(a)
601 CFGSH_TMPL = config.vc
602 CFGH_TMPL = config_H.vc
606 PERLIMPLIB *= ..\perl56$(a)
607 PERLDLL = ..\perl56.dll
609 XCOPY = xcopy /f /r /i /d
610 RCOPY = xcopy /f /r /i /e /d
614 # filenames given to xsubpp must have forward slashes (since it puts
615 # full pathnames in #line strings)
616 XSUBPP = ..\$(MINIPERL) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp \
649 EXTRACORE_SRC += perllib.c
651 .IF "$(PERL_MALLOC)" == "define"
652 EXTRACORE_SRC += ..\malloc.c
655 .IF "$(USE_OBJECT)" != "define"
656 EXTRACORE_SRC += ..\perlio.c
664 .IF "$(CRYPT_SRC)" != ""
665 WIN32_SRC += .\$(CRYPT_SRC)
668 DLL_SRC = $(DYNALOADER).c
714 .\include\sys\socket.h \
717 CORE_H = $(CORE_NOCFG_H) .\config.h
719 MICROCORE_OBJ = $(MICROCORE_SRC:db:+$(o))
720 CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:db:+$(o))
721 WIN32_OBJ = $(WIN32_SRC:db:+$(o))
722 MINICORE_OBJ = $(MINIDIR)\{$(MICROCORE_OBJ:f) miniperlmain$(o) perlio$(o)}
723 MINIWIN32_OBJ = $(MINIDIR)\{$(WIN32_OBJ:f)}
724 MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
725 DLL_OBJ = $(DLL_SRC:db:+$(o))
726 X2P_OBJ = $(X2P_SRC:db:+$(o))
728 PERLDLL_OBJ = $(CORE_OBJ)
729 PERLEXE_OBJ = perlmain$(o)
731 PERLDLL_OBJ += $(WIN32_OBJ) $(DLL_OBJ)
733 .IF "$(USE_SETARGV)" != ""
734 SETARGV_OBJ = setargv$(o)
737 DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
738 Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob \
740 STATIC_EXT = DynaLoader
743 DYNALOADER = $(EXTDIR)\DynaLoader\DynaLoader
744 SOCKET = $(EXTDIR)\Socket\Socket
745 FCNTL = $(EXTDIR)\Fcntl\Fcntl
746 OPCODE = $(EXTDIR)\Opcode\Opcode
747 SDBM_FILE = $(EXTDIR)\SDBM_File\SDBM_File
749 POSIX = $(EXTDIR)\POSIX\POSIX
750 ATTRS = $(EXTDIR)\attrs\attrs
751 THREAD = $(EXTDIR)\Thread\Thread
754 DUMPER = $(EXTDIR)\Data\Dumper\Dumper
755 ERRNO = $(EXTDIR)\Errno\Errno
756 PEEK = $(EXTDIR)\Devel\Peek\Peek
757 BYTELOADER = $(EXTDIR)\ByteLoader\ByteLoader
758 DPROF = $(EXTDIR)\Devel\DProf\DProf
759 GLOB = $(EXTDIR)\File\Glob\Glob
760 HOSTNAME = $(EXTDIR)\Sys\Hostname\Hostname
762 SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll
763 FCNTL_DLL = $(AUTODIR)\Fcntl\Fcntl.dll
764 OPCODE_DLL = $(AUTODIR)\Opcode\Opcode.dll
765 SDBM_FILE_DLL = $(AUTODIR)\SDBM_File\SDBM_File.dll
766 IO_DLL = $(AUTODIR)\IO\IO.dll
767 POSIX_DLL = $(AUTODIR)\POSIX\POSIX.dll
768 ATTRS_DLL = $(AUTODIR)\attrs\attrs.dll
769 THREAD_DLL = $(AUTODIR)\Thread\Thread.dll
770 B_DLL = $(AUTODIR)\B\B.dll
771 DUMPER_DLL = $(AUTODIR)\Data\Dumper\Dumper.dll
772 PEEK_DLL = $(AUTODIR)\Devel\Peek\Peek.dll
773 RE_DLL = $(AUTODIR)\re\re.dll
774 BYTELOADER_DLL = $(AUTODIR)\ByteLoader\ByteLoader.dll
775 DPROF_DLL = $(AUTODIR)\Devel\DProf\DProf.dll
776 GLOB_DLL = $(AUTODIR)\File\Glob\Glob.dll
777 HOSTNAME_DLL = $(AUTODIR)\Sys\Hostname\Hostname.dll
779 ERRNO_PM = $(LIBDIR)\Errno.pm
820 POD2HTML = $(PODDIR)\pod2html
821 POD2MAN = $(PODDIR)\pod2man
822 POD2LATEX = $(PODDIR)\pod2latex
823 POD2TEXT = $(PODDIR)\pod2text
825 # vars must be separated by "\t+~\t+", since we're using the tempfile
826 # version of config_sh.pl (we were overflowing someone's buffer by
827 # trying to fit them all on the command line)
830 INST_DRV=$(INST_DRV) ~ \
831 INST_TOP=$(INST_TOP) ~ \
832 INST_VER=$(INST_VER:s/\/\\/) ~ \
833 INST_ARCH=$(INST_ARCH) ~ \
834 archname=$(ARCHNAME) ~ \
836 ccflags=$(OPTIMIZE) $(DEFINES) $(BUILDOPT) ~ \
837 cf_email=$(EMAIL) ~ \
838 d_crypt=$(D_CRYPT) ~ \
839 d_mymalloc=$(PERL_MALLOC) ~ \
840 libs=$(LIBFILES:f) ~ \
841 incpath=$(CCINCDIR) ~ \
842 libperl=$(PERLIMPLIB:f) ~ \
843 libpth=$(CCLIBDIR);$(EXTRALIBDIRS) ~ \
846 _o=$(o) obj_ext=$(o) ~ \
847 _a=$(a) lib_ext=$(a) ~ \
848 static_ext=$(STATIC_EXT) ~ \
849 dynamic_ext=$(DYNAMIC_EXT) ~ \
850 nonxs_ext=$(NONXS_EXT) ~ \
851 use5005threads=$(USE_5005THREADS) ~ \
852 useithreads=$(USE_ITHREADS) ~ \
853 usethreads=$(USE_5005THREADS) ~ \
854 usemultiplicity=$(USE_MULTI) ~ \
855 LINK_FLAGS=$(LINK_FLAGS:s/\/\\/) ~ \
859 # set up targets varying between Win95 and WinNT builds
862 .IF "$(IS_WIN95)" == "define"
864 RIGHTMAKE = __switch_makefiles
868 RIGHTMAKE = __not_needed
875 all : .\config.h $(GLOBEXE) $(MINIPERL) $(MK2) \
876 $(RIGHTMAKE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) \
877 $(X2P) $(EXTENSION_DLL) $(EXTENSION_PM)
879 $(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
881 #----------------------------------------------------------------
883 #-------------------- BEGIN Win95 SPECIFIC ----------------------
885 # this target is a jump-off point for Win95
886 # 1. it switches to the Win95-specific makefile if it exists
887 # (__do_switch_makefiles)
888 # 2. it prints a message when the Win95-specific one finishes (__done)
889 # 3. it then kills this makefile by trying to make __no_such_target
891 __switch_makefiles: __do_switch_makefiles __done __no_such_target
893 __do_switch_makefiles:
894 .IF "$(NOTFIRST)" != "true"
895 if exist $(MK2) $(MAKE:s/-S//) -f $(MK2) $(MAKETARGETS) NOTFIRST=true
900 .IF "$(NOTFIRST)" != "true"
902 @echo Build process complete. Ignore any errors after this message.
903 @echo Run "dmake test" to test and "dmake install" to install
906 # dummy targets for Win95-specific makefile
916 # This target is used to generate the new makefile (.\makefile.95) for Win95
918 .\makefile.95: .\makefile.mk
919 $(MINIPERL) genmk95.pl makefile.mk $(MK2)
921 #--------------------- END Win95 SPECIFIC ---------------------
923 # a blank target for when builds don't need to do certain things
924 # this target added for Win95 port but used to keep the WinNT port able to
929 $(GLOBEXE) : perlglob$(o)
930 .IF "$(CCTYPE)" == "BORLAND"
931 $(CC) -c -w -v -tWM -I"$(CCINCDIR)" perlglob.c
932 $(LINK32) -Tpe -ap $(BLINK_FLAGS) c0x32$(o) perlglob$(o) \
933 "$(CCLIBDIR)\32BIT\wildargs$(o)",$@,,import32.lib cw32mt.lib,
934 .ELIF "$(CCTYPE)" == "GCC"
935 $(LINK32) $(BLINK_FLAGS) -mconsole -o $@ perlglob$(o) $(LIBFILES)
937 $(LINK32) $(BLINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
938 perlglob$(o) setargv$(o)
941 perlglob$(o) : perlglob.c
943 config.w32 : $(CFGSH_TMPL)
944 copy $(CFGSH_TMPL) config.w32
946 .\config.h : $(CFGH_TMPL) $(CORE_NOCFG_H)
948 copy $(CFGH_TMPL) config.h
950 ..\config.sh : config.w32 $(MINIPERL) config_sh.PL
951 $(MINIPERL) -I..\lib config_sh.PL --cfgsh-option-file \
952 $(mktmp $(CFG_VARS)) config.w32 > ..\config.sh
954 # this target is for when changes to the main config.sh happen
955 # edit config.{b,v,g}c and make this target once for each supported
956 # compiler (e.g. `dmake CCTYPE=BORLAND regen_config_h`)
958 perl config_sh.PL --cfgsh-option-file $(mktmp $(CFG_VARS)) \
959 $(CFGSH_TMPL) > ..\config.sh
960 -cd .. && del /f perl.exe
961 cd .. && perl configpm
964 -perl -I..\lib config_h.PL "INST_VER=$(INST_VER)"
965 rename config.h $(CFGH_TMPL)
967 $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
968 cd .. && miniperl configpm
969 if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
970 $(XCOPY) ..\*.h $(COREDIR)\*.*
971 $(XCOPY) *.h $(COREDIR)\*.*
972 $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.*
973 $(RCOPY) include $(COREDIR)\*.*
974 $(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \
975 || $(MAKE) $(MAKEMACROS) $(CONFIGPM) $(MAKEFILE)
977 $(MINIPERL) : $(MINIDIR) $(MINI_OBJ) $(CRTIPMLIBS)
978 .IF "$(CCTYPE)" == "BORLAND"
979 $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
980 @$(mktmp c0x32$(o) $(MINI_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
981 .ELIF "$(CCTYPE)" == "GCC"
982 $(LINK32) -v -mconsole -o $@ $(BLINK_FLAGS) \
983 $(mktmp $(LKPRE) $(MINI_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
985 $(LINK32) -subsystem:console -out:$@ \
986 @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(MINI_OBJ:s,\,\\))
990 if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
992 $(MINICORE_OBJ) : $(CORE_NOCFG_H)
993 $(CC) -c $(CFLAGS) -DPERL_EXTERNAL_GLOB $(OBJOUT_FLAG)$@ ..\$(*B).c
995 $(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
996 $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*B).c
998 # -DPERL_IMPLICIT_SYS needs C++ for perllib.c
999 # rules wrapped in .IFs break Win9X build (we end up with unbalanced []s unless
1000 # unless the .IF is true), so instead we use a .ELSE with the default.
1001 # This is the only file that depends on perlhost.h, vmem.h, and vdir.h
1003 perllib$(o) : perllib.c .\perlhost.h .\vdir.h .\vmem.h
1004 .IF "$(USE_IMP_SYS)$(USE_OBJECT)" == "defineundef"
1005 $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
1007 $(CC) -c -I. $(CFLAGS_O) $(OBJOUT_FLAG)$@ perllib.c
1010 # 1. we don't want to rebuild miniperl.exe when config.h changes
1011 # 2. we don't want to rebuild miniperl.exe with non-default config.h
1012 $(MINI_OBJ) : $(CORE_NOCFG_H)
1014 $(WIN32_OBJ) : $(CORE_H)
1015 $(CORE_OBJ) : $(CORE_H)
1016 $(DLL_OBJ) : $(CORE_H)
1017 $(X2P_OBJ) : $(CORE_H)
1019 perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl
1020 $(MINIPERL) -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) \
1021 $(BUILDOPT) CCTYPE=$(CCTYPE) > perldll.def
1023 $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES)
1024 .IF "$(CCTYPE)" == "BORLAND"
1025 $(LINK32) -Tpd -ap $(BLINK_FLAGS) \
1026 @$(mktmp c0d32$(o) $(PERLDLL_OBJ:s,\,\\)\n \
1031 .ELIF "$(CCTYPE)" == "GCC"
1032 $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(BLINK_FLAGS) \
1033 $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
1034 dlltool --output-lib $(PERLIMPLIB) \
1035 --dllname $(PERLDLL:b).dll \
1037 --base-file perl.base \
1038 --output-exp perl.exp
1039 $(LINK32) -mdll -o $@ $(BLINK_FLAGS) \
1040 $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) \
1043 $(LINK32) -dll -def:perldll.def -out:$@ \
1044 @$(mktmp $(BLINK_FLAGS) $(LIBFILES) /base:0x28000000 $(PERLDLL_RES) $(PERLDLL_OBJ:s,\,\\))
1046 $(XCOPY) $(PERLIMPLIB) $(COREDIR)
1048 $(MINIMOD) : $(MINIPERL) ..\minimod.pl
1049 cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
1051 ..\x2p\a2p$(o) : ..\x2p\a2p.c
1052 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\a2p.c
1054 ..\x2p\hash$(o) : ..\x2p\hash.c
1055 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\hash.c
1057 ..\x2p\str$(o) : ..\x2p\str.c
1058 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\str.c
1060 ..\x2p\util$(o) : ..\x2p\util.c
1061 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\util.c
1063 ..\x2p\walk$(o) : ..\x2p\walk.c
1064 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\walk.c
1066 $(X2P) : $(MINIPERL) $(X2P_OBJ)
1067 $(MINIPERL) ..\x2p\find2perl.PL
1068 $(MINIPERL) ..\x2p\s2p.PL
1069 .IF "$(CCTYPE)" == "BORLAND"
1070 $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
1071 @$(mktmp c0x32$(o) $(X2P_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
1072 .ELIF "$(CCTYPE)" == "GCC"
1073 $(LINK32) -v -o $@ $(BLINK_FLAGS) \
1074 $(mktmp $(LKPRE) $(X2P_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
1076 $(LINK32) -subsystem:console -out:$@ \
1077 @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(X2P_OBJ:s,\,\\))
1080 perlmain.c : runperl.c
1081 copy runperl.c perlmain.c
1083 perlmain$(o) : perlmain.c
1084 $(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c
1086 $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES)
1087 .IF "$(CCTYPE)" == "BORLAND"
1088 $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
1089 @$(mktmp c0x32$(o) $(PERLEXE_OBJ:s,\,\\)\n \
1091 $(PERLIMPLIB) $(LIBFILES)\n)
1092 .ELIF "$(CCTYPE)" == "GCC"
1093 $(LINK32) -mconsole -o $@ $(BLINK_FLAGS) \
1094 $(PERLEXE_OBJ) $(PERLIMPLIB) $(LIBFILES)
1096 $(LINK32) -subsystem:console -out:$@ $(BLINK_FLAGS) $(LIBFILES) \
1097 $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES)
1099 copy $(PERLEXE) $(WPERLEXE)
1100 $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS
1101 copy splittree.pl ..
1102 $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
1104 $(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
1105 if not exist $(AUTODIR) mkdir $(AUTODIR)
1106 cd $(EXTDIR)\$(*B) && ..\$(MINIPERL) -I..\..\lib $(*B)_pm.PL
1107 cd $(EXTDIR)\$(*B) && ..\$(MINIPERL) -I..\..\lib XSLoader_pm.PL
1108 $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
1109 $(XCOPY) $(EXTDIR)\$(*B)\XSLoader.pm $(LIBDIR)\$(NULL)
1110 cd $(EXTDIR)\$(*B) && $(XSUBPP) dl_win32.xs > $(*B).c
1111 $(XCOPY) $(EXTDIR)\$(*B)\dlutils.c .
1113 $(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
1114 copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
1116 $(DUMPER_DLL): $(PERLEXE) $(DUMPER).xs
1117 cd $(EXTDIR)\Data\$(*B) && \
1118 ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
1119 cd $(EXTDIR)\Data\$(*B) && $(MAKE)
1121 $(DPROF_DLL): $(PERLEXE) $(DPROF).xs
1122 cd $(EXTDIR)\Devel\$(*B) && \
1123 ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
1124 cd $(EXTDIR)\Devel\$(*B) && $(MAKE)
1126 $(GLOB_DLL): $(PERLEXE) $(GLOB).xs
1127 cd $(EXTDIR)\File\$(*B) && \
1128 ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
1129 cd $(EXTDIR)\File\$(*B) && $(MAKE)
1131 $(PEEK_DLL): $(PERLEXE) $(PEEK).xs
1132 cd $(EXTDIR)\Devel\$(*B) && \
1133 ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
1134 cd $(EXTDIR)\Devel\$(*B) && $(MAKE)
1136 $(RE_DLL): $(PERLEXE) $(RE).xs
1137 cd $(EXTDIR)\$(*B) && \
1138 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1139 cd $(EXTDIR)\$(*B) && $(MAKE)
1141 $(B_DLL): $(PERLEXE) $(B).xs
1142 cd $(EXTDIR)\$(*B) && \
1143 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1144 cd $(EXTDIR)\$(*B) && $(MAKE)
1146 $(THREAD_DLL): $(PERLEXE) $(THREAD).xs
1147 cd $(EXTDIR)\$(*B) && \
1148 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1149 cd $(EXTDIR)\$(*B) && $(MAKE)
1151 $(ATTRS_DLL): $(PERLEXE) $(ATTRS).xs
1152 cd $(EXTDIR)\$(*B) && \
1153 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1154 cd $(EXTDIR)\$(*B) && $(MAKE)
1156 $(POSIX_DLL): $(PERLEXE) $(POSIX).xs
1157 cd $(EXTDIR)\$(*B) && \
1158 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1159 cd $(EXTDIR)\$(*B) && $(MAKE)
1161 $(IO_DLL): $(PERLEXE) $(IO).xs
1162 cd $(EXTDIR)\$(*B) && \
1163 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1164 cd $(EXTDIR)\$(*B) && $(MAKE)
1166 $(SDBM_FILE_DLL) : $(PERLEXE) $(SDBM_FILE).xs
1167 cd $(EXTDIR)\$(*B) && \
1168 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1169 cd $(EXTDIR)\$(*B) && $(MAKE)
1171 $(FCNTL_DLL): $(PERLEXE) $(FCNTL).xs
1172 cd $(EXTDIR)\$(*B) && \
1173 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1174 cd $(EXTDIR)\$(*B) && $(MAKE)
1176 $(OPCODE_DLL): $(PERLEXE) $(OPCODE).xs
1177 cd $(EXTDIR)\$(*B) && \
1178 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1179 cd $(EXTDIR)\$(*B) && $(MAKE)
1181 $(SOCKET_DLL): $(PERLEXE) $(SOCKET).xs
1182 cd $(EXTDIR)\$(*B) && \
1183 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1184 cd $(EXTDIR)\$(*B) && $(MAKE)
1186 $(HOSTNAME_DLL): $(PERLEXE) $(HOSTNAME).xs
1187 cd $(EXTDIR)\Sys\$(*B) && \
1188 ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
1189 cd $(EXTDIR)\Sys\$(*B) && $(MAKE)
1191 $(BYTELOADER_DLL): $(PERLEXE) $(BYTELOADER).xs
1192 cd $(EXTDIR)\$(*B) && \
1193 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1194 cd $(EXTDIR)\$(*B) && $(MAKE)
1196 $(ERRNO_PM): $(PERLEXE) $(ERRNO)_pm.PL
1197 cd $(EXTDIR)\$(*B) && \
1198 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1199 cd $(EXTDIR)\$(*B) && $(MAKE)
1202 $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=./html \
1203 --podpath=pod:lib:ext:utils --htmlroot="file://$(INST_HTML:s,:,|,)"\
1204 --libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse
1206 utils: $(PERLEXE) $(X2P)
1207 cd ..\utils && $(MAKE) PERL=$(MINIPERL)
1208 copy ..\README.win32 ..\pod\perlwin32.pod
1209 cd ..\pod && $(MAKE) -f ..\win32\pod.mak converters
1210 $(PERLEXE) $(PL2BAT) $(UTILS)
1213 -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \
1214 $(PERLIMPLIB) ..\miniperl$(a) $(MINIMOD)
1216 -del /f $(EXTENSION_DLL) $(EXTENSION_PM)
1217 -del /f $(EXTENSION_C) $(DYNALOADER).c $(ERRNO).pm
1218 -del /f $(EXTDIR)\DynaLoader\dl_win32.xs
1219 -del /f $(LIBDIR)\.exists $(LIBDIR)\attrs.pm $(LIBDIR)\DynaLoader.pm
1220 -del /f $(LIBDIR)\XSLoader.pm
1221 -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
1222 -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm $(LIBDIR)\Thread.pm
1223 -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
1224 -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
1225 -del /f $(LIBDIR)\Data\Dumper.pm $(LIBDIR)\ByteLoader.pm
1226 -del /f $(LIBDIR)\Devel\Peek.pm $(LIBDIR)\Devel\DProf.pm
1227 -del /f $(LIBDIR)\File\Glob.pm
1228 -rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO
1229 -rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread
1230 -rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B
1231 -rmdir /s /q $(LIBDIR)\Data || rmdir /s $(LIBDIR)\Data
1232 -del /f $(PODDIR)\*.html
1233 -del /f $(PODDIR)\*.bat
1234 -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc \
1236 -cd ..\x2p && del /f find2perl s2p *.bat
1237 -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
1240 -cd $(EXTDIR) && del /s *$(a) *.def *.map *.pdb *.bs Makefile *$(o) \
1242 -rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR)
1243 -rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR)
1245 install : all installbare installhtml
1247 installbare : $(RIGHTMAKE) utils
1248 $(PERLEXE) ..\installperl
1249 if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\*.*
1250 $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
1251 $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.*
1254 $(RCOPY) html\*.* $(INST_HTML)\*.*
1256 inst_lib : $(CONFIGPM)
1257 copy splittree.pl ..
1258 $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
1259 $(RCOPY) ..\lib $(INST_LIB)\*.*
1261 minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) utils
1262 $(XCOPY) $(MINIPERL) ..\t\perl.exe
1263 .IF "$(CCTYPE)" == "BORLAND"
1264 $(XCOPY) $(GLOBBAT) ..\t\$(NULL)
1266 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1271 $(MINIPERL) -I..\lib test base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t
1273 test-prep : all utils
1274 $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1275 $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1276 .IF "$(CCTYPE)" == "BORLAND"
1277 $(XCOPY) $(GLOBBAT) ..\t\$(NULL)
1279 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1282 test : $(RIGHTMAKE) test-prep
1283 cd ..\t && $(PERLEXE) -I..\lib harness
1285 test-notty : test-prep
1286 set PERL_SKIP_TTY_TEST=1 && \
1287 cd ..\t && $(PERLEXE) -I.\lib harness
1289 test-wide : test-prep
1290 set HARNESS_PERL_SWITCHES=-C && \
1291 cd ..\t && $(PERLEXE) -I..\lib harness
1293 test-wide-notty : test-prep
1294 set PERL_SKIP_TTY_TEST=1 && \
1295 set HARNESS_PERL_SWITCHES=-C && \
1296 cd ..\t && $(PERLEXE) -I..\lib harness
1299 -@erase miniperlmain$(o)
1301 -@erase perlglob$(o)
1302 -@erase perlmain$(o)
1310 -rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR)
1311 -@erase $(WIN32_OBJ)
1314 -@erase ..\*$(o) ..\*$(a) ..\*.exp *$(o) *$(a) *.exp *.res
1315 -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
1316 -@erase ..\x2p\*.exe ..\x2p\*.bat