@echo off :: :: - Assume the following files and directory structure: :: /current_directory (njoy2012) :: ... containing this batch script :: ... containing src (used by upd) :: ... containing upn (used by upd) :: ... containing whatever makefile is specified below :: by the User's make command :: ... containing NJOYMan.cls (used by texify) :: /figs :: ... containing all NJOY manual pdf figure files :: :: - This batch file ... :: - checks for a new NJOY version #; :: - verifies that a upn files exists in the current directory; :: - executes "upd x" to extract new *.f90 and *.tex files; :: - executes "nmake /f makef.win.ifort" to create a new njoy :: executable program; :: - rename the new executable, "xnjoy.xex", to "njoy2012.#.exe"; :: - NOTE: if "njoy2012.#.exe" already exists the rename :: command will fail but this script will continue. :: - executes "texify --pdf --quiet --clean njoy12.tex" to :: create an updated njoy manual (pdf file); :: - the script given here is what is used on a LANL Win7 box :: containing Microsoft's nmake program, the Intel Fortran :: compiler and the MikTeX, version 2.9, distribution; :: - User's may have to customize these commands for :: their specific machine; :: - renames this pdf file to njoy2012.#.pdf; :: - deletes various intermediate files, leaving only the :: new executable and new pdf of the NJOY2012 manual. :: - NOTE: we use "nmake", a Microsoft version of the unix :: "make" program to create a new njoy executable. :: - NOTE: this script attempts to delete no longer needed :: object files after the new executable has been :: created. the extension for object files varies :: among compilers, typically .o or .obj. we specify :: .obj in this script. :: - NOTE: "texify" is supplied with the MikTeX (version 2.9) :: distribution and automatically runs runs pdfLaTeX, :: MakeIndex and BibTeX iteratively to create a new :: NJOY2012 Manual pdf file. :: :: perform input variable test ... if "%1" equ "" GOTO blank :: check that requested update file exists ... if NOT exist upn GOTO noupn :: use upd to extract latest *.f90 and *.tex files ... upd x if ERRORLEVEL 1 goto upd_abort echo All required *.f90 and *.tex files have been created ... continue :: compile new njoy .f90 source files echo working to create a new NJOY executable ... nmake /f makef.win.ifort if ERRORLEVEL 1 goto nmake_abort rename xnjoy.exe njoy2012.%1.exe echo The NJOY2012.%1 executable has been created, echo deleting temporary files ... del *.f90 del *.mod del *.obj :: create a new manual echo working to create a new NJOY manual pdf ... texify --pdf --quiet --clean njoy12.tex if ERRORLEVEL 1 goto tex_abort rename njoy12.pdf njoy2012.%1.pdf echo finished! del *.tex echo new njoy code and manual are available ... exiting goto end :blank echo Need an NJOY version specification ... no action taken goto end :noupn echo Can't find upn ... processing halted goto end :upd_abort echo upd error ... processing halted goto end :nmake_abort echo nmake or fortran compilation error ... processing halted goto end :tex_abort echo tex error, revised njoy manual was not created ... processing halted :end