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 # (perl56.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 # Beginnings of interpreter cloning/threads; still very incomplete.
57 # This should be enabled to get the fork() emulation. This needs
60 #USE_ITHREADS *= define
63 # uncomment to enable the implicit "host" layer for all system calls
64 # made by perl. This needs USE_MULTI above. This is also needed to
67 #USE_IMP_SYS *= define
70 # WARNING! This option is deprecated and will eventually go away (enable
71 # USE_ITHREADS instead).
73 # uncomment to enable threads-capabilities. This is incompatible with
74 # USE_ITHREADS, and is only here for people who may have come to rely
75 # on the experimental Thread support that was in 5.005.
77 #USE_5005THREADS *= define
80 # WARNING! This option is deprecated and will eventually go away (enable
83 # uncomment next line if you want to use the PERL_OBJECT build option.
84 # DO NOT ENABLE unless you have legacy code that relies on the C++
85 # CPerlObj class that was available in 5.005. This cannot be enabled
86 # if you ask for USE_5005THREADS above.
91 # uncomment exactly one of the following
95 # Visual C++ > 2.x and < 6.x
99 # Borland 5.02 or later
101 # mingw32+gcc-2.95.2 or better
105 # uncomment this if you are compiling under Windows 95/98 and command.com
106 # (not needed if you're running under 4DOS/NT 6.01 or later)
110 # uncomment next line if you want debug version of perl (big,slow)
111 # If not enabled, we automatically try to use maximum optimization
112 # with all compilers that are known to have a working optimizer.
117 # uncomment to enable use of PerlCRT.DLL when using the Visual C compiler.
118 # It has patches that fix known bugs in older versions of MSVCRT.DLL.
119 # This currently requires VC 5.0 with Service Pack 3 or later.
120 # Get it from CPAN at http://www.perl.com/CPAN/authors/id/D/DO/DOUGL/
121 # and follow the directions in the package to install.
123 # Not recommended if you have VC 6.x and you're not running Windows 9x.
125 #USE_PERLCRT *= define
128 # uncomment to enable linking with setargv.obj under the Visual C
129 # compiler. Setting this options enables perl to expand wildcards in
130 # arguments, but it may be harder to use alternate methods like
131 # File::DosGlob that are more powerful. This option is supported only with
134 #USE_SETARGV *= define
137 # if you have the source for des_fcrypt(), uncomment this and make sure the
138 # file exists (see README.win32). File should be located in the same
139 # directory as this file.
141 #CRYPT_SRC *= fcrypt.c
144 # if you didn't set CRYPT_SRC and if you have des_fcrypt() available in a
145 # library, uncomment this, and make sure the library exists (see README.win32)
146 # Specify the full pathname of the library.
148 #CRYPT_LIB *= fcrypt.lib
151 # set this if you wish to use perl's malloc
152 # WARNING: Turning this on/off WILL break binary compatibility with extensions
153 # you may have compiled with/without it. Be prepared to recompile all
154 # extensions if you change the default. Currently, this cannot be enabled
155 # if you ask for USE_IMP_SYS above.
157 #PERL_MALLOC *= define
160 # set the install locations of the compiler include/libraries
161 # Running VCVARS32.BAT is *required* when using Visual C.
162 # Some versions of Visual C don't define MSVCDIR in the environment,
163 # so you may have to set CCHOME explicitly (spaces in the path name should
167 #CCHOME *= $(MSVCDIR)
168 CCHOME *= c:\gcc-2.95.2-msvcrt
169 CCINCDIR *= $(CCHOME)\include
170 CCLIBDIR *= $(CCHOME)\lib
173 # Additional compiler flags can be specified here.
177 # This should normally be disabled. Adding -DPERL_POLLUTE enables support
178 # for old symbols by default, at the expense of extreme pollution. You most
179 # probably just want to build modules that won't compile with
180 # perl Makefile.PL POLLUTE=1
181 # instead of enabling this. Please report such modules to the respective
184 #BUILDOPT += -DPERL_POLLUTE
187 # This should normally be disabled. Enabling it will disable the File::Glob
188 # implementation of CORE::glob.
190 #BUILDOPT += -DPERL_EXTERNAL_GLOB
193 # This should normally be disabled. Enabling it causes perl to read scripts
194 # in text mode (which is the 5.005 behavior) and will break ByteLoader.
195 #BUILDOPT += -DPERL_TEXTMODE_SCRIPTS
198 # specify semicolon-separated list of extra directories that modules will
199 # look for libraries (spaces in path names need not be quoted)
204 # set this to point to cmd.exe (only needed if you use some
205 # alternate shell that doesn't grok cmd.exe style commands)
207 #SHELL *= g:\winnt\system32\cmd.exe
210 # set this to your email address (perl will guess a value from
211 # from your loginname and your hostname, which may not be right)
216 ## Build configuration ends.
219 ##################### CHANGE THESE ONLY IF YOU MUST #####################
221 .IF "$(CRYPT_SRC)$(CRYPT_LIB)" == ""
225 CRYPT_FLAG = -DHAVE_DES_FCRYPT
228 .IF "$(USE_OBJECT)" == "define"
230 USE_5005THREADS != undef
232 USE_IMP_SYS != define
237 USE_5005THREADS *= undef
239 .IF "$(USE_5005THREADS)" == "define"
240 USE_ITHREADS != undef
243 .IF "$(USE_IMP_SYS)" == "define"
249 USE_ITHREADS *= undef
253 .IF "$(USE_IMP_SYS)$(USE_MULTI)$(USE_5005THREADS)$(USE_OBJECT)" == "defineundefundefundef"
257 .IF "$(USE_ITHREADS)$(USE_MULTI)$(USE_OBJECT)" == "defineundefundef"
259 USE_5005THREADS != undef
262 .IF "$(USE_MULTI)$(USE_5005THREADS)$(USE_OBJECT)" != "undefundefundef"
263 BUILDOPT += -DPERL_IMPLICIT_CONTEXT
266 .IF "$(USE_IMP_SYS)" != "undef"
267 BUILDOPT += -DPERL_IMPLICIT_SYS
270 .IMPORT .IGNORE : PROCESSOR_ARCHITECTURE
272 PROCESSOR_ARCHITECTURE *= x86
274 .IF "$(USE_OBJECT)" == "define"
275 ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-object
276 .ELIF "$(USE_5005THREADS)" == "define"
277 ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-thread
278 .ELIF "$(USE_MULTI)" == "define"
279 ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-multi
281 ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)
284 .IF "$(USE_ITHREADS)" == "define"
285 ARCHNAME !:= $(ARCHNAME)-thread
288 # Visual Studio 98 specific
289 .IF "$(CCTYPE)" == "MSVC60"
291 # VC 6.0 can load the socket dll on demand. Makes the test suite
292 # run in about 10% less time.
293 DELAYLOAD *= -DELAYLOAD:wsock32.dll -DELAYLOAD:shell32.dll delayimp.lib
295 # VC 6.0 seems capable of compiling perl correctly with optimizations
296 # enabled. Anything earlier fails tests.
300 ARCHDIR = ..\lib\$(ARCHNAME)
301 COREDIR = ..\lib\CORE
302 AUTODIR = ..\lib\auto
306 EXTUTILSDIR = $(LIBDIR)\ExtUtils
309 INST_SCRIPT = $(INST_TOP)$(INST_VER)\bin
310 INST_BIN = $(INST_SCRIPT)$(INST_ARCH)
311 INST_LIB = $(INST_TOP)$(INST_VER)\lib
312 INST_ARCHLIB = $(INST_LIB)$(INST_ARCH)
313 INST_COREDIR = $(INST_ARCHLIB)\CORE
314 INST_POD = $(INST_LIB)\pod
315 INST_HTML = $(INST_POD)\html
318 # Programs to compile, build .lib files and link
323 .IF "$(CCTYPE)" == "BORLAND"
334 INCLUDES = -I$(COREDIR) -I.\include -I. -I.. -I"$(CCINCDIR)"
335 #PCHFLAGS = -H -Hc -H=c:\temp\bcmoduls.pch
336 DEFINES = -DWIN32 $(CRYPT_FLAG)
337 LOCDEFS = -DPERLDLL -DPERL_CORE
342 LIBFILES = $(CRYPT_LIB) import32.lib $(LIBC) odbc32.lib odbccp32.lib
344 .IF "$(CFG)" == "Debug"
345 OPTIMIZE = -v -D_RTLDLL -DDEBUGGING
348 OPTIMIZE = -O2 -D_RTLDLL
352 CFLAGS = -w -g0 -tWM -tWD $(INCLUDES) $(DEFINES) $(LOCDEFS) \
353 $(PCHFLAGS) $(OPTIMIZE)
354 LINK_FLAGS = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)"
359 .ELIF "$(CCTYPE)" == "GCC"
374 INCLUDES = -I$(COREDIR) -I.\include -I. -I..
375 DEFINES = -DWIN32 $(CRYPT_FLAG)
376 LOCDEFS = -DPERLDLL -DPERL_CORE
383 LIBFILES = $(CRYPT_LIB) $(LIBC) \
384 -lmoldname -lkernel32 -luser32 -lgdi32 \
385 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 \
386 -loleaut32 -lnetapi32 -luuid -lwsock32 -lmpr \
387 -lwinmm -lversion -lodbc32
389 .IF "$(CFG)" == "Debug"
390 OPTIMIZE = -g -DDEBUGGING
397 CFLAGS = $(INCLUDES) $(DEFINES) $(LOCDEFS) $(OPTIMIZE)
398 LINK_FLAGS = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)"
403 # NOTE: we assume that GCC uses MSVCRT.DLL
404 BUILDOPT += -fno-strict-aliasing -DPERL_MSVCRT_READFIX
410 LIB32 = $(LINK32) -lib
417 INCLUDES = -I$(COREDIR) -I.\include -I. -I..
418 #PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX
419 DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT $(CRYPT_FLAG)
420 LOCDEFS = -DPERLDLL -DPERL_CORE
424 .IF "$(USE_PERLCRT)" != "define"
433 .IF "$(CFG)" == "Debug"
434 .IF "$(CCTYPE)" == "MSVC20"
435 OPTIMIZE = -Od -MD -Z7 -DDEBUGGING
437 OPTIMIZE = -Od -MD -Zi -DDEBUGGING
439 LINK_DBG = -debug -pdb:none
441 .IF "$(CFG)" == "Optimize"
442 # -O1 yields smaller code, which turns out to be faster than -O2
443 #OPTIMIZE = -O2 -MD -DNDEBUG
444 OPTIMIZE = -O1 -MD -DNDEBUG
446 OPTIMIZE = -Od -MD -DNDEBUG
451 LIBBASEFILES = $(CRYPT_LIB) \
452 oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
453 comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
454 netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
455 version.lib odbc32.lib odbccp32.lib
457 # we add LIBC here, since we may be using PerlCRT.dll
458 LIBFILES = $(LIBBASEFILES) $(LIBC)
460 CFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) \
461 $(PCHFLAGS) $(OPTIMIZE)
462 LINK_FLAGS = -nologo -nodefaultlib $(LINK_DBG) \
463 -libpath:"$(INST_COREDIR)" \
464 -machine:$(PROCESSOR_ARCHITECTURE)
469 .IF "$(USE_PERLCRT)" != "define"
470 BUILDOPT += -DPERL_MSVCRT_READFIX
475 .IF "$(USE_OBJECT)" == "define"
476 OPTIMIZE += $(CXX_FLAG)
477 BUILDOPT += -DPERL_OBJECT
480 CFLAGS_O = $(CFLAGS) $(BUILDOPT)
482 # used to allow local linking flags that are not propogated into Config.pm,
486 BLINK_FLAGS = $(PRIV_LINK_FLAGS) $(LINK_FLAGS)
488 #################### do not edit below this line #######################
489 ############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
501 .SUFFIXES : .c $(o) .dll $(a) .exe .rc .res
504 $(CC) -c $(null,$(<:d) $(NULL) -I$(<:d)) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $<
510 .IF "$(CCTYPE)" == "BORLAND"
511 $(LINK32) -Tpd -ap $(BLINK_FLAGS) c0d32$(o) $<,$@,,$(LIBFILES),$(*B).def
512 $(IMPLIB) $(*B).lib $@
513 .ELIF "$(CCTYPE)" == "GCC"
514 $(LINK32) -o $@ $(BLINK_FLAGS) $< $(LIBFILES)
515 $(IMPLIB) --input-def $(*B).def --output-lib $(*B).a $@
517 $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
518 -out:$@ $(BLINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
526 MINIPERL = ..\miniperl.exe
528 PERLEXE = ..\perl.exe
529 WPERLEXE = ..\wperl.exe
530 GLOBEXE = ..\perlglob.exe
531 CONFIGPM = ..\lib\Config.pm
532 MINIMOD = ..\lib\ExtUtils\Miniperl.pm
535 PL2BAT = bin\pl2bat.pl
536 GLOBBAT = bin\perlglob.bat
564 .IF "$(CCTYPE)" == "BORLAND"
566 CFGSH_TMPL = config.bc
567 CFGH_TMPL = config_H.bc
569 .ELIF "$(CCTYPE)" == "GCC"
571 CFGSH_TMPL = config.gc
572 CFGH_TMPL = config_H.gc
573 PERLIMPLIB = ..\libperl56$(a)
577 CFGSH_TMPL = config.vc
578 CFGH_TMPL = config_H.vc
582 PERLIMPLIB *= ..\perl56$(a)
583 PERLDLL = ..\perl56.dll
585 XCOPY = xcopy /f /r /i /d
586 RCOPY = xcopy /f /r /i /e /d
590 # filenames given to xsubpp must have forward slashes (since it puts
591 # full pathnames in #line strings)
592 XSUBPP = ..\$(MINIPERL) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp \
625 EXTRACORE_SRC += perllib.c
627 .IF "$(PERL_MALLOC)" == "define"
628 EXTRACORE_SRC += ..\malloc.c
631 .IF "$(USE_OBJECT)" != "define"
632 EXTRACORE_SRC += ..\perlio.c
640 .IF "$(CRYPT_SRC)" != ""
641 WIN32_SRC += .\$(CRYPT_SRC)
644 DLL_SRC = $(DYNALOADER).c
690 .\include\sys\socket.h \
693 CORE_H = $(CORE_NOCFG_H) .\config.h
695 MICROCORE_OBJ = $(MICROCORE_SRC:db:+$(o))
696 CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:db:+$(o))
697 WIN32_OBJ = $(WIN32_SRC:db:+$(o))
698 MINICORE_OBJ = $(MINIDIR)\{$(MICROCORE_OBJ:f) miniperlmain$(o) perlio$(o)}
699 MINIWIN32_OBJ = $(MINIDIR)\{$(WIN32_OBJ:f)}
700 MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
701 DLL_OBJ = $(DLL_SRC:db:+$(o))
702 X2P_OBJ = $(X2P_SRC:db:+$(o))
704 PERLDLL_OBJ = $(CORE_OBJ)
705 PERLEXE_OBJ = perlmain$(o)
707 PERLDLL_OBJ += $(WIN32_OBJ) $(DLL_OBJ)
709 .IF "$(USE_SETARGV)" != ""
710 SETARGV_OBJ = setargv$(o)
713 DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
714 Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob \
716 STATIC_EXT = DynaLoader
719 DYNALOADER = $(EXTDIR)\DynaLoader\DynaLoader
720 SOCKET = $(EXTDIR)\Socket\Socket
721 FCNTL = $(EXTDIR)\Fcntl\Fcntl
722 OPCODE = $(EXTDIR)\Opcode\Opcode
723 SDBM_FILE = $(EXTDIR)\SDBM_File\SDBM_File
725 POSIX = $(EXTDIR)\POSIX\POSIX
726 ATTRS = $(EXTDIR)\attrs\attrs
727 THREAD = $(EXTDIR)\Thread\Thread
730 DUMPER = $(EXTDIR)\Data\Dumper\Dumper
731 ERRNO = $(EXTDIR)\Errno\Errno
732 PEEK = $(EXTDIR)\Devel\Peek\Peek
733 BYTELOADER = $(EXTDIR)\ByteLoader\ByteLoader
734 DPROF = $(EXTDIR)\Devel\DProf\DProf
735 GLOB = $(EXTDIR)\File\Glob\Glob
736 HOSTNAME = $(EXTDIR)\Sys\Hostname\Hostname
738 SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll
739 FCNTL_DLL = $(AUTODIR)\Fcntl\Fcntl.dll
740 OPCODE_DLL = $(AUTODIR)\Opcode\Opcode.dll
741 SDBM_FILE_DLL = $(AUTODIR)\SDBM_File\SDBM_File.dll
742 IO_DLL = $(AUTODIR)\IO\IO.dll
743 POSIX_DLL = $(AUTODIR)\POSIX\POSIX.dll
744 ATTRS_DLL = $(AUTODIR)\attrs\attrs.dll
745 THREAD_DLL = $(AUTODIR)\Thread\Thread.dll
746 B_DLL = $(AUTODIR)\B\B.dll
747 DUMPER_DLL = $(AUTODIR)\Data\Dumper\Dumper.dll
748 PEEK_DLL = $(AUTODIR)\Devel\Peek\Peek.dll
749 RE_DLL = $(AUTODIR)\re\re.dll
750 BYTELOADER_DLL = $(AUTODIR)\ByteLoader\ByteLoader.dll
751 DPROF_DLL = $(AUTODIR)\Devel\DProf\DProf.dll
752 GLOB_DLL = $(AUTODIR)\File\Glob\Glob.dll
753 HOSTNAME_DLL = $(AUTODIR)\Sys\Hostname\Hostname.dll
755 ERRNO_PM = $(LIBDIR)\Errno.pm
796 POD2HTML = $(PODDIR)\pod2html
797 POD2MAN = $(PODDIR)\pod2man
798 POD2LATEX = $(PODDIR)\pod2latex
799 POD2TEXT = $(PODDIR)\pod2text
801 # vars must be separated by "\t+~\t+", since we're using the tempfile
802 # version of config_sh.pl (we were overflowing someone's buffer by
803 # trying to fit them all on the command line)
806 INST_DRV=$(INST_DRV) ~ \
807 INST_TOP=$(INST_TOP:s/\/\\/) ~ \
808 INST_VER=$(INST_VER:s/\/\\/) ~ \
809 INST_ARCH=$(INST_ARCH) ~ \
810 archname=$(ARCHNAME) ~ \
812 ccflags=$(OPTIMIZE) $(DEFINES) $(BUILDOPT) ~ \
813 cf_email=$(EMAIL) ~ \
814 d_crypt=$(D_CRYPT) ~ \
815 d_mymalloc=$(PERL_MALLOC) ~ \
816 libs=$(LIBFILES:f) ~ \
817 incpath=$(CCINCDIR:s/\/\\/) ~ \
818 libperl=$(PERLIMPLIB:f) ~ \
819 libpth=$(CCLIBDIR:s/\/\\/);$(EXTRALIBDIRS:s/\/\\/) ~ \
822 _o=$(o) obj_ext=$(o) ~ \
823 _a=$(a) lib_ext=$(a) ~ \
824 static_ext=$(STATIC_EXT) ~ \
825 dynamic_ext=$(DYNAMIC_EXT) ~ \
826 nonxs_ext=$(NONXS_EXT) ~ \
827 use5005threads=$(USE_5005THREADS) ~ \
828 useithreads=$(USE_ITHREADS) ~ \
829 usethreads=$(USE_5005THREADS) ~ \
830 usemultiplicity=$(USE_MULTI) ~ \
831 LINK_FLAGS=$(LINK_FLAGS:s/\/\\/) ~ \
835 # set up targets varying between Win95 and WinNT builds
838 .IF "$(IS_WIN95)" == "define"
840 RIGHTMAKE = __switch_makefiles
844 RIGHTMAKE = __not_needed
851 all : .\config.h $(GLOBEXE) $(MINIPERL) $(MK2) \
852 $(RIGHTMAKE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) \
853 $(X2P) $(EXTENSION_DLL) $(EXTENSION_PM)
855 $(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
857 #----------------------------------------------------------------
859 #-------------------- BEGIN Win95 SPECIFIC ----------------------
861 # this target is a jump-off point for Win95
862 # 1. it switches to the Win95-specific makefile if it exists
863 # (__do_switch_makefiles)
864 # 2. it prints a message when the Win95-specific one finishes (__done)
865 # 3. it then kills this makefile by trying to make __no_such_target
867 __switch_makefiles: __do_switch_makefiles __done __no_such_target
869 __do_switch_makefiles:
870 .IF "$(NOTFIRST)" != "true"
871 if exist $(MK2) $(MAKE:s/-S//) -f $(MK2) $(MAKETARGETS) NOTFIRST=true
876 .IF "$(NOTFIRST)" != "true"
878 @echo Build process complete. Ignore any errors after this message.
879 @echo Run "dmake test" to test and "dmake install" to install
882 # dummy targets for Win95-specific makefile
892 # This target is used to generate the new makefile (.\makefile.95) for Win95
894 .\makefile.95: .\makefile.mk
895 $(MINIPERL) genmk95.pl makefile.mk $(MK2)
897 #--------------------- END Win95 SPECIFIC ---------------------
899 # a blank target for when builds don't need to do certain things
900 # this target added for Win95 port but used to keep the WinNT port able to
905 $(GLOBEXE) : perlglob$(o)
906 .IF "$(CCTYPE)" == "BORLAND"
907 $(CC) -c -w -v -tWM -I"$(CCINCDIR)" perlglob.c
908 $(LINK32) -Tpe -ap $(BLINK_FLAGS) c0x32$(o) perlglob$(o) \
909 "$(CCLIBDIR)\32BIT\wildargs$(o)",$@,,import32.lib cw32mt.lib,
910 .ELIF "$(CCTYPE)" == "GCC"
911 $(LINK32) $(BLINK_FLAGS) -mconsole -o $@ perlglob$(o) $(LIBFILES)
913 $(LINK32) $(BLINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
914 perlglob$(o) setargv$(o)
917 perlglob$(o) : perlglob.c
919 config.w32 : $(CFGSH_TMPL)
920 copy $(CFGSH_TMPL) config.w32
922 .\config.h : $(CFGH_TMPL) $(CORE_NOCFG_H)
924 copy $(CFGH_TMPL) config.h
926 ..\config.sh : config.w32 $(MINIPERL) config_sh.PL
927 $(MINIPERL) -I..\lib config_sh.PL --cfgsh-option-file \
928 $(mktmp $(CFG_VARS)) config.w32 > ..\config.sh
930 # this target is for when changes to the main config.sh happen
931 # edit config.{b,v,g}c and make this target once for each supported
932 # compiler (e.g. `dmake CCTYPE=BORLAND regen_config_h`)
934 perl config_sh.PL --cfgsh-option-file $(mktmp $(CFG_VARS)) \
935 $(CFGSH_TMPL) > ..\config.sh
936 -cd .. && del /f perl.exe
937 cd .. && perl configpm
940 -perl -I..\lib config_h.PL "INST_VER=$(INST_VER)"
941 rename config.h $(CFGH_TMPL)
943 $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
944 cd .. && miniperl configpm
945 if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
946 $(XCOPY) ..\*.h $(COREDIR)\*.*
947 $(XCOPY) *.h $(COREDIR)\*.*
948 $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.*
949 $(RCOPY) include $(COREDIR)\*.*
950 $(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \
951 || $(MAKE) $(MAKEMACROS) $(CONFIGPM) $(MAKEFILE)
953 $(MINIPERL) : $(MINIDIR) $(MINI_OBJ) $(CRTIPMLIBS)
954 .IF "$(CCTYPE)" == "BORLAND"
955 $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
956 @$(mktmp c0x32$(o) $(MINI_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
957 .ELIF "$(CCTYPE)" == "GCC"
958 $(LINK32) -v -mconsole -o $@ $(BLINK_FLAGS) \
959 $(mktmp $(LKPRE) $(MINI_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
961 $(LINK32) -subsystem:console -out:$@ \
962 @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(MINI_OBJ:s,\,\\))
966 if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
968 $(MINICORE_OBJ) : $(CORE_NOCFG_H)
969 $(CC) -c $(CFLAGS) -DPERL_EXTERNAL_GLOB $(OBJOUT_FLAG)$@ ..\$(*B).c
971 $(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
972 $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*B).c
974 # -DPERL_IMPLICIT_SYS needs C++ for perllib.c
975 # rules wrapped in .IFs break Win9X build (we end up with unbalanced []s unless
976 # unless the .IF is true), so instead we use a .ELSE with the default.
977 # This is the only file that depends on perlhost.h, vmem.h, and vdir.h
979 perllib$(o) : perllib.c .\perlhost.h .\vdir.h .\vmem.h
980 .IF "$(USE_IMP_SYS)$(USE_OBJECT)" == "defineundef"
981 $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
983 $(CC) -c -I. $(CFLAGS_O) $(OBJOUT_FLAG)$@ perllib.c
986 # 1. we don't want to rebuild miniperl.exe when config.h changes
987 # 2. we don't want to rebuild miniperl.exe with non-default config.h
988 $(MINI_OBJ) : $(CORE_NOCFG_H)
990 $(WIN32_OBJ) : $(CORE_H)
991 $(CORE_OBJ) : $(CORE_H)
992 $(DLL_OBJ) : $(CORE_H)
993 $(X2P_OBJ) : $(CORE_H)
995 perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl
996 $(MINIPERL) -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) \
997 $(BUILDOPT) CCTYPE=$(CCTYPE) > perldll.def
999 $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES)
1000 .IF "$(CCTYPE)" == "BORLAND"
1001 $(LINK32) -Tpd -ap $(BLINK_FLAGS) \
1002 @$(mktmp c0d32$(o) $(PERLDLL_OBJ:s,\,\\)\n \
1007 .ELIF "$(CCTYPE)" == "GCC"
1008 $(LINK32) -mdll -o $@ -Wl,--base-file,perl.base \
1009 -Wl,--image-base,0x28000000 $(BLINK_FLAGS) \
1010 $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
1011 dlltool --output-lib $(PERLIMPLIB) \
1012 --dllname $(PERLDLL:b).dll \
1014 --base-file perl.base \
1015 --output-exp perl.exp
1016 $(LINK32) -mdll -o $@ -Wl,--image-base,0x28000000 $(BLINK_FLAGS) \
1017 $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) \
1020 $(LINK32) -dll -def:perldll.def -out:$@ \
1021 @$(mktmp -base:0x28000000 $(BLINK_FLAGS) $(DELAYLOAD) $(LIBFILES) \
1022 $(PERLDLL_RES) $(PERLDLL_OBJ:s,\,\\))
1024 $(XCOPY) $(PERLIMPLIB) $(COREDIR)
1026 $(MINIMOD) : $(MINIPERL) ..\minimod.pl
1027 cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
1029 ..\x2p\a2p$(o) : ..\x2p\a2p.c
1030 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\a2p.c
1032 ..\x2p\hash$(o) : ..\x2p\hash.c
1033 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\hash.c
1035 ..\x2p\str$(o) : ..\x2p\str.c
1036 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\str.c
1038 ..\x2p\util$(o) : ..\x2p\util.c
1039 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\util.c
1041 ..\x2p\walk$(o) : ..\x2p\walk.c
1042 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\walk.c
1044 $(X2P) : $(MINIPERL) $(X2P_OBJ)
1045 $(MINIPERL) ..\x2p\find2perl.PL
1046 $(MINIPERL) ..\x2p\s2p.PL
1047 .IF "$(CCTYPE)" == "BORLAND"
1048 $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
1049 @$(mktmp c0x32$(o) $(X2P_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
1050 .ELIF "$(CCTYPE)" == "GCC"
1051 $(LINK32) -v -o $@ $(BLINK_FLAGS) \
1052 $(mktmp $(LKPRE) $(X2P_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
1054 $(LINK32) -subsystem:console -out:$@ \
1055 @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(X2P_OBJ:s,\,\\))
1058 perlmain.c : runperl.c
1059 copy runperl.c perlmain.c
1061 perlmain$(o) : perlmain.c
1062 $(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c
1064 $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES)
1065 .IF "$(CCTYPE)" == "BORLAND"
1066 $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
1067 @$(mktmp c0x32$(o) $(PERLEXE_OBJ:s,\,\\)\n \
1069 $(PERLIMPLIB) $(LIBFILES)\n)
1070 .ELIF "$(CCTYPE)" == "GCC"
1071 $(LINK32) -mconsole -o $@ -Wl,--stack,0x800000 $(BLINK_FLAGS) \
1072 $(PERLEXE_OBJ) $(PERLIMPLIB) $(LIBFILES)
1074 $(LINK32) -subsystem:console -out:$@ -stack:0x1000000 $(BLINK_FLAGS) \
1075 $(LIBFILES) $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES)
1077 copy $(PERLEXE) $(WPERLEXE)
1078 $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS
1079 copy splittree.pl ..
1080 $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
1082 $(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
1083 if not exist $(AUTODIR) mkdir $(AUTODIR)
1084 cd $(EXTDIR)\$(*B) && ..\$(MINIPERL) -I..\..\lib $(*B)_pm.PL
1085 cd $(EXTDIR)\$(*B) && ..\$(MINIPERL) -I..\..\lib XSLoader_pm.PL
1086 $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
1087 $(XCOPY) $(EXTDIR)\$(*B)\XSLoader.pm $(LIBDIR)\$(NULL)
1088 cd $(EXTDIR)\$(*B) && $(XSUBPP) dl_win32.xs > $(*B).c
1089 $(XCOPY) $(EXTDIR)\$(*B)\dlutils.c .
1091 $(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
1092 copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
1094 $(DUMPER_DLL): $(PERLEXE) $(DUMPER).xs
1095 cd $(EXTDIR)\Data\$(*B) && \
1096 ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
1097 cd $(EXTDIR)\Data\$(*B) && $(MAKE)
1099 $(DPROF_DLL): $(PERLEXE) $(DPROF).xs
1100 cd $(EXTDIR)\Devel\$(*B) && \
1101 ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
1102 cd $(EXTDIR)\Devel\$(*B) && $(MAKE)
1104 $(GLOB_DLL): $(PERLEXE) $(GLOB).xs
1105 cd $(EXTDIR)\File\$(*B) && \
1106 ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
1107 cd $(EXTDIR)\File\$(*B) && $(MAKE)
1109 $(PEEK_DLL): $(PERLEXE) $(PEEK).xs
1110 cd $(EXTDIR)\Devel\$(*B) && \
1111 ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
1112 cd $(EXTDIR)\Devel\$(*B) && $(MAKE)
1114 $(RE_DLL): $(PERLEXE) $(RE).xs
1115 cd $(EXTDIR)\$(*B) && \
1116 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1117 cd $(EXTDIR)\$(*B) && $(MAKE)
1119 $(B_DLL): $(PERLEXE) $(B).xs
1120 cd $(EXTDIR)\$(*B) && \
1121 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1122 cd $(EXTDIR)\$(*B) && $(MAKE)
1124 $(THREAD_DLL): $(PERLEXE) $(THREAD).xs
1125 cd $(EXTDIR)\$(*B) && \
1126 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1127 cd $(EXTDIR)\$(*B) && $(MAKE)
1129 $(ATTRS_DLL): $(PERLEXE) $(ATTRS).xs
1130 cd $(EXTDIR)\$(*B) && \
1131 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1132 cd $(EXTDIR)\$(*B) && $(MAKE)
1134 $(POSIX_DLL): $(PERLEXE) $(POSIX).xs
1135 cd $(EXTDIR)\$(*B) && \
1136 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1137 cd $(EXTDIR)\$(*B) && $(MAKE)
1139 $(IO_DLL): $(PERLEXE) $(IO).xs
1140 cd $(EXTDIR)\$(*B) && \
1141 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1142 cd $(EXTDIR)\$(*B) && $(MAKE)
1144 $(SDBM_FILE_DLL) : $(PERLEXE) $(SDBM_FILE).xs
1145 cd $(EXTDIR)\$(*B) && \
1146 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1147 cd $(EXTDIR)\$(*B) && $(MAKE)
1149 $(FCNTL_DLL): $(PERLEXE) $(FCNTL).xs
1150 cd $(EXTDIR)\$(*B) && \
1151 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1152 cd $(EXTDIR)\$(*B) && $(MAKE)
1154 $(OPCODE_DLL): $(PERLEXE) $(OPCODE).xs
1155 cd $(EXTDIR)\$(*B) && \
1156 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1157 cd $(EXTDIR)\$(*B) && $(MAKE)
1159 $(SOCKET_DLL): $(PERLEXE) $(SOCKET).xs
1160 cd $(EXTDIR)\$(*B) && \
1161 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1162 cd $(EXTDIR)\$(*B) && $(MAKE)
1164 $(HOSTNAME_DLL): $(PERLEXE) $(HOSTNAME).xs
1165 cd $(EXTDIR)\Sys\$(*B) && \
1166 ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
1167 cd $(EXTDIR)\Sys\$(*B) && $(MAKE)
1169 $(BYTELOADER_DLL): $(PERLEXE) $(BYTELOADER).xs
1170 cd $(EXTDIR)\$(*B) && \
1171 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1172 cd $(EXTDIR)\$(*B) && $(MAKE)
1174 $(ERRNO_PM): $(PERLEXE) $(ERRNO)_pm.PL
1175 cd $(EXTDIR)\$(*B) && \
1176 ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
1177 cd $(EXTDIR)\$(*B) && $(MAKE)
1180 $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=./html \
1181 --podpath=pod:lib:ext:utils --htmlroot="file://$(INST_HTML:s,:,|,)"\
1182 --libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse
1184 utils: $(PERLEXE) $(X2P)
1185 cd ..\utils && $(MAKE) PERL=$(MINIPERL)
1186 copy ..\README.amiga ..\pod\perlamiga.pod
1187 copy ..\README.cygwin ..\pod\perlcygwin.pod
1188 copy ..\README.dos ..\pod\perldos.pod
1189 copy ..\README.hpux ..\pod\perlhpux.pod
1190 copy ..\README.machten ..\pod\perlmachten.pod
1191 copy ..\README.os2 ..\pod\perlos2.pod
1192 copy ..\README.os2 ..\pod\perlos2.pod
1193 copy ..\vms\perlvms.pod ..\pod\perlvms.pod
1194 cd ..\pod && $(MAKE) -f ..\win32\pod.mak converters
1195 cd ..\lib && $(PERLEXE) lib_pm.PL
1196 $(PERLEXE) $(PL2BAT) $(UTILS)
1199 -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \
1200 $(PERLIMPLIB) ..\miniperl$(a) $(MINIMOD)
1202 -del /f $(EXTENSION_DLL) $(EXTENSION_PM)
1203 -del /f $(EXTENSION_C) $(DYNALOADER).c $(ERRNO).pm
1204 -del /f $(EXTDIR)\DynaLoader\dl_win32.xs
1205 -del /f $(LIBDIR)\.exists $(LIBDIR)\attrs.pm $(LIBDIR)\DynaLoader.pm
1206 -del /f $(LIBDIR)\XSLoader.pm
1207 -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
1208 -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm $(LIBDIR)\Thread.pm
1209 -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
1210 -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
1211 -del /f $(LIBDIR)\Data\Dumper.pm $(LIBDIR)\ByteLoader.pm
1212 -del /f $(LIBDIR)\Devel\Peek.pm $(LIBDIR)\Devel\DProf.pm
1213 -del /f $(LIBDIR)\File\Glob.pm
1214 -rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO
1215 -rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread
1216 -rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B
1217 -rmdir /s /q $(LIBDIR)\Data || rmdir /s $(LIBDIR)\Data
1218 -del /f $(PODDIR)\*.html
1219 -del /f $(PODDIR)\*.bat
1220 -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc \
1222 -cd ..\x2p && del /f find2perl s2p *.bat
1223 -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
1226 -cd $(EXTDIR) && del /s *$(a) *.def *.map *.pdb *.bs Makefile *$(o) \
1228 -rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR)
1229 -rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR)
1231 install : all installbare installhtml
1233 installbare : $(RIGHTMAKE) utils
1234 $(PERLEXE) ..\installperl
1235 if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\*.*
1236 $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
1237 $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.*
1240 $(RCOPY) html\*.* $(INST_HTML)\*.*
1242 inst_lib : $(CONFIGPM)
1243 copy splittree.pl ..
1244 $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
1245 $(RCOPY) ..\lib $(INST_LIB)\*.*
1247 minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) utils
1248 $(XCOPY) $(MINIPERL) ..\t\perl.exe
1249 .IF "$(CCTYPE)" == "BORLAND"
1250 $(XCOPY) $(GLOBBAT) ..\t\$(NULL)
1252 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1257 $(MINIPERL) -I..\lib test base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t
1259 test-prep : all utils
1260 $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1261 $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1262 .IF "$(CCTYPE)" == "BORLAND"
1263 $(XCOPY) $(GLOBBAT) ..\t\$(NULL)
1265 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1268 test : $(RIGHTMAKE) test-prep
1269 cd ..\t && $(PERLEXE) -I..\lib harness
1271 test-notty : test-prep
1272 set PERL_SKIP_TTY_TEST=1 && \
1273 cd ..\t && $(PERLEXE) -I.\lib harness
1275 test-wide : test-prep
1276 set HARNESS_PERL_SWITCHES=-C && \
1277 cd ..\t && $(PERLEXE) -I..\lib harness
1279 test-wide-notty : test-prep
1280 set PERL_SKIP_TTY_TEST=1 && \
1281 set HARNESS_PERL_SWITCHES=-C && \
1282 cd ..\t && $(PERLEXE) -I..\lib harness
1285 -@erase miniperlmain$(o)
1287 -@erase perlglob$(o)
1288 -@erase perlmain$(o)
1296 -rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR)
1297 -@erase $(WIN32_OBJ)
1300 -@erase ..\*$(o) ..\*$(a) ..\*.exp *$(o) *$(a) *.exp *.res
1301 -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
1302 -@erase ..\x2p\*.exe ..\x2p\*.bat