@rem Most parts of this file is not specific to the pc or user but some @rem small things are. @rem ==== Here are some specific settings you must make here: ==== @setlocal @rem set-upload.cmd - This is for ftp server password and user when @rem uploading. It should look like this: @rem @rem set user-pw-account=your-account your-password @rem set ftp-server=your.ftp.server set set-upload=set-upload.cmd @rem You need an old emacs: @set emacs-old-exe="c:\Program Files\Emacs\emacs-21.3\bin\emacs.exe" @rem @set usethis-exe="c:\program files\emacs\EmacsW32\bin\usethis.exe" @rem 7-zip is used for unpacking: @set z7="d:\program files\7-zip\7z.exe" @rem EmacsW32, the zipped version: @set emacsw32_ver=0.99 @set emacsw32_zip="c:\program files\emacs\EmacsW32\output\EmacsW32-alone-%emacsw32_ver%.zip" @rem Where your image lib dll:s are. Set this to blank to skip @rem those. Note that the image libraries must be available in the path @rem when configuring compilation. @set imglib-dir=d:\g\bin @rem Where to install the new Emacs on your pc: @set install_root=D:/emacs @set install_rootW=D:\emacs @rem Subdir under dates @set emacssubdir=emacs @rem Distribution ID for packaged Emacs: @set distid=CvsP @rem Set this to 1 to include date in ID and to 0 otherwise @set distid-dt=1 @rem Upload dir on ftp server: @set ftp-upload-test-dir=/htdocs/Emacs/DL/EmacsW32+Emacs/test @set ftp-upload-src-dir=/htdocs/Emacs/DL/EmacsW32+Emacs/src @rem ================== End of specific part ===================== @goto basic-checks @rem ------------ Sub :setup-one-name @set %1=%2 @if "%distid-dt%" == "1" set %1=%2%co-dt% @goto :EOF :setup-names @call :setup-one-name dist-name %distid% @rem set dist-name=%src-name%.7z @set dist-name @rem set readme-name=readme-%distid%.txt @call :setup-one-name readme-name readme-%distid% @set readme-name=%readme-name%.txt @set readme-name @rem @set diff-file-name=patch-%distid%.diff @call :setup-one-name diff-name patch-%distid% @set diff-name=%diff-name%.diff @set diff-name @rem @set package-name=Emacs-22.0.50.1-%distid%-EmacsW32-%emacsw32_ver%.exe @rem @call :setup-one-name package-name Emacs-22.0.50.1-%distid% @call :setup-one-name package-name Emacs-22-%distid% @set package-name=%package-name%-EmacsW32-%emacsw32_ver%.exe @set package-name @rem @set src-file=bld\emacs%co-dt%.7z @call :setup-one-name src-name emacs-%distid% @set src-name=%src-name%.7z @set src-name @goto :EOF @rem ---------------- :basic-checks @echo Checking basic setup ... @if exist co-time.el goto co-time-el-ok @echo Can't find co-time.el @goto end :co-time-el-ok @if exist mkreadme.el goto mkreadme-el-ok @echo Can't find mkreadme.el @goto end :mkreadme-el-ok @if exist %emacs-old-exe% goto old-emacs-ok @echo Can't find pc specific %emacs-old-exe% @goto end :old-emacs-ok @rem @if exist %usethis-exe% goto usethis-exe-ok @rem @echo Can't find pc specific %usethis-exe% @rem @goto end @rem :usethis-exe-ok @if exist %z7% goto z7-ok @echo Can't find pc specific %z7% @goto end :z7-ok @if exist %emacsw32_zip% goto emacsw32-zip-ok @echo Can't find pc specific %emacsw32_zip% @goto end :emacsw32-zip-ok @if "%imglib-dir%" == "" goto imglib-dir-ok @if exist %imglib-dir% goto imglib-dir-ok @echo Can't find pc specific %imglib-dir% @goto end :imglib-dir-ok @if exist %install_rootW% goto install-rootW-ok @echo Can't find pc specific %install_rootW% @goto end :install-rootW-ok @if exist %set-upload% goto set-upload-cmd-ok @echo Can't find user specific %set-upload% @goto end :set-upload-cmd-ok @echo ... basic setup was ok @if "%1" == "?" goto help @if "%1" == "-?" goto help @if "%1" == "-h" goto help @if "%1" == "help" goto help @if "%1" == "-help" goto help @if "%1" == "--help" goto help @goto begin :help @echo. @echo Script for building Emacs from CVS sources. @echo. @echo Usage: make-cvs [start [end]] @echo. @echo Start in START and run to END which may be any of @echo. @echo checkout @echo mktime @echo mkpatch @echo configure @echo mkbootstrap @echo mkinfo @echo mkinstall @echo addsetup @echo addimglib @echo mkreadme @echo mkpackage @echo mkupsrc @echo upload @goto end :begin @echo. @echo. @echo ************************************************************** @echo ************************************************************** @echo ********** Make-CVS.cmd starting ... **************** @echo ************************************************************** @echo ************************************************************** @if exist bld\temp-co-time.cmd call bld\temp-co-time.cmd @call :setup-names @if not "%1"=="" goto %1 :checkout @echo. @echo. @echo ************************************************************** @echo *** Checkout CVS @echo ************************************************************** @time /t @set /a conum=0 :co-again @set /a coagain=0 set curr-wd=%CD% set curr-wd=%CD% cd bld ..\coemacs 2>&1 | tee co.tmp @grep "checkout aborted" co.tmp @if not errorlevel 1 goto end @grep "^U " co.tmp @if not errorlevel 1 set /a coagain=1 cd %curr-wd% if %coagain% == 1 goto co-again @echo ***************** The long forgotten cvs update kb! ****** set curr-wd=%CD% cd bld\emacs\nt cvs update -kb cd %curr-wd% @echo Checkouts: %conum% if %conum% gtr 1 goto mktime @echo ***************** No new files in CVS ******************* @if "%2"=="checkout" goto end :mktime @echo. @echo. @echo ************************************************************** @echo *** Save checkout time @echo ************************************************************** if exist bld\temp-co-time.cmd del bld\temp-co-time.cmd set curr-wd=%CD% cd bld %emacs-old-exe% -batch -no-site-file -q -l ../co-time.el if errorlevel 1 goto end cd %curr-wd% call bld\temp-co-time.cmd @call :setup-names @if "%2"=="mktime" goto end :mkpatch @echo. @echo. @echo ************************************************************** @echo *** Make patch @echo ************************************************************** @set diff-file=%CD%\bld\%diff-name% set curr-wd=%CD% cd bld\emacs cvs diff -u > %diff-file% cd %curr-wd% @if "%2"=="mkpatch" goto end :configure set curr-wd=%CD% cd bld\emacs\nt cmd /c configure --with-gcc --no-debug --cflags -Id:/g/include 2>&1 | tee config-%co-dt%.tmp cd %curr-wd% @if "%2"=="configure" goto end :mkbootstrap @echo. @echo. @echo ************************************************************** @echo *** make bootstrap @echo ************************************************************** @time /t set curr-wd=%CD% cd bld\emacs\nt set trace-tmp=bootstrap-%co-dt%.tmp make bootstrap 2>&1 | tee %trace-tmp% @findstr /m /c:"Error 2" %trace-tmp% @if %errorlevel% EQU 0 goto end cd %curr-wd% @if "%2"=="mkbootstrap" goto end :mkinfo @echo. @echo. @echo ************************************************************** @echo *** make info @echo ************************************************************** @time /t set curr-wd=%CD% cd bld\emacs\nt set trace-tmp=info-%co-dt%.tmp make info 2>&1 | tee %trace-tmp% @findstr /m /c:"Error 2" %trace-tmp% @if %errorlevel% EQU 0 goto end cd %curr-wd% @if "%2"=="mkinfo" goto end :mkinstall @echo. @echo. @echo ************************************************************** @echo *** make install @echo ************************************************************** @time /t set curr-wd=%CD% cd bld\emacs\nt set trace-tmp=install-%co-dt%.tmp make install INSTALL_DIR=%install_root%/%co-dt%/%emacssubdir% 2>&1 | tee %trace-tmp% @findstr /m /c:"Error 2" %trace-tmp% @if %errorlevel% EQU 0 goto end cd %curr-wd% @if "%2"=="mkinstall" goto end :addsetup @echo. @echo. @echo ************************************************************** @echo *** Add Setup Utilities for MS Windows @echo ************************************************************** %z7% x -y -o%install_root%/%co-dt%/ %emacsw32_zip% 2>&1 | tee addsetup-%co-dt%.tmp @rem cp %usethis-exe% "%install_root%/%co-dt%/%emacssubdir%/bin" cp %install_root%/%co-dt%/EmacsW32/bin/usethis.exe "%install_root%/%co-dt%/%emacssubdir%/bin" "%install_root%\%co-dt%\%emacssubdir%\bin\usethis" -q set sLispFile="%install_root%\%co-dt%\EmacsW32\lisp\emacsw32-setup-base.el" set emacs-cvs-exe="%install_root%/%co-dt%/%emacssubdir%/bin/emacs.exe" %emacs-cvs-exe% -batch -no-site-file -q -l %sLispFile% @if "%2"=="addsetup" goto end :addimglib @echo. @echo. @echo ************************************************************** @echo *** Copy image libraries @echo ************************************************************** @if "%imglib-dir%" == "" goto after-imglib set curr-wd=%CD% cd %install_rootW%\%co-dt%\emacs\bin @rem call cp-imglib-here copy %imglib-dir%\jpeg62.dll . copy %imglib-dir%\libimage.dll . copy %imglib-dir%\libpng13.dll . copy %imglib-dir%\libtiff3.dll . copy %imglib-dir%\libungif.dll . copy %imglib-dir%\xpm4.dll . copy %imglib-dir%\zlib1.dll . cd %curr-wd% :after-imglib @if "%2"=="addimglib" goto end :mkreadme @echo. @echo. @echo ************************************************************** @echo *** Create readme file @echo ************************************************************** @rem set readme-file=%install_root%\%co-dt%\EmacsW32\readme-Cvs%co-dt%.txt set readme-file=%install_root%\%co-dt%\EmacsW32\%readme-name% cp readme-CVS.txt %readme-file% %emacs-old-exe% -batch -no-site-file -q %readme-file% -l %CD%\mkreadme.el @if "%2"=="mkreadme" goto end :mkpackage @echo. @echo. @echo ************************************************************** @echo *** Make distribution package exe-file @echo ************************************************************** @rem @set diff-file=%CD%\bld\patch-%co-dt%.diff @set diff-file=%CD%\bld\%diff-name% @if exist %diff-file% goto diff-file-found @echo Error - can not find %diff-file% @goto end :diff-file-found copy %diff-file% %install_root:/=\%\%co-dt%\EmacsW32\ @rem call %install_root:/=\%\%co-dt%\EmacsW32\mkInstaller.cmd Cvs%co-dt% %diff-name% 2>&1 | tee mkinstaller-%co-dt%.tmp call %install_root:/=\%\%co-dt%\EmacsW32\mkInstaller.cmd %dist-name% %diff-name% 2>&1 | tee mkinstaller-%co-dt%.tmp @if "%2"=="mkpackage" goto end :mkupsrc @echo. @echo. @echo ************************************************************** @echo *** Make upsrc @echo ************************************************************** set curr-wd=%CD% cd bld @rem %z7% a -t7z -r emacs%co-dt%.7z emacs %z7% a -t7z emacs-%distid%%co-dt%.7z -ir!emacs\*.c -ir!emacs\*.h 2>&1 | tee z-%co-dt%.tmp cd %curr-wd% @if "%2"=="mkupsrc" goto end :upload @echo. @echo. @echo ************************************************************** @echo *** Upload @echo ************************************************************** @time /t @set src-file=bld\%src-name% @rem @set diff-file=bld\patch-%co-dt%.diff @set diff-file=bld\%diff-name% @set package-file=%install_root%\%co-dt%\EmacsW32\output\%package-name% @set readme-file=%install_root%\%co-dt%\EmacsW32\%readme-name% @set ftp-cmds=temp-ftp.txt @echo Call pc-specific %set-upload% @call %set-upload% @echo status > %ftp-cmds% @echo open %ftp-server% >> %ftp-cmds% @echo user %user-pw-account% >> %ftp-cmds% @echo cd %ftp-upload-src-dir% >> %ftp-cmds% @echo pwd >> %ftp-cmds% @echo binary >> %ftp-cmds% @echo send %src-file% >> %ftp-cmds% @echo ascii >> %ftp-cmds% @echo send %diff-file% >> %ftp-cmds% @echo ls >> %ftp-cmds% @echo cd %ftp-upload-test-dir% >> %ftp-cmds% @echo pwd >> %ftp-cmds% @echo ascii >> %ftp-cmds% @echo send %readme-file% >> %ftp-cmds% @echo binary >> %ftp-cmds% @echo send %package-file% >> %ftp-cmds% @echo ls >> %ftp-cmds% @echo close >> %ftp-cmds% @echo quit >> %ftp-cmds% type %ftp-cmds% ftp -n -s:%ftp-cmds% 2>&1 | tee upl-%co-dt%.tmp @findstr /c:"Unknown host" upl-%co-dt%.tmp @if not errorlevel 1 echo "*** ERROR *** Upload failed! :end