X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/3dfd1da1ac911ed5d5b4e3956b485ad9af14a10f..7522fed5983de9fb01258eea70b60840a6a2c756:/win32/Makefile diff --git a/win32/Makefile b/win32/Makefile index f8095d8..e72963a 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -1,63 +1,115 @@ -# -# Makefile to build perl on Windowns NT using Microsoft NMAKE. -# Works with MS command line compilers from VC++ etc. +# +# Makefile to build perl on Windows NT using Microsoft NMAKE. # # This is set up to build a perl.exe that runs off a shared library # (perl.dll). Also makes individual DLLs for the XS extensions. -# NB: Miniperl has a different set of objects it depends on than -# perl.exe -# Also, Miniperl will not build with -DPERL_OBJECT defined +# + +## +## Build configuration. Edit the values below to suit your needs. +## + # # Set these to wherever you want "nmake install" to put your # newly built perl. +# INST_DRV = c: -INST_TOP = $(INST_DRV)\perl5004.5x +INST_TOP = $(INST_DRV)\perl + +# +# Comment this out if you DON'T want your perl installation to be versioned. +# This means that the new installation will overwrite any files from the +# old installation at the same INST_TOP location. Leaving it enabled is +# the safest route, as perl adds the extra version directory to all the +# locations it installs files to. If you disable it, an alternative +# versioned installation can be obtained by setting INST_TOP above to a +# path that includes an arbitrary version string. +# +INST_VER = \5.00475 # # uncomment to enable threads-capabilities +# #USE_THREADS = define # # uncomment next line if you are using Visual C++ 2.x +# #CCTYPE = MSVC20 # # uncomment next line if you want to use the perl object -OBJECT = -DPERL_OBJECT +# Currently, this cannot be enabled if you ask for threads above +# +#OBJECT = -DPERL_OBJECT # # uncomment next line if you want debug version of perl (big,slow) +# #CFG = Debug # +# uncomment to enable use of PerlCRT.DLL. Highly recommended. It has +# patches that fix known bugs in MSCVRT.DLL. You will need to download it +# from: and follow the directions in the package to install. +# +#USE_PERLCRT = define + +# +# uncomment to enable linking with setargv.obj under the Visual C +# compiler. Setting this options enables perl to expand wildcards in +# arguments, but it may be harder to use alternate methods like +# File::DosGlob that are more powerful. This option is supported only with +# Visual C. +# +#USE_SETARGV = define + +# # if you have the source for des_fcrypt(), uncomment this and make sure the -# file exists (see README.win32) +# file exists (see README.win32). File should be located in the same +# directory as this file. Not (yet) supported with PERL_OBJECT. +# #CRYPT_SRC = des_fcrypt.c # # if you didn't set CRYPT_SRC and if you have des_fcrypt() available in a # library, uncomment this, and make sure the library exists (see README.win32) +# Specify the full pathname of the library. +# #CRYPT_LIB = des_fcrypt.lib # # set this if you wish to use perl's malloc # WARNING: Turning this on/off WILL break binary compatibility with extensions -# you may have compiled with/without it. Be prepared to recompile all extensions -# if you change the default. +# you may have compiled with/without it. Be prepared to recompile all +# extensions if you change the default. Currently, this cannot be enabled +# if you ask for PERL_OBJECT above. +# #PERL_MALLOC = define # # set the install locations of the compiler include/libraries +# #CCHOME = f:\msvc20 CCHOME = $(MSVCDIR) CCINCDIR = $(CCHOME)\include CCLIBDIR = $(CCHOME)\lib # +# specify space-separated list of extra directories to look for libraries +# +EXTRALIBDIRS = + +# # set this to your email address (perl will guess a value from # from your loginname and your hostname, which may not be right) +# #EMAIL = +## +## Build configuration ends. +## + ##################### CHANGE THESE ONLY IF YOU MUST ##################### !IF "$(CRYPT_SRC)$(CRYPT_LIB)" == "" @@ -87,11 +139,15 @@ USE_THREADS = undef PROCESSOR_ARCHITECTURE = x86 !ENDIF +!IF "$(OBJECT)" != "" +ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-object +!ELSE !IF "$(USE_THREADS)" == "define" ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-thread !ELSE ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE) !ENDIF +!ENDIF ARCHDIR = ..\lib\$(ARCHNAME) COREDIR = ..\lib\CORE @@ -108,24 +164,31 @@ LIB32 = $(LINK32) -lib # # Options # -!IF "$(OBJECT)" == "-DPERL_OBJECT" -RUNTIME = -MT -# XXX building with -MD fails many tests, but cannot investigate -# because building with debug crashes compiler :-( GSAR )-: -#RUNTIME = -MD -!ELSE -RUNTIME = -MD -!ENDIF -INCLUDES = -I.\include -I. -I.. +RUNTIME = -MD +INCLUDES = -I$(COREDIR) -I.\include -I. -I.. #PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX -DEFINES = -DWIN32 -D_CONSOLE $(BUILDOPT) $(CRYPT_FLAG) +DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT $(BUILDOPT) $(CRYPT_FLAG) LOCDEFS = -DPERLDLL -DPERL_CORE SUBSYS = console CXX_FLAG = -TP -GX +!IF "$(USE_PERLCRT)" == "" +! IF "$(CFG)" == "Debug" +PERLCRTLIBC = msvcrtd.lib +! ELSE +PERLCRTLIBC = msvcrt.lib +! ENDIF +!ELSE +! IF "$(CFG)" == "Debug" +PERLCRTLIBC = PerlCRTD.lib +! ELSE +PERLCRTLIBC = PerlCRT.lib +! ENDIF +!ENDIF + !IF "$(RUNTIME)" == "-MD" -LIBC = msvcrt.lib +LIBC = $(PERLCRTLIBC) !ELSE LIBC = libcmt.lib !ENDIF @@ -150,15 +213,17 @@ LINK_DBG = -release OPTIMIZE = $(OPTIMIZE) $(CXX_FLAG) !ENDIF -# we don't add LIBC here, the compiler does it based on -MD/-MT -LIBFILES = $(CRYPT_LIB) oldnames.lib kernel32.lib user32.lib gdi32.lib \ +LIBBASEFILES = $(CRYPT_LIB) oldnames.lib kernel32.lib user32.lib gdi32.lib \ winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib \ oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \ version.lib odbc32.lib odbccp32.lib +# we add LIBC here, since we may be using PerlCRT.dll +LIBFILES = $(LIBBASEFILES) $(LIBC) + CFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) \ $(PCHFLAGS) $(OPTIMIZE) -LINK_FLAGS = -nologo $(LINK_DBG) -machine:$(PROCESSOR_ARCHITECTURE) +LINK_FLAGS = -nologo -nodefaultlib $(LINK_DBG) -machine:$(PROCESSOR_ARCHITECTURE) OBJOUT_FLAG = -Fo EXEOUT_FLAG = -Fe @@ -176,7 +241,7 @@ o = .obj .SUFFIXES : .c $(o) .dll .lib .exe .c$(o): - $(CC) -c $(CFLAGS_O) $(OBJOUT_FLAG)$@ $< + $(CC) -c -I$( $(*B).c cd ..\..\win32 +!IF "$(OBJECT)" == "-DPERL_OBJECT" +PerlCAPI.cpp : $(MINIPERL) + $(MINIPERL) GenCAPI.pl $(COREDIR) + +PerlCAPI$(o) : PerlCAPI.cpp + $(CC) $(CFLAGS_O) $(RUNTIME) -UPERLDLL -c \ + $(OBJOUT_FLAG)PerlCAPI$(o) PerlCAPI.cpp + +$(CAPILIB) : PerlCAPI.cpp PerlCAPI$(o) + lib /OUT:$(CAPILIB) PerlCAPI$(o) +!ENDIF + $(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs +$(DUMPER_DLL): $(PERLEXE) $(DUMPER).xs + cd $(EXTDIR)\Data\$(*B) + ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\..\win32 + +$(RE_DLL): $(PERLEXE) $(RE).xs + cd $(EXTDIR)\$(*B) + ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\win32 + $(B_DLL): $(PERLEXE) $(B).xs cd $(EXTDIR)\$(*B) ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl @@ -596,6 +767,12 @@ $(ATTRS_DLL): $(PERLEXE) $(ATTRS).xs $(MAKE) cd ..\..\win32 +$(POSIX_DLL): $(PERLEXE) $(POSIX).xs + cd $(EXTDIR)\$(*B) + ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\win32 + $(IO_DLL): $(PERLEXE) $(IO).xs cd $(EXTDIR)\$(*B) ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl @@ -626,37 +803,55 @@ $(SOCKET_DLL): $(PERLEXE) $(SOCKET).xs $(MAKE) cd ..\..\win32 +$(ERRNO_PM): $(PERLEXE) $(ERRNO)_pm.PL + cd $(EXTDIR)\$(*B) + ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\win32 + doc: $(PERLEXE) - cd ..\pod - $(MAKE) -f ..\win32\pod.mak checkpods pod2html pod2latex \ - pod2man pod2text - $(XCOPY) *.bat ..\win32\bin\*.* - cd ..\win32 copy ..\README.win32 ..\pod\perlwin32.pod $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=./html \ --podpath=pod:lib:ext:utils --htmlroot="file://$(INST_HTML::=|)" \ --libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse -utils: $(PERLEXE) +utils: $(PERLEXE) $(X2P) cd ..\utils - $(MAKE) PERL=$(PERLEXE) - $(PERLEXE) -I..\lib ..\win32\$(PL2BAT) h2ph splain perlbug pl2pm c2ph - $(PERLEXE) ..\win32\$(PL2BAT) h2xs perldoc pstruct - $(XCOPY) *.bat ..\win32\bin\*.* + $(MAKE) PERL=$(MINIPERL) + cd ..\pod + $(MAKE) -f ..\win32\pod.mak converters cd ..\win32 - $(PERLEXE) -I..\lib $(PL2BAT) bin\network.pl bin\www.pl bin\runperl.pl \ - bin\pl2bat.pl bin\perlglob.pl + $(PERLEXE) $(PL2BAT) $(UTILS) distclean: clean -del /f $(MINIPERL) $(PERLEXE) $(PERL95EXE) $(PERLDLL) $(GLOBEXE) \ $(PERLIMPLIB) ..\miniperl.lib $(MINIMOD) -del /f *.def *.map - -del /f $(EXTENSION_DLL) - -del /f $(EXTENSION_C) + -del /f $(EXTENSION_DLL) $(EXTENSION_PM) + -del /f $(EXTENSION_C) $(DYNALOADER).c $(ERRNO).pm + -del /f $(EXTDIR)\DynaLoader\dl_win32.xs + -del /f $(LIBDIR)\.exists $(LIBDIR)\attrs.pm $(LIBDIR)\DynaLoader.pm + -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm + -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm $(LIBDIR)\Thread.pm + -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm + -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm + -del /f $(LIBDIR)\Data\Dumper.pm + -rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO + -rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread + -rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B + -rmdir /s /q $(LIBDIR)\Data || rmdir /s $(LIBDIR)\Data -del /f $(PODDIR)\*.html -del /f $(PODDIR)\*.bat + cd ..\utils + -del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc pstruct + -del /f *.bat + cd ..\win32 + cd ..\x2p + -del /f find2perl s2p + -del /f *.bat + cd ..\win32 -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new - -del /f ..\lib\Config.pm + -del /f $(CONFIGPM) -del /f perl95.c -del /f bin\*.bat cd $(EXTDIR) @@ -664,14 +859,19 @@ distclean: clean cd ..\win32 -rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR) -rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR) - -rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR) -install : all doc utils +install : all installbare installhtml + +installbare : utils $(PERLEXE) ..\installperl +!IF "$(USE_PERLCRT)" == "" $(XCOPY) $(PERL95EXE) $(INST_BIN)\*.* +!ENDIF $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.* - $(XCOPY) bin\*.bat $(INST_BIN)\*.* - $(XCOPY) ..\pod\*.bat $(INST_BIN)\*.* + $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.* + $(XCOPY) bin\network.pl $(INST_LIB)\*.* + +installhtml : doc $(RCOPY) html\*.* $(INST_HTML)\*.* inst_lib : $(CONFIGPM) @@ -711,11 +911,13 @@ clean : -@erase perlmain$(o) -@erase config.w32 -@erase /f config.h + -@erase PerlCAPI.cpp -@erase $(GLOBEXE) -@erase $(PERLEXE) -@erase $(PERLDLL) -@erase $(CORE_OBJ) - -rmdir /s /q "$(MINIDIR)" + -@erase $(CAPILIB) + -rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR) -@erase $(WIN32_OBJ) -@erase $(DLL_OBJ) -@erase $(X2P_OBJ)