diff options
Diffstat (limited to 'win32/Makefile')
-rw-r--r-- | win32/Makefile | 308 |
1 files changed, 228 insertions, 80 deletions
diff --git a/win32/Makefile b/win32/Makefile index 07e781efb5..05c2c48b36 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -1,126 +1,274 @@ +# +# Makefile to build perl on Windowns 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. +# +# There's no support for building an all-static perl yet. +# Doesn't build any of the stuff in ..\utils yet. +# No support for installing documentation, uh, yet. +# -LIBDIR=..\..\lib + +# +# Set this to wherever you want "nmake install" to put your +# newly built perl. If you change this, you better change +# all occurrences of this prefix in $(INST_TOP)\lib\Config.pm +# as well. + +INST_TOP=C:\perl + +#################### do not edit below this line ######################## +# +INST_BIN=$(INST_TOP)\bin +INST_LIB=$(INST_TOP)\lib +INST_POD=$(INST_TOP)\pod +INST_HTML=$(INST_POD)\html +LIBDIR=..\lib EXTDIR=..\ext +PODDIR=..\pod EXTUTILSDIR=$(LIBDIR)\extutils -XSUBPP=..\..\miniperl $(EXTUTILSDIR)\xsubpp -C++ -prototypes -AUTOSPLIT=..\..\miniperl ..\..\win32\autosplit.pl -DEST=..\ + +# +# various targets +PERLLIB=..\libperl.lib +MINIPERL=..\miniperl.exe +PERLDLL=..\perl.dll +PERLEXE=..\perl.exe +GLOBEXE=..\perlglob.exe + +PL2BAT=bin\PL2BAT.BAT +MAKE=nmake /nologo +XCOPY=xcopy /d /f /r +NULL= + +# +# filenames given to xsubpp must have forward slashes (since it puts +# full pathnames in #line strings) +XSUBPP=..\$(MINIPERL) ..\$(EXTUTILSDIR)\xsubpp -C++ -prototypes + +CORE_C= \ + ..\av.c \ + ..\deb.c \ + ..\doio.c \ + ..\doop.c \ + ..\dump.c \ + ..\globals.c \ + ..\gv.c \ + ..\hv.c \ + ..\mg.c \ + ..\op.c \ + ..\perl.c \ + ..\perlio.c \ + ..\perly.c \ + ..\pp.c \ + ..\pp_ctl.c \ + ..\pp_hot.c \ + ..\pp_sys.c \ + ..\regcomp.c \ + ..\regexec.c \ + ..\run.c \ + ..\scope.c \ + ..\sv.c \ + ..\taint.c \ + ..\toke.c \ + ..\universal.c \ + ..\util.c EXTENSIONS=DynaLoader Socket IO Fcntl Opcode SDBM_File -#STATICLINKMODUES=DynaLoader Socket Fcntl Opcode SDBM_File -STATICLINKMODUES= -#DYNALOADMODULES=IO.dll -DYNALOADMODULES=Socket.dll Fcntl.dll Opcode.dll SDBM_File.dll IO.dll -ALL: perl +DYNALOADER=$(EXTDIR)\DynaLoader\DynaLoader +SOCKET=$(EXTDIR)\Socket\Socket +FCNTL=$(EXTDIR)\Fcntl\Fcntl +OPCODE=$(EXTDIR)\Opcode\Opcode +SDBM_FILE=$(EXTDIR)\SDBM_File\SDBM_File +IO=$(EXTDIR)\IO\IO + +SOCKET_DLL=..\lib\auto\Socket\Socket.dll +FCNTL_DLL=..\lib\auto\Fcntl\Fcntl.dll +OPCODE_DLL=..\lib\auto\Opcode\Opcode.dll +SDBM_FILE_DLL=..\lib\auto\SDBM_File\SDBM_File.dll +IO_DLL=..\lib\auto\IO\IO.dll + +STATICLINKMODULES=DynaLoader +DYNALOADMODULES= \ + $(SOCKET_DLL) \ + $(FCNTL_DLL) \ + $(OPCODE_DLL) \ + $(SDBM_FILE_DLL)\ + $(IO_DLL) + +POD2HTML=$(PODDIR)\pod2html +POD2MAN=$(PODDIR)\pod2man +POD2LATEX=$(PODDIR)\pod2latex +POD2TEXT=$(PODDIR)\pod2text + +ALL: $(PERLEXE) $(GLOBEXE) $(DYNALOADMODULES) !IF "$(CFG)" =="" CFG=Release !ENDIF -modules : $(EXTENSIONS) - nmake -A -f modules.mak CFG="modules - Win32 $(CFG)" +modules.lib : $(DYNALOADER).c + $(MAKE) -A -f modules.mak CFG="modules - Win32 $(CFG)" -perlglob.exe: - nmake -f perlglob.mak CFG="perlglob - Win32 Release" +$(GLOBEXE): + $(MAKE) -f perlglob.mak CFG="perlglob - Win32 Release" -libperl.lib: +$(PERLLIB): $(CORE_C) attrib -r ..\*.h copy dosish.h .. copy EXTERN.h .. - nmake -f libperl.mak CFG="libperl - Win32 $(CFG)" + $(MAKE) -f libperl.mak CFG="libperl - Win32 $(CFG)" -miniperl.exe: libperl.lib - nmake -A -f miniperl.mak CFG="miniperl - Win32 $(CFG)" +$(MINIPERL): $(PERLLIB) + $(MAKE) -A -f miniperl.mak CFG="miniperl - Win32 $(CFG)" copy config.w32 ..\config.sh cd .. miniperl configpm cd win32 - if exist lib\* xcopy lib\*.* ..\lib\ /s/e + if exist lib\* $(XCOPY) /e lib\*.* ..\lib\$(NULL) copy bin\test.bat ..\t -perldll: miniperl.exe libperl.lib - ..\miniperl -w makedef.pl > perldll.def - nmake -A -f perldll.mak CFG="perldll - Win32 $(CFG)" +$(PERLDLL): $(MINIPERL) $(PERLLIB) + $(MINIPERL) -w makedef.pl > perldll.def + $(MAKE) -A -f perldll.mak CFG="perldll - Win32 $(CFG)" -dynamodules: $(DYNALOADMODULES) - -perl: miniperl.exe modules perldll perlglob.exe dynamodules - ..\miniperl makemain.pl $(STATICLINKMODUES) > perlmain.c - ..\miniperl makeperldef.pl $(STATICLINKMODUES) > perl.def +$(PERLEXE): $(MINIPERL) modules.lib $(PERLDLL) + attrib -r perlmain.c + attrib -r perl.def +# $(MINIPERL) makemain.pl $(STATICLINKMODUES) > perlmain.c +# $(MINIPERL) makeperldef.pl $(STATICLINKMODUES) > perl.def + $(MINIPERL) makeperldef.pl $(NULL) > perl.def copy runperl.c perlmain.c - nmake -A -f perl.mak CFG="perl - Win32 $(CFG)" - copy ..\_perl.exe ..\perl.exe + $(MAKE) -A -f perl.mak CFG="perl - Win32 $(CFG)" + copy ..\_perl.exe $(PERLEXE) del ..\_perl.exe del ..\*.exp copy splittree.pl .. - ..\miniperl ..\splittree.pl "../LIB" "../LIB/auto" + $(MINIPERL) ..\splittree.pl "../LIB" "../LIB/auto" attrib -r ..\t\*.* copy test ..\t - xcopy ..\perl.h ..\lib\CORE\*.* - -DynaLoader: - md ..\lib\auto - cd $(EXTDIR)\$* - copy ..\..\win32\dl_win32.xs . - copy $*.pm $(LIBDIR) - $(XSUBPP) dl_win32.xs > $*.c - cd ..\..\win32 + $(XCOPY) ..\*.h ..\lib\CORE\*.* + $(XCOPY) ..\perl.lib ..\lib\CORE + $(XCOPY) $(PERLLIB) ..\lib\CORE + $(XCOPY) *.h ..\lib\CORE + $(XCOPY) /S include ..\lib\CORE -Socket: - md ..\lib\auto\$* - ..\miniperl genxsdef.pl $* > $*.def - cd $(EXTDIR)\$* - copy $*.pm $(LIBDIR) - $(XSUBPP) $*.xs > $*.c +$(DYNALOADER).c: $(EXTDIR)\DynaLoader\dl_win32.xs + if not exist ..\lib\auto md ..\lib\auto + $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL) + cd $(EXTDIR)\$(*B) + $(XSUBPP) dl_win32.xs > $(*B).c cd ..\..\win32 -Socket.dll: - nmake -f $*.mak CFG="$* - Win32 $(CFG)" +$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs + copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs -IO: - md ..\lib\auto\$* - ..\miniperl genxsdef.pl $* > $*.def - cd $(EXTDIR)\$* - copy $*.pm $(LIBDIR) - xcopy lib\*.* $(LIBDIR) /s - $(XSUBPP) $*.xs > $*.c +$(SOCKET).c: $(SOCKET).xs + if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B) + $(MINIPERL) genxsdef.pl $(*B) > $(*B).def + $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL) + cd $(EXTDIR)\$(*B) + $(XSUBPP) $(*B).xs > $(*B).c cd ..\..\win32 -IO.dll: - nmake -f $*.mak CFG="$* - Win32 $(CFG)" +$(IO).c: $(IO).xs + if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B) + $(MINIPERL) genxsdef.pl $(*B) > $(*B).def + $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL) + $(XCOPY) /s $(EXTDIR)\$(*B)\lib\*.* $(LIBDIR) + cd $(EXTDIR)\$(*B) + $(XSUBPP) $(*B).xs > $(*B).c + cd ..\..\win32 -SDBM_File: - md ..\lib\auto\$* - ..\miniperl genxsdef.pl $* > $*.def - cd $(EXTDIR)\$* - copy $*.pm $(LIBDIR) - $(XSUBPP) -typemap ./typemap $*.xs > $*.c +$(SDBM_FILE).c: $(SDBM_FILE).xs + if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B) + $(MINIPERL) genxsdef.pl $(*B) > $(*B).def + $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL) + cd $(EXTDIR)\$(*B) + $(XSUBPP) -typemap ./typemap $(*B).xs > $(*B).c cd ..\..\win32 -SDBM_File.dll: - nmake -f $*.mak CFG="$* - Win32 $(CFG)" +$(FCNTL).c: $(FCNTL).xs + if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B) + $(MINIPERL) genxsdef.pl $(*B) > $(*B).def + $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL) + cd $(EXTDIR)\$(*B) + $(XSUBPP) $(*B).xs > $(*B).c + cd ..\..\win32 -Fcntl: - md ..\lib\auto\$* - ..\miniperl genxsdef.pl $* > $*.def - cd $(EXTDIR)\$* - copy $*.pm $(LIBDIR) - $(XSUBPP) $*.xs > $*.c +$(OPCODE).c: $(OPCODE).xs + if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B) + $(MINIPERL) genxsdef.pl $(*B) > $(*B).def + $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL) + $(XCOPY) $(EXTDIR)\$(*B)\*.pm $(LIBDIR)\$(NULL) + cd $(EXTDIR)\$(*B) + $(XSUBPP) $(*B).xs > $(*B).c cd ..\..\win32 -Fcntl.dll: - nmake -f $*.mak CFG="$* - Win32 $(CFG)" +$(SOCKET_DLL): $(SOCKET).c $(PERLDLL) + $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)" -Opcode: - md ..\lib\auto\$* - ..\miniperl genxsdef.pl $* > $*.def - cd $(EXTDIR)\$* - xcopy *.pm $(LIBDIR) - $(XSUBPP) $*.xs > $*.c - cd ..\..\win32 +$(IO_DLL): $(IO).c $(PERLDLL) + $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)" + +$(SDBM_FILE_DLL): $(SDBM_FILE).c $(PERLDLL) + $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)" -Opcode.dll: - nmake -f $*.mak CFG="$* - Win32 $(CFG)" +$(FCNTL_DLL): $(FCNTL).c $(PERLDLL) + $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)" +$(OPCODE_DLL): $(OPCODE).c $(PERLDLL) + $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)" + +doc: $(PERLEXE) + $(PERLEXE) $(POD2HTML).PL + $(PERLEXE) $(POD2MAN).PL + $(PERLEXE) $(POD2LATEX).PL + $(PERLEXE) $(POD2TEXT).PL + $(PERLEXE) $(PL2BAT) $(POD2HTML) + $(PERLEXE) $(PL2BAT) $(POD2MAN) + $(PERLEXE) $(PL2BAT) $(POD2LATEX) + $(PERLEXE) $(PL2BAT) $(POD2TEXT) + cd $(PODDIR) + $(PERLEXE) pod2html.bat *.pod + cd ..\win32 + +distclean: + -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \ + $(PERLLIB) modules.lib + -del /f *.def + -del /f $(SOCKET_DLL) $(IO_DLL) $(SDBM_FILE_DLL) \ + $(FCNTL_DLL) $(OPCODE_DLL) + -del /f $(SOCKET).c $(IO).c $(SDBM_FILE).c $(FCNTL).c \ + $(OPCODE).c $(DYNALOADER).c + -del /f $(PODDIR)\*.html + -del /f $(PODDIR)\*.bat + -rmdir /s /q release + -rmdir /s /q debug + +install : ALL doc + if not exist $(INST_TOP) mkdir $(INST_TOP) + echo I $(INST_TOP) L $(LIBDIR) + $(XCOPY) $(PERLEXE) $(INST_BIN)\*.* + $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.* + $(XCOPY) $(PERLDLL) $(INST_BIN)\*.* + $(XCOPY) /e ..\lib $(INST_LIB)\*.* + $(XCOPY) ..\pod\*.bat $(INST_BIN)\*.* + $(XCOPY) ..\pod\*.pod $(INST_POD)\*.* + $(XCOPY) ..\pod\*.html $(INST_HTML)\*.* + +inst_lib : + copy splittree.pl .. + $(MINIPERL) ..\splittree.pl "../LIB" "../LIB/auto" + $(XCOPY) /e ..\lib $(INST_LIB)\*.* +test : all + $(XCOPY) $(PERLEXE) ..\t\$(NULL) + $(XCOPY) $(PERLDLL) ..\t\$(NULL) + $(XCOPY) $(GLOBEXE) ..\t\$(NULL) + cd ..\t + $(PERLEXE) test + cd ..\win32 |