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 # (perl57.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
70 # uncomment to enable the experimental PerlIO I/O subsystem.
74 # WARNING! This option is deprecated and will eventually go away (enable
75 # USE_ITHREADS instead).
77 # uncomment to enable threads-capabilities. This is incompatible with
78 # USE_ITHREADS, and is only here for people who may have come to rely
79 # on the experimental Thread support that was in 5.005.
81 #USE_5005THREADS *= define
84 # uncomment exactly one of the following
88 # Visual C++ > 2.x and < 6.x
92 # Borland 5.02 or later
94 # mingw32+gcc-2.95.2 or better
98 # uncomment this if your Borland compiler is older than v5.4.
101 # uncomment this if you want to use Borland's VCL as your CRT
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.cpan.org/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
166 .IF "$(CCTYPE)" == "BORLAND"
167 CCHOME *= C:\borland\bcc55
168 .ELIF "$(CCTYPE)" == "GCC"
173 CCINCDIR *= $(CCHOME)\include
174 CCLIBDIR *= $(CCHOME)\lib
177 # Additional compiler flags can be specified here.
181 # This should normally be disabled. Adding -DPERL_POLLUTE enables support
182 # for old symbols by default, at the expense of extreme pollution. You most
183 # probably just want to build modules that won't compile with
184 # perl Makefile.PL POLLUTE=1
185 # instead of enabling this. Please report such modules to the respective
188 #BUILDOPT += -DPERL_POLLUTE
191 # This should normally be disabled. Enabling it will disable the File::Glob
192 # implementation of CORE::glob.
194 #BUILDOPT += -DPERL_EXTERNAL_GLOB
197 # This should normally be disabled. Enabling it causes perl to read scripts
198 # in text mode (which is the 5.005 behavior) and will break ByteLoader.
199 #BUILDOPT += -DPERL_TEXTMODE_SCRIPTS
202 # specify semicolon-separated list of extra directories that modules will
203 # look for libraries (spaces in path names need not be quoted)
208 # set this to point to cmd.exe (only needed if you use some
209 # alternate shell that doesn't grok cmd.exe style commands)
211 #SHELL *= g:\winnt\system32\cmd.exe
214 # set this to your email address (perl will guess a value from
215 # from your loginname and your hostname, which may not be right)
220 ## Build configuration ends.
223 ##################### CHANGE THESE ONLY IF YOU MUST #####################
225 .IF "$(CRYPT_SRC)$(CRYPT_LIB)" == ""
229 CRYPT_FLAG = -DHAVE_DES_FCRYPT
234 USE_5005THREADS *= undef
236 .IF "$(USE_5005THREADS)" == "define"
237 USE_ITHREADS != undef
240 .IF "$(USE_IMP_SYS)" == "define"
245 USE_ITHREADS *= undef
250 .IF "$(USE_IMP_SYS)$(USE_MULTI)$(USE_5005THREADS)" == "defineundefundef"
254 .IF "$(USE_ITHREADS)$(USE_MULTI)" == "defineundef"
256 USE_5005THREADS != undef
259 .IF "$(USE_MULTI)$(USE_5005THREADS)" != "undefundef"
260 BUILDOPT += -DPERL_IMPLICIT_CONTEXT
263 .IF "$(USE_IMP_SYS)" != "undef"
264 BUILDOPT += -DPERL_IMPLICIT_SYS
267 .IMPORT .IGNORE : PROCESSOR_ARCHITECTURE
269 PROCESSOR_ARCHITECTURE *= x86
271 .IF "$(USE_5005THREADS)" == "define"
272 ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-thread
273 .ELIF "$(USE_MULTI)" == "define"
274 ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-multi
276 .IF "$(USE_PERLIO)" == "define"
277 ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-perlio
279 ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)
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 .IF "$(CFG)" == "Debug"
297 # VC 6.0 seems capable of compiling perl correctly with optimizations
298 # enabled. Anything earlier fails tests.
303 ARCHDIR = ..\lib\$(ARCHNAME)
304 COREDIR = ..\lib\CORE
305 AUTODIR = ..\lib\auto
309 EXTUTILSDIR = $(LIBDIR)\ExtUtils
312 INST_SCRIPT = $(INST_TOP)$(INST_VER)\bin
313 INST_BIN = $(INST_SCRIPT)$(INST_ARCH)
314 INST_LIB = $(INST_TOP)$(INST_VER)\lib
315 INST_ARCHLIB = $(INST_LIB)$(INST_ARCH)
316 INST_COREDIR = $(INST_ARCHLIB)\CORE
317 INST_POD = $(INST_LIB)\pod
318 INST_HTML = $(INST_TOP)$(INST_VER)\html
321 # Programs to compile, build .lib files and link
326 .IF "$(CCTYPE)" == "BORLAND"
329 .IF "$(BCCOLD)" != "define"
341 INCLUDES = -I$(COREDIR) -I.\include -I. -I.. -I"$(CCINCDIR)"
342 #PCHFLAGS = -H -Hc -H=c:\temp\bcmoduls.pch
343 DEFINES = -DWIN32 $(CRYPT_FLAG)
344 LOCDEFS = -DPERLDLL -DPERL_CORE
349 LIBFILES = $(CRYPT_LIB) import32.lib $(LIBC)
351 .IF "$(CFG)" == "Debug"
352 OPTIMIZE = -v -D_RTLDLL -DDEBUGGING
355 OPTIMIZE = -O2 -D_RTLDLL
359 CFLAGS = -w -g0 -tWM -tWD $(INCLUDES) $(DEFINES) $(LOCDEFS) \
360 $(PCHFLAGS) $(OPTIMIZE)
361 LINK_FLAGS = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)"
365 .IF "$(BCCOLD)" != "define"
367 DEFINES += -D_MT -D__USELOCALES__ -D_WIN32_WINNT=0x0410
369 .IF "$(BCCVCL)" == "define"
370 LIBC = cp32mti.lib vcl.lib vcl50.lib vclx50.lib vcle50.lib
371 LINK_FLAGS += -L"$(CCLIBDIR)\Release"
375 .ELIF "$(CCTYPE)" == "GCC"
391 INCLUDES = -I.\include -I. -I.. -I$(COREDIR)
392 DEFINES = -DWIN32 $(CRYPT_FLAG)
393 LOCDEFS = -DPERLDLL -DPERL_CORE
400 LIBFILES = $(CRYPT_LIB) $(LIBC) \
401 -lmoldname -lkernel32 -luser32 -lgdi32 \
402 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 \
403 -loleaut32 -lnetapi32 -luuid -lwsock32 -lmpr \
404 -lwinmm -lversion -lodbc32
406 .IF "$(CFG)" == "Debug"
407 OPTIMIZE = -g -O2 -DDEBUGGING
414 CFLAGS = $(INCLUDES) $(DEFINES) $(LOCDEFS) $(OPTIMIZE)
415 LINK_FLAGS = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)"
420 # NOTE: we assume that GCC uses MSVCRT.DLL
421 BUILDOPT += -fno-strict-aliasing -DPERL_MSVCRT_READFIX
427 LIB32 = $(LINK32) -lib
434 INCLUDES = -I$(COREDIR) -I.\include -I. -I..
435 #PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX
436 DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT $(CRYPT_FLAG)
437 LOCDEFS = -DPERLDLL -DPERL_CORE
441 .IF "$(USE_PERLCRT)" != "define"
450 .IF "$(CFG)" == "Debug"
451 .IF "$(CCTYPE)" == "MSVC20"
452 OPTIMIZE = -Od -MD -Z7 -DDEBUGGING
453 LINK_DBG = -debug -pdb:none
455 # -Zi requires .pdb file(s)
456 #OPTIMIZE = -Od -MD -Zi -DDEBUGGING
458 OPTIMIZE = -O1 -MD -Z7 -DDEBUGGING
459 LINK_DBG = -debug -debugtype:both -pdb:none
462 .IF "$(CFG)" == "Optimize"
463 # -O1 yields smaller code, which turns out to be faster than -O2
464 #OPTIMIZE = -O2 -MD -DNDEBUG
465 OPTIMIZE = -O1 -MD -DNDEBUG
467 OPTIMIZE = -Od -MD -DNDEBUG
472 LIBBASEFILES = $(CRYPT_LIB) \
473 oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
474 comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
475 netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
476 version.lib odbc32.lib odbccp32.lib
478 # we add LIBC here, since we may be using PerlCRT.dll
479 LIBFILES = $(LIBBASEFILES) $(LIBC)
481 CFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) \
482 $(PCHFLAGS) $(OPTIMIZE)
483 LINK_FLAGS = -nologo -nodefaultlib $(LINK_DBG) \
484 -libpath:"$(INST_COREDIR)" \
485 -machine:$(PROCESSOR_ARCHITECTURE)
490 .IF "$(USE_PERLCRT)" != "define"
491 BUILDOPT += -DPERL_MSVCRT_READFIX
496 CFLAGS_O = $(CFLAGS) $(BUILDOPT)
498 # used to allow local linking flags that are not propogated into Config.pm,
502 BLINK_FLAGS = $(PRIV_LINK_FLAGS) $(LINK_FLAGS)
504 #################### do not edit below this line #######################
505 ############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
517 .SUFFIXES : .c .i $(o) .dll $(a) .exe .rc .res
520 $(CC) -c $(null,$(<:d) $(NULL) -I$(<:d)) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $<
523 $(CC) -c $(null,$(<:d) $(NULL) -I$(<:d)) $(CFLAGS_O) -E $< >$@
529 .IF "$(CCTYPE)" == "BORLAND"
530 $(LINK32) -Tpd -ap $(BLINK_FLAGS) c0d32$(o) $<,$@,,$(LIBFILES),$(*B).def
531 $(IMPLIB) $(*B).lib $@
532 .ELIF "$(CCTYPE)" == "GCC"
533 $(LINK32) -o $@ $(BLINK_FLAGS) $< $(LIBFILES)
534 $(IMPLIB) --input-def $(*B).def --output-lib $(*B).a $@
536 $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
537 -out:$@ $(BLINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
545 MINIPERL = ..\miniperl.exe
547 PERLEXE = ..\perl.exe
548 WPERLEXE = ..\wperl.exe
549 GLOBEXE = ..\perlglob.exe
550 CONFIGPM = ..\lib\Config.pm
551 MINIMOD = ..\lib\ExtUtils\Miniperl.pm
554 # Nominate a target which causes extensions to be re-built
555 # This used to be $(PERLEXE), but at worst it is the .dll that they depend
556 # on and really only the interface - i.e. the .def file used to export symbols
558 PERLDEP = perldll.def
561 PL2BAT = bin\pl2bat.pl
562 GLOBBAT = bin\perlglob.bat
586 ..\lib\ExtUtils\xsubpp \
593 .IF "$(CCTYPE)" == "BORLAND"
595 CFGSH_TMPL = config.bc
596 CFGH_TMPL = config_H.bc
598 .ELIF "$(CCTYPE)" == "GCC"
600 CFGSH_TMPL = config.gc
601 CFGH_TMPL = config_H.gc
602 PERLIMPLIB = ..\libperl57$(a)
606 CFGSH_TMPL = config.vc
607 CFGH_TMPL = config_H.vc
611 # makedef.pl must be updated if this changes, and this should normally
612 # only change when there is an incompatible revision of the public API.
613 # XXX so why did we change it from perl56 to perl57?
614 PERLIMPLIB *= ..\perl57$(a)
615 PERLDLL = ..\perl57.dll
617 XCOPY = xcopy /f /r /i /d
618 RCOPY = xcopy /f /r /i /e /d
622 # filenames given to xsubpp must have forward slashes (since it puts
623 # full pathnames in #line strings)
624 XSUBPP = ..\$(MINIPERL) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp \
661 EXTRACORE_SRC += perllib.c
663 .IF "$(PERL_MALLOC)" == "define"
664 EXTRACORE_SRC += ..\malloc.c
667 EXTRACORE_SRC += ..\perlio.c
674 .IF "$(USE_PERLIO)" == "define"
675 WIN32_SRC += .\win32io.c
678 .IF "$(CRYPT_SRC)" != ""
679 WIN32_SRC += .\$(CRYPT_SRC)
682 DLL_SRC = $(DYNALOADER).c
728 .\include\sys\socket.h \
731 CORE_H = $(CORE_NOCFG_H) .\config.h
733 MICROCORE_OBJ = $(MICROCORE_SRC:db:+$(o))
734 CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:db:+$(o))
735 WIN32_OBJ = $(WIN32_SRC:db:+$(o))
736 MINICORE_OBJ = $(MINIDIR)\{$(MICROCORE_OBJ:f) miniperlmain$(o) perlio$(o)}
737 MINIWIN32_OBJ = $(MINIDIR)\{$(WIN32_OBJ:f)}
738 MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
739 DLL_OBJ = $(DLL_SRC:db:+$(o))
740 X2P_OBJ = $(X2P_SRC:db:+$(o))
742 PERLDLL_OBJ = $(CORE_OBJ)
743 PERLEXE_OBJ = perlmain$(o)
745 PERLDLL_OBJ += $(WIN32_OBJ) $(DLL_OBJ)
747 .IF "$(USE_SETARGV)" != ""
748 SETARGV_OBJ = setargv$(o)
751 DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
752 Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob \
753 Sys/Hostname Storable Filter/Util/Call Encode \
754 Digest/MD5 PerlIO/Scalar MIME/Base64 Time/HiRes \
756 STATIC_EXT = DynaLoader
759 DYNALOADER = $(EXTDIR)\DynaLoader\DynaLoader
761 POD2HTML = $(PODDIR)\pod2html
762 POD2MAN = $(PODDIR)\pod2man
763 POD2LATEX = $(PODDIR)\pod2latex
764 POD2TEXT = $(PODDIR)\pod2text
766 # vars must be separated by "\t+~\t+", since we're using the tempfile
767 # version of config_sh.pl (we were overflowing someone's buffer by
768 # trying to fit them all on the command line)
771 INST_DRV=$(INST_DRV) ~ \
772 INST_TOP=$(INST_TOP:s/\/\\/) ~ \
773 INST_VER=$(INST_VER:s/\/\\/) ~ \
774 INST_ARCH=$(INST_ARCH) ~ \
775 archname=$(ARCHNAME) ~ \
778 ccflags=$(OPTIMIZE) $(DEFINES) $(BUILDOPT) ~ \
779 cf_email=$(EMAIL) ~ \
780 d_crypt=$(D_CRYPT) ~ \
781 d_mymalloc=$(PERL_MALLOC) ~ \
782 libs=$(LIBFILES:f) ~ \
783 incpath=$(CCINCDIR:s/\/\\/) ~ \
784 libperl=$(PERLIMPLIB:f) ~ \
785 libpth=$(CCLIBDIR:s/\/\\/);$(EXTRALIBDIRS:s/\/\\/) ~ \
788 _o=$(o) obj_ext=$(o) ~ \
789 _a=$(a) lib_ext=$(a) ~ \
790 static_ext=$(STATIC_EXT) ~ \
791 use5005threads=$(USE_5005THREADS) ~ \
792 useithreads=$(USE_ITHREADS) ~ \
793 usethreads=$(USE_5005THREADS) ~ \
794 usemultiplicity=$(USE_MULTI) ~ \
795 useperlio=$(USE_PERLIO) ~ \
796 LINK_FLAGS=$(LINK_FLAGS:s/\/\\/) ~ \
800 # set up targets varying between Win95 and WinNT builds
803 .IF "$(IS_WIN95)" == "define"
805 RIGHTMAKE = __switch_makefiles
816 all : .\config.h $(GLOBEXE) $(MINIPERL) $(MK2) \
817 $(RIGHTMAKE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) \
820 $(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
822 #----------------------------------------------------------------
824 #-------------------- BEGIN Win95 SPECIFIC ----------------------
826 # this target is a jump-off point for Win95
827 # 1. it switches to the Win95-specific makefile if it exists
828 # (__do_switch_makefiles)
829 # 2. it prints a message when the Win95-specific one finishes (__done)
830 # 3. it then kills this makefile by trying to make __no_such_target
832 __switch_makefiles: __do_switch_makefiles __done __no_such_target
834 __do_switch_makefiles:
835 .IF "$(NOTFIRST)" != "true"
836 if exist $(MK2) $(MAKE:s/-S//) -f $(MK2) $(MAKETARGETS) NOTFIRST=true
841 .IF "$(NOTFIRST)" != "true"
843 @echo Build process complete. Ignore any errors after this message.
844 @echo Run "dmake test" to test and "dmake install" to install
847 # dummy targets for Win95-specific makefile
857 # This target is used to generate the new makefile (.\makefile.95) for Win95
859 .\makefile.95: .\makefile.mk
860 $(MINIPERL) genmk95.pl makefile.mk $(MK2)
862 #--------------------- END Win95 SPECIFIC ---------------------
864 # a blank target for when builds don't need to do certain things
865 # this target added for Win95 port but used to keep the WinNT port able to
870 $(GLOBEXE) : perlglob$(o)
871 .IF "$(CCTYPE)" == "BORLAND"
872 $(CC) -c -w -v -tWM -I"$(CCINCDIR)" perlglob.c
873 $(LINK32) -Tpe -ap $(BLINK_FLAGS) c0x32$(o) perlglob$(o) \
874 "$(CCLIBDIR)\32BIT\wildargs$(o)",$@,,import32.lib cw32mt.lib,
875 .ELIF "$(CCTYPE)" == "GCC"
876 $(LINK32) $(BLINK_FLAGS) -mconsole -o $@ perlglob$(o) $(LIBFILES)
878 $(LINK32) $(BLINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
879 perlglob$(o) setargv$(o)
882 perlglob$(o) : perlglob.c
884 config.w32 : $(CFGSH_TMPL)
885 copy $(CFGSH_TMPL) config.w32
887 .\config.h : $(CFGH_TMPL) $(CORE_NOCFG_H)
889 copy $(CFGH_TMPL) config.h
891 ..\config.sh : config.w32 $(MINIPERL) config_sh.PL FindExt.pm
892 $(MINIPERL) -I..\lib config_sh.PL --cfgsh-option-file \
893 $(mktmp $(CFG_VARS)) config.w32 > ..\config.sh
895 # this target is for when changes to the main config.sh happen
896 # edit config.{b,v,g}c and make this target once for each supported
897 # compiler (e.g. `dmake CCTYPE=BORLAND regen_config_h`)
899 perl config_sh.PL --cfgsh-option-file $(mktmp $(CFG_VARS)) \
900 $(CFGSH_TMPL) > ..\config.sh
901 -cd .. && del /f perl.exe
902 -cd .. && del /f perl*.dll
903 cd .. && perl configpm
906 -perl config_h.PL "INST_VER=$(INST_VER)"
907 rename config.h $(CFGH_TMPL)
909 $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
910 cd .. && miniperl configpm
911 if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
912 $(XCOPY) ..\*.h $(COREDIR)\*.*
913 $(XCOPY) *.h $(COREDIR)\*.*
914 $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.*
915 $(RCOPY) include $(COREDIR)\*.*
916 $(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \
917 || $(MAKE) $(MAKEMACROS) $(CONFIGPM) $(MAKEFILE)
919 $(MINIPERL) : $(MINIDIR) $(MINI_OBJ) $(CRTIPMLIBS)
920 .IF "$(CCTYPE)" == "BORLAND"
921 $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
922 @$(mktmp c0x32$(o) $(MINI_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
923 .ELIF "$(CCTYPE)" == "GCC"
924 $(LINK32) -v -mconsole -o $@ $(BLINK_FLAGS) \
925 $(mktmp $(LKPRE) $(MINI_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
927 $(LINK32) -subsystem:console -out:$@ \
928 @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(MINI_OBJ:s,\,\\))
932 if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
934 $(MINICORE_OBJ) : $(CORE_NOCFG_H)
935 $(CC) -c $(CFLAGS) -DPERL_EXTERNAL_GLOB $(OBJOUT_FLAG)$@ ..\$(*B).c
937 $(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
938 $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*B).c
940 # -DPERL_IMPLICIT_SYS needs C++ for perllib.c
941 # rules wrapped in .IFs break Win9X build (we end up with unbalanced []s unless
942 # unless the .IF is true), so instead we use a .ELSE with the default.
943 # This is the only file that depends on perlhost.h, vmem.h, and vdir.h
945 perllib$(o) : perllib.c .\perlhost.h .\vdir.h .\vmem.h
946 .IF "$(USE_IMP_SYS)" == "define"
947 $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
949 $(CC) -c -I. $(CFLAGS_O) $(OBJOUT_FLAG)$@ perllib.c
952 # 1. we don't want to rebuild miniperl.exe when config.h changes
953 # 2. we don't want to rebuild miniperl.exe with non-default config.h
954 $(MINI_OBJ) : $(CORE_NOCFG_H)
956 $(WIN32_OBJ) : $(CORE_H)
957 $(CORE_OBJ) : $(CORE_H)
958 $(DLL_OBJ) : $(CORE_H)
959 $(X2P_OBJ) : $(CORE_H)
961 perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl
962 $(MINIPERL) -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) \
963 $(BUILDOPT) CCTYPE=$(CCTYPE) > perldll.def
965 $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES)
966 .IF "$(CCTYPE)" == "BORLAND"
967 $(LINK32) -Tpd -ap $(BLINK_FLAGS) \
968 @$(mktmp c0d32$(o) $(PERLDLL_OBJ:s,\,\\)\n \
973 .ELIF "$(CCTYPE)" == "GCC"
974 $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(BLINK_FLAGS) \
975 $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
976 dlltool --output-lib $(PERLIMPLIB) \
977 --dllname $(PERLDLL:b).dll \
979 --base-file perl.base \
980 --output-exp perl.exp
981 $(LINK32) -mdll -o $@ $(BLINK_FLAGS) \
982 $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) \
985 $(LINK32) -dll -def:perldll.def -out:$@ \
986 @$(mktmp -base:0x28000000 $(BLINK_FLAGS) $(DELAYLOAD) $(LIBFILES) \
987 $(PERLDLL_RES) $(PERLDLL_OBJ:s,\,\\))
989 $(XCOPY) $(PERLIMPLIB) $(COREDIR)
991 $(MINIMOD) : $(MINIPERL) ..\minimod.pl
992 cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
994 ..\x2p\a2p$(o) : ..\x2p\a2p.c
995 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\a2p.c
997 ..\x2p\hash$(o) : ..\x2p\hash.c
998 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\hash.c
1000 ..\x2p\str$(o) : ..\x2p\str.c
1001 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\str.c
1003 ..\x2p\util$(o) : ..\x2p\util.c
1004 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\util.c
1006 ..\x2p\walk$(o) : ..\x2p\walk.c
1007 $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\walk.c
1009 $(X2P) : $(MINIPERL) $(X2P_OBJ)
1010 $(MINIPERL) ..\x2p\find2perl.PL
1011 $(MINIPERL) ..\x2p\s2p.PL
1012 .IF "$(CCTYPE)" == "BORLAND"
1013 $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
1014 @$(mktmp c0x32$(o) $(X2P_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
1015 .ELIF "$(CCTYPE)" == "GCC"
1016 $(LINK32) -v -o $@ $(BLINK_FLAGS) \
1017 $(mktmp $(LKPRE) $(X2P_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
1019 $(LINK32) -subsystem:console -out:$@ \
1020 @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(X2P_OBJ:s,\,\\))
1023 perlmain.c : runperl.c
1024 copy runperl.c perlmain.c
1026 perlmain$(o) : perlmain.c
1027 $(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c
1029 $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES)
1030 .IF "$(CCTYPE)" == "BORLAND"
1031 $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
1032 @$(mktmp c0x32$(o) $(PERLEXE_OBJ:s,\,\\)\n \
1034 $(PERLIMPLIB) $(LIBFILES)\n)
1035 .ELIF "$(CCTYPE)" == "GCC"
1036 $(LINK32) -mconsole -o $@ $(BLINK_FLAGS) \
1037 $(PERLEXE_OBJ) $(PERLIMPLIB) $(LIBFILES)
1039 $(LINK32) -subsystem:console -out:$@ -stack:0x1000000 $(BLINK_FLAGS) \
1040 $(LIBFILES) $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES)
1042 copy $(PERLEXE) $(WPERLEXE)
1043 $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS
1044 copy splittree.pl ..
1045 $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
1047 $(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
1048 if not exist $(AUTODIR) mkdir $(AUTODIR)
1049 cd $(EXTDIR)\$(*B) && ..\$(MINIPERL) -I..\..\lib $(*B)_pm.PL
1050 cd $(EXTDIR)\$(*B) && ..\$(MINIPERL) -I..\..\lib XSLoader_pm.PL
1051 $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
1052 $(XCOPY) $(EXTDIR)\$(*B)\XSLoader.pm $(LIBDIR)\$(NULL)
1053 cd $(EXTDIR)\$(*B) && $(XSUBPP) dl_win32.xs > $(*B).c
1054 $(XCOPY) $(EXTDIR)\$(*B)\dlutils.c .
1056 $(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
1057 copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
1059 #----------------------------------------------------------------------------------
1060 Extensions : buildext.pl $(PERLDEP) $(CONFIGPM)
1061 $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR)
1064 -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) clean
1066 #----------------------------------------------------------------------------------
1070 $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=./html \
1071 --podpath=pod:lib:ext:utils --htmlroot="file://$(INST_HTML:s,:,|,)"\
1072 --libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse
1074 utils: $(PERLEXE) $(X2P)
1075 cd ..\utils && $(MAKE) PERL=$(MINIPERL)
1076 copy ..\README.aix ..\pod\perlaix.pod
1077 copy ..\README.amiga ..\pod\perlamiga.pod
1078 copy ..\README.apollo ..\pod\perlapollo.pod
1079 copy ..\README.beos ..\pod\perlbeos.pod
1080 copy ..\README.bs2000 ..\pod\perlbs2000.pod
1081 copy ..\README.ce ..\pod\perlce.pod
1082 copy ..\README.cygwin ..\pod\perlcygwin.pod
1083 copy ..\README.dgux ..\pod\perldgux.pod
1084 copy ..\README.dos ..\pod\perldos.pod
1085 copy ..\README.epoc ..\pod\perlepoc.pod
1086 copy ..\README.hpux ..\pod\perlhpux.pod
1087 copy ..\README.hurd ..\pod\perlhurd.pod
1088 copy ..\README.machten ..\pod\perlmachten.pod
1089 copy ..\README.macos ..\pod\perlmacos.pod
1090 copy ..\README.mint ..\pod\perlmint.pod
1091 copy ..\README.mpeix ..\pod\perlmpeix.pod
1092 copy ..\README.netware ..\pod\perlnetware.pod
1093 copy ..\README.os2 ..\pod\perlos2.pod
1094 copy ..\README.os390 ..\pod\perlos390.pod
1095 copy ..\README.plan9 ..\pod\perlplan9.pod
1096 copy ..\README.qnx ..\pod\perlqnx.pod
1097 copy ..\README.solaris ..\pod\perlsolaris.pod
1098 copy ..\README.tru64 ..\pod\perltru64.pod
1099 copy ..\README.uts ..\pod\perluts.pod
1100 copy ..\README.vmesa ..\pod\perlvmesa.pod
1101 copy ..\vms\perlvms.pod ..\pod\perlvms.pod
1102 copy ..\README.vos ..\pod\perlvos.pod
1103 copy ..\README.win32 ..\pod\perlwin32.pod
1104 cd ..\pod && $(MAKE) -f ..\win32\pod.mak converters
1105 cd ..\lib && $(PERLEXE) lib_pm.PL
1106 $(PERLEXE) $(PL2BAT) $(UTILS)
1109 -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \
1110 $(PERLIMPLIB) ..\miniperl$(a) $(MINIMOD)
1112 -del /f $(EXTDIR)\DynaLoader\dl_win32.xs
1113 -del /f $(LIBDIR)\.exists $(LIBDIR)\attrs.pm $(LIBDIR)\DynaLoader.pm
1114 -del /f $(LIBDIR)\XSLoader.pm
1115 -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
1116 -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm
1117 -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
1118 -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
1119 -del /f $(LIBDIR)\Data\Dumper.pm $(LIBDIR)\ByteLoader.pm
1120 -del /f $(LIBDIR)\PerlIO\Scalar.pm
1121 -del /f $(LIBDIR)\Devel\Peek.pm $(LIBDIR)\Devel\DProf.pm
1122 -del /f $(LIBDIR)\File\Glob.pm
1123 -del /f $(LIBDIR)\Storable.pm
1124 -del /f $(LIBDIR)\Filter\Util\Call.pm
1125 -del /f $(LIBDIR)\Digest\MD5.pm
1126 -del /f $(LIBDIR)\MIME\Base64.pm
1127 -del /f $(LIBDIR)\MIME\QuotedPrint.pm
1128 -del /f $(LIBDIR)\Time\HiRes.pm
1129 -del /f $(LIBDIR)\List\Util.pm
1130 -del /f $(LIBDIR)\Scalar\Util.pm
1131 -del /f $(LIBDIR)\Unicode\Normalize.pm
1132 -if exist $(LIBDIR)\IO rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO
1133 -if exist $(LIBDIR)\Thread rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread
1134 -if exist $(LIBDIR)\B rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B
1135 -if exist $(LIBDIR)\Data rmdir /s /q $(LIBDIR)\Data || rmdir /s $(LIBDIR)\Data
1136 -if exist $(LIBDIR)\Filter\Util\Call rmdir /s /q $(LIBDIR)\Filter\Util\Call || rmdir /s $(LIBDIR)\Filter
1137 -if exist $(LIBDIR)\Filter\Util rmdir /s /q $(LIBDIR)\Filter\Util || rmdir /s $(LIBDIR)\Filter
1138 -if exist $(LIBDIR)\Digest rmdir /s /q $(LIBDIR)\Digest || rmdir /s $(LIBDIR)\Digest
1139 -if exist $(LIBDIR)\MIME rmdir /s /q $(LIBDIR)\MIME || rmdir /s $(LIBDIR)\MIME
1140 -if exist $(LIBDIR)\List rmdir /s /q $(LIBDIR)\List || rmdir /s $(LIBDIR)\List
1141 -if exist $(LIBDIR)\Scalar rmdir /s /q $(LIBDIR)\Scalar || rmdir /s $(LIBDIR)\Scalar
1142 -cd $(PODDIR) && del /f *.html *.bat checkpods \
1143 perlaix.pod perlamiga.pod perlapollo.pod \
1144 perlbeos.pod perlbs2000.pod perlce.pod perlcygwin.pod perldgux.pod \
1145 perldos.pod perlepoc.pod perlhpux.pod perlhurd.pod \
1146 perlmachten.pod perlmint.pod \
1147 perlmacos.pod perlmpeix.pod perlnetware.pod \
1148 perlos2.pod perlos390.pod \
1149 perlplan9.pod perlqnx.pod \
1150 perlsolaris.pod perltru64.pod perluts.pod \
1151 perlvmesa.pod perlvms.pod perlvos.pod \
1152 perlwin32.pod pod2html pod2latex pod2man pod2text pod2usage \
1153 podchecker podselect
1154 -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc \
1155 perlivp dprofpp *.bat
1156 -cd ..\x2p && del /f find2perl s2p *.bat
1157 -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
1160 -cd $(EXTDIR) && del /s *$(a) *.def *.map *.pdb *.bs Makefile *$(o) \
1162 -if exist $(AUTODIR) rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR)
1163 -if exist $(COREDIR) rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR)
1165 install : all installbare installhtml
1167 installbare : $(RIGHTMAKE) utils
1168 $(PERLEXE) ..\installperl
1169 if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\*.*
1170 $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
1171 $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.*
1174 $(RCOPY) html\*.* $(INST_HTML)\*.*
1176 inst_lib : $(CONFIGPM)
1177 copy splittree.pl ..
1178 $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
1179 $(RCOPY) ..\lib $(INST_LIB)\*.*
1181 minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) utils
1182 $(XCOPY) $(MINIPERL) ..\t\perl.exe
1183 .IF "$(CCTYPE)" == "BORLAND"
1184 $(XCOPY) $(GLOBBAT) ..\t\$(NULL)
1186 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1191 $(MINIPERL) -I..\lib test base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t
1193 test-prep : all utils
1194 $(XCOPY) $(PERLEXE) ..\t\$(NULL)
1195 $(XCOPY) $(PERLDLL) ..\t\$(NULL)
1196 .IF "$(CCTYPE)" == "BORLAND"
1197 $(XCOPY) $(GLOBBAT) ..\t\$(NULL)
1199 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
1202 test : $(RIGHTMAKE) test-prep
1203 cd ..\t && $(PERLEXE) -I..\lib harness
1205 test-notty : test-prep
1206 set PERL_SKIP_TTY_TEST=1 && \
1207 cd ..\t && $(PERLEXE) -I.\lib harness
1209 test-wide : test-prep
1210 set HARNESS_PERL_SWITCHES=-C && \
1211 cd ..\t && $(PERLEXE) -I..\lib harness
1213 test-wide-notty : test-prep
1214 set PERL_SKIP_TTY_TEST=1 && \
1215 set HARNESS_PERL_SWITCHES=-C && \
1216 cd ..\t && $(PERLEXE) -I..\lib harness
1218 clean : Extensions_clean
1219 -@erase miniperlmain$(o)
1221 -@erase perlglob$(o)
1222 -@erase perlmain$(o)
1230 -if exist $(MINIDIR) rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR)
1231 -@erase $(WIN32_OBJ)
1234 -@erase ..\*$(o) ..\*$(a) ..\*.exp *$(o) *$(a) *.exp *.res
1235 -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
1236 -@erase ..\x2p\*.exe ..\x2p\*.bat
1240 # Handy way to run perlbug -ok without having to install and run the
1241 # installed perlbug. We don't re-run the tests here - we trust the user.
1242 # Please *don't* use this unless all tests pass.
1243 # If you want to report test failures, use "dmake nok" instead.
1245 $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)"
1248 $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)" -F perl.ok
1251 $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)"
1254 $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)" -F perl.nok