#
# Makefile to build perl on Windows NT using Microsoft NMAKE.
+# Supported compilers:
+# Visual C++ 5.x (possibly other versions)
#
# This is set up to build a perl.exe that runs off a shared library
-# (perl56.dll). Also makes individual DLLs for the XS extensions.
+# (perl57.dll). Also makes individual DLLs for the XS extensions.
#
##
# versioned installation can be obtained by setting INST_TOP above to a
# path that includes an arbitrary version string.
#
-INST_VER = \5.6.0
+#INST_VER = \5.7.0
#
# Comment this out if you DON'T want your perl installation to have
# the same location. Commenting it out gives you a simpler
# installation that is easier to understand for beginners.
#
-INST_ARCH = \$(ARCHNAME)
+#INST_ARCH = \$(ARCHNAME)
#
# uncomment to enable multiple interpreters. This is need for fork()
# emulation.
#
-#USE_MULTI = define
+USE_MULTI = define
#
# Beginnings of interpreter cloning/threads; still very incomplete.
# This should be enabled to get the fork() emulation. This needs
# USE_MULTI as well.
#
-#USE_ITHREADS = define
+USE_ITHREADS = define
#
# uncomment to enable the implicit "host" layer for all system calls
# made by perl. This needs USE_MULTI above. This is also needed to
# get fork().
#
-#USE_IMP_SYS = define
+USE_IMP_SYS = define
+
+#
+# uncomment to enable the experimental PerlIO I/O subsystem.
+USE_PERLIO = define
#
# WARNING! This option is deprecated and will eventually go away (enable
# USE_ITHREADS, and is only here for people who may have come to rely
# on the experimental Thread support that was in 5.005.
#
-#USE_5005THREADS= define
+#USE_5005THREADS = define
#
# WARNING! This option is deprecated and will eventually go away (enable
USE_IMP_SYS = undef
!ENDIF
+!IF "$(USE_PERLIO)" == ""
+USE_PERLIO = undef
+!ENDIF
+
!IF "$(USE_PERLCRT)" == ""
USE_PERLCRT = undef
!ENDIF
!IF "$(USE_MULTI)" == "define"
ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-multi
!ELSE
+!IF "$(USE_PERLIO)" == "define"
+ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-perlio
+!ELSE
ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)
!ENDIF
!ENDIF
!ENDIF
+!ENDIF
+
+!IF "$(USE_PERLIO)" == "define"
+BUILDOPT = $(BUILDOPT) -DUSE_PERLIO
+!ENDIF
!IF "$(USE_ITHREADS)" == "define"
ARCHNAME = $(ARCHNAME)-thread
# VC 6.0 can load the socket dll on demand. Makes the test suite
# run in about 10% less time.
-DELAYLOAD = -DELAYLOAD:wsock32.dll -DELAYLOAD:shell32.dll delayimp.lib
-
-# VC 6.0 seems capable of compiling perl correctly with optimizations
-# enabled. Anything earlier fails tests.
-!IF "$(CFG)" == ""
-CFG = Optimize
-!ENDIF
+DELAYLOAD = -DELAYLOAD:wsock32.dll -DELAYLOAD:shell32.dll delayimp.lib
!ENDIF
ARCHDIR = ..\lib\$(ARCHNAME)
INST_ARCHLIB = $(INST_LIB)$(INST_ARCH)
INST_COREDIR = $(INST_ARCHLIB)\CORE
INST_POD = $(INST_LIB)\pod
-INST_HTML = $(INST_POD)\html
+INST_HTML = $(INST_TOP)$(INST_VER)\html
#
# Programs to compile, build .lib files and link
#
INCLUDES = -I$(COREDIR) -I.\include -I. -I..
-#PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX
+#PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX
DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT $(CRYPT_FLAG)
LOCDEFS = -DPERLDLL -DPERL_CORE
SUBSYS = console
! ENDIF
LINK_DBG = -debug -pdb:none
!ELSE
-! IF "$(CFG)" == "Optimize"
# -O1 yields smaller code, which turns out to be faster than -O2
#OPTIMIZE = -O2 -MD -DNDEBUG
OPTIMIZE = -O1 -MD -DNDEBUG
-! ELSE
-OPTIMIZE = -Od -MD -DNDEBUG
-! ENDIF
LINK_DBG = -release
!ENDIF
#
# Rules
-#
+#
.SUFFIXES : .c $(o) .dll .lib .exe .rc .res
$(o).dll:
$(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
- -out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
+ -out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
.rc.res:
$(RSC) -i.. $<
#
# various targets
-PERLIMPLIB = ..\perl56.lib
-PERLDLL = ..\perl56.dll
+
+# makedef.pl must be updated if this changes, and this should normally
+# only change when there is an incompatible revision of the public API.
+# XXX so why did we change it from perl56 to perl57?
+PERLIMPLIB = ..\perl57.lib
+PERLDLL = ..\perl57.dll
MINIPERL = ..\miniperl.exe
MINIDIR = .\mini
NOOP = @echo
NULL =
+DEL = bin\mdelete.bat
+
#
# filenames given to xsubpp must have forward slashes (since it puts
# full pathnames in #line strings)
WIN32_SRC = \
.\win32.c \
.\win32sck.c \
- .\win32thread.c
+ .\win32thread.c
!IF "$(CRYPT_SRC)" != ""
WIN32_SRC = $(WIN32_SRC) .\$(CRYPT_SRC)
DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob \
- Sys/Hostname Storable
+ Sys/Hostname Storable Filter/Util/Call Encode
STATIC_EXT = DynaLoader
NONXS_EXT = Errno
GLOB = $(EXTDIR)\File\Glob\Glob
HOSTNAME = $(EXTDIR)\Sys\Hostname\Hostname
STORABLE = $(EXTDIR)\Storable\Storable
+FILTER = $(EXTDIR)\Filter\Util\Call\Call
+ENCODE = $(EXTDIR)\Encode\Encode
SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll
FCNTL_DLL = $(AUTODIR)\Fcntl\Fcntl.dll
GLOB_DLL = $(AUTODIR)\File\Glob\Glob.dll
HOSTNAME_DLL = $(AUTODIR)\Sys\Hostname\Hostname.dll
STORABLE_DLL = $(AUTODIR)\Storable\Storable.dll
+FILTER_DLL = $(AUTODIR)\Filter\Util\Call\Call.dll
+ENCODE_DLL = $(AUTODIR)\Encode\Encode.dll
ERRNO_PM = $(LIBDIR)\Errno.pm
$(DPROF).c \
$(GLOB).c \
$(HOSTNAME).c \
- $(STORABLE).c
+ $(STORABLE).c \
+ $(FILTER).c \
+ $(ENCODE).c
EXTENSION_DLL = \
$(SOCKET_DLL) \
$(DPROF_DLL) \
$(GLOB_DLL) \
$(HOSTNAME_DLL) \
- $(STORABLE_DLL)
+ $(STORABLE_DLL) \
+ $(FILTER_DLL) \
+ $(ENCODE_DLL)
EXTENSION_PM = \
$(ERRNO_PM)
"INST_ARCH=$(INST_ARCH)" \
"archname=$(ARCHNAME)" \
"cc=$(CC)" \
- "ccflags=$(OPTIMIZE:"=\") $(DEFINES) $(BUILDOPT)" \
- "cf_email=$(EMAIL)" \
+ "ld=$(LINK32)" \
+ "ccflags=-nologo -Gf -W3 $(OPTIMIZE:"=\") $(DEFINES) $(BUILDOPT)" \
+ "cf_email=$(EMAIL)" \
"d_crypt=$(D_CRYPT)" \
"d_mymalloc=$(PERL_MALLOC)" \
"libs=$(LIBFILES)" \
"useithreads=$(USE_ITHREADS)" \
"usethreads=$(USE_5005THREADS)" \
"usemultiplicity=$(USE_MULTI)" \
+ "useperlio=$(USE_PERLIO)" \
"LINK_FLAGS=$(LINK_FLAGS:"=\")" \
"optimize=$(OPTIMIZE:"=\")"
$(GLOBEXE) : perlglob$(o)
$(LINK32) $(LINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
- perlglob$(o) setargv$(o)
+ perlglob$(o) setargv$(o)
perlglob$(o) : perlglob.c
# this target is for when changes to the main config.sh happen
# edit config.{b,v,g}c and make this target once for each supported
-# compiler (e.g. `dmake CCTYPE=BORLAND regen_config_h`)
+# compiler (e.g. `nmake CCTYPE=BORLAND regen_config_h`)
regen_config_h:
perl config_sh.PL $(CFG_VARS) $(CFGSH_TMPL) > ..\config.sh
cd ..
rename config.h $(CFGH_TMPL)
$(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
- cd .. && miniperl configpm
+ cd ..
+ miniperl configpm
+ cd win32
if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
$(XCOPY) ..\*.h $(COREDIR)\*.*
$(XCOPY) *.h $(COREDIR)\*.*
$(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.*
$(RCOPY) include $(COREDIR)\*.*
- $(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \
- || $(MAKE) /$(MAKEFLAGS) $(CONFIGPM)
+ -$(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)"
+ if errorlevel 1 $(MAKE) /$(MAKEFLAGS) $(CONFIGPM)
$(MINIPERL) : $(MINIDIR) $(MINI_OBJ)
$(LINK32) -subsystem:console -out:$@ @<<
$(XCOPY) $(PERLIMPLIB) $(COREDIR)
$(MINIMOD) : $(MINIPERL) ..\minimod.pl
- cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
+ cd ..
+ miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
+ cd win32
..\x2p\a2p$(o) : ..\x2p\a2p.c
$(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\a2p.c
$(LINK_FLAGS) $(LIBFILES) $(X2P_OBJ)
<<
-perlmain.c : runperl.c
+perlmain.c : runperl.c
copy runperl.c perlmain.c
perlmain$(o) : perlmain.c
$(LIBFILES) $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES)
copy $(PERLEXE) $(WPERLEXE)
$(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS
- copy splittree.pl ..
+ copy splittree.pl ..
$(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
$(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
$(MAKE)
cd ..\..\win32
+$(ENCODE_DLL): $(PERLEXE) $(ENCODE).xs
+ cd $(EXTDIR)\$(*B)
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\win32
+
$(STORABLE_DLL): $(PERLEXE) $(STORABLE).xs
cd $(EXTDIR)\$(*B)
..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
$(MAKE)
cd ..\..\win32
+$(FILTER_DLL): $(PERLEXE) $(FILTER).xs
+ cd $(EXTDIR)\Filter\Util\Call
+ ..\..\..\..\miniperl -I..\..\..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\..\..\win32
+
+$(ENCODE_DLL): $(PERLEXE) $(ENCODE).xs
+ cd $(EXTDIR)\$(*B)
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\win32
+
$(ERRNO_PM): $(PERLEXE) $(ERRNO)_pm.PL
cd $(EXTDIR)\$(*B)
..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
cd ..\utils
$(MAKE) PERL=$(MINIPERL)
cd ..\pod
+ copy ..\README.aix .\perlaix.pod
copy ..\README.amiga .\perlamiga.pod
copy ..\README.cygwin .\perlcygwin.pod
copy ..\README.dos .\perldos.pod
+ copy ..\README.epoc .\perlepoc.pod
copy ..\README.hpux .\perlhpux.pod
copy ..\README.machten .\perlmachten.pod
copy ..\README.os2 .\perlos2.pod
+ copy ..\README.os390 .\perlos390.pod
+ copy ..\README.vmesa .\perlvmesa.pod
+ copy ..\README.bs2000 .\perlbs2000.pod
+ copy ..\README.solaris .\perlsolaris.pod
copy ..\vms\perlvms.pod .\perlvms.pod
+ copy ..\README.vos .\perlvos.pod
copy ..\README.win32 .\perlwin32.pod
$(MAKE) -f ..\win32\pod.mak converters
cd ..\lib
-del /f $(LIBDIR)\Devel\Peek.pm $(LIBDIR)\Devel\DProf.pm
-del /f $(LIBDIR)\File\Glob.pm
-del /f $(LIBDIR)\Storable.pm
- -if exist $(LIBDIR)\IO rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO
- -if exist $(LIBDIR)\Thread rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread
- -if exist $(LIBDIR)\B rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B
- -if exist $(LIBDIR)\Data rmdir /s /q $(LIBDIR)\Data || rmdir /s $(LIBDIR)\Data
+ -del /f $(LIBDIR)\Filter\Util\Call\Call.pm
+ -if exist $(LIBDIR)\IO rmdir /s /q $(LIBDIR)\IO
+ -rmdir /s $(LIBDIR)\IO
+ -if exist $(LIBDIR)\Thread rmdir /s /q $(LIBDIR)\Thread
+ -rmdir /s $(LIBDIR)\Thread
+ -if exist $(LIBDIR)\B rmdir /s /q $(LIBDIR)\B
+ -rmdir /s $(LIBDIR)\B
+ -if exist $(LIBDIR)\Data rmdir /s /q $(LIBDIR)\Data
+ -rmdir /s $(LIBDIR)\Data
+ -if exist $(LIBDIR)\Filter\Util\Call rmdir /s /q $(LIBDIR)\Filter\Util\Call
+ -if exist $(LIBDIR)\Filter\Util rmdir /s /q $(LIBDIR)\Filter\Util
-del /f $(PODDIR)\*.html
-del /f $(PODDIR)\*.bat
cd ..\utils
cd $(EXTDIR)
-del /s *.lib *.def *.map *.pdb *.bs Makefile *$(o) pm_to_blib
cd ..\win32
- -if exist $(AUTODIR) rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR)
- -if exist $(COREDIR) rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR)
+ -if exist $(AUTODIR) rmdir /s /q $(AUTODIR)
+ -rmdir /s $(AUTODIR)
+ -if exist $(COREDIR) rmdir /s /q $(COREDIR)
+ -rmdir /s $(COREDIR)
install : all installbare installhtml
$(RCOPY) html\*.* $(INST_HTML)\*.*
inst_lib : $(CONFIGPM)
- copy splittree.pl ..
+ copy splittree.pl ..
$(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
$(RCOPY) ..\lib $(INST_LIB)\*.*
$(PERLEXE) -I..\lib harness
cd ..\win32
-clean :
- -@erase miniperlmain$(o)
- -@erase $(MINIPERL)
- -@erase perlglob$(o)
- -@erase perlmain$(o)
- -@erase config.w32
- -@erase /f config.h
- -@erase $(GLOBEXE)
- -@erase $(PERLEXE)
- -@erase $(WPERLEXE)
- -@erase $(PERLDLL)
- -@erase $(CORE_OBJ)
- -if exist $(MINIDIR) rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR)
- -@erase $(WIN32_OBJ)
- -@erase $(DLL_OBJ)
- -@erase $(X2P_OBJ)
- -@erase ..\*$(o) ..\*.lib ..\*.exp *$(o) *.lib *.exp *.res
- -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
- -@erase ..\x2p\*.exe ..\x2p\*.bat
- -@erase *.ilk
- -@erase *.pdb
-
+clean :
+ -@$(DEL) miniperlmain$(o)
+ -@$(DEL) $(MINIPERL)
+ -@$(DEL) perlglob$(o)
+ -@$(DEL) perlmain$(o)
+ -@$(DEL) config.w32
+ -@$(DEL) /f config.h
+ -@$(DEL) $(GLOBEXE)
+ -@$(DEL) $(PERLEXE)
+ -@$(DEL) $(WPERLEXE)
+ -@$(DEL) $(PERLDLL)
+ -@$(DEL) $(CORE_OBJ)
+ -if exist $(MINIDIR) rmdir /s /q $(MINIDIR)
+ -rmdir /s $(MINIDIR)
+ -@$(DEL) $(WIN32_OBJ)
+ -@$(DEL) $(DLL_OBJ)
+ -@$(DEL) $(X2P_OBJ)
+ -@$(DEL) ..\*$(o) ..\*.lib ..\*.exp *$(o) *.lib *.exp *.res
+ -@$(DEL) ..\t\*.exe ..\t\*.dll ..\t\*.bat
+ -@$(DEL) ..\x2p\*.exe ..\x2p\*.bat
+ -@$(DEL) *.ilk
+ -@$(DEL) *.pdb
+
# Handy way to run perlbug -ok without having to install and run the
# installed perlbug. We don't re-run the tests here - we trust the user.
# Please *don't* use this unless all tests pass.
okfile: utils
$(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)" -F perl.ok
-
+
nok: utils
$(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)"
-
+
nokfile: utils
$(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)" -F perl.nok