| 1 | @rem
|
|---|
| 2 | @rem This file is part of the McStas neutron ray-trace simulation package
|
|---|
| 3 | @rem Copyright (C) 1997-2004, All rights reserved
|
|---|
| 4 | @rem Risoe National Laborartory, Roskilde, Denmark
|
|---|
| 5 | @rem Institut Laue Langevin, Grenoble, France
|
|---|
| 6 | @rem
|
|---|
| 7 | @rem This program is free software; you can redistribute it and/or modify
|
|---|
| 8 | @rem it under the terms of the GNU General Public License as published by
|
|---|
| 9 | @rem the Free Software Foundation; version 2 of the License.
|
|---|
| 10 | @rem
|
|---|
| 11 | @rem This program is distributed in the hope that it will be useful,
|
|---|
| 12 | @rem but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 13 | @rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 14 | @rem GNU General Public License for more details.
|
|---|
| 15 | @rem
|
|---|
| 16 | @rem You should have received a copy of the GNU General Public License
|
|---|
| 17 | @rem along with this program; if not, write to the Free Software
|
|---|
| 18 | @rem Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|---|
| 19 | @rem
|
|---|
| 20 | @echo off
|
|---|
| 21 | @echo Simple batch script for building McStas on Win32 systems,
|
|---|
| 22 | @echo after build using Bloodshed Dev-Cpp.
|
|---|
| 23 | @echo Requires
|
|---|
| 24 | @echo c compiler (defaults to gcc)
|
|---|
| 25 | @echo includes (defaults to Dev-Cpp standard location)
|
|---|
| 26 | @echo ...
|
|---|
| 27 | @echo *** Start of User configuration ***
|
|---|
| 28 | @set CC=c:\Dev-Cpp\bin\gcc.exe
|
|---|
| 29 | @set /P CC=Set CC compiler variable (default is %CC%):
|
|---|
| 30 | @set INCLUDE="C:\Dev-Cpp\include"
|
|---|
| 31 | @echo ...
|
|---|
| 32 | @echo NOTE: Set the C include and lib paths using / or \\ - NOT single \
|
|---|
| 33 | @echo ...
|
|---|
| 34 | @set /P INCLUDE=Set C INCLUDE variable (default is %INCLUDE%):
|
|---|
| 35 | @set LIB="C:\Dev-Cpp\lib"
|
|---|
| 36 | @set /P LIB=Set C LIB variable (default is %LIB%):
|
|---|
| 37 | @echo ...
|
|---|
| 38 | @echo ...
|
|---|
| 39 | @set DOZIP="0"
|
|---|
| 40 | @set DONSIS="0"
|
|---|
| 41 | @rem *** End of User configuration ***
|
|---|
| 42 | @rem
|
|---|
| 43 | @set VERSION=MCSTAS_VERSION
|
|---|
| 44 | @echo Doing Win32 build using %CC% -I%INCLUDE% -L%LIB%
|
|---|
| 45 | @del *.o
|
|---|
| 46 | @del mcstas.exe mcformat.exe
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 | %CC% -c symtab.c -o symtab.o -I%INCLUDE%
|
|---|
| 50 |
|
|---|
| 51 | %CC% -c cogen.c -o cogen.o -I%INCLUDE%
|
|---|
| 52 |
|
|---|
| 53 | %CC% -c coords.c -o coords.o -I%INCLUDE%
|
|---|
| 54 |
|
|---|
| 55 | %CC% -c debug.c -o debug.o -I%INCLUDE%
|
|---|
| 56 |
|
|---|
| 57 | %CC% -c file.c -o file.o -I%INCLUDE%
|
|---|
| 58 |
|
|---|
| 59 | %CC% -c instrument.tab.c -o instrument.tab.o -I%INCLUDE%
|
|---|
| 60 |
|
|---|
| 61 | %CC% -c lex.yy.c -o lex.yy.o -I%INCLUDE%
|
|---|
| 62 |
|
|---|
| 63 | %CC% -c list.c -o list.o -I%INCLUDE%
|
|---|
| 64 |
|
|---|
| 65 | %CC% -c memory.c -o memory.o -I%INCLUDE%
|
|---|
| 66 |
|
|---|
| 67 | %CC% -c port.c -o port.o -I%INCLUDE%
|
|---|
| 68 |
|
|---|
| 69 | %CC% -c cexp.c -o cexp.o -I%INCLUDE%
|
|---|
| 70 |
|
|---|
| 71 | %CC% symtab.o cogen.o coords.o debug.o file.o instrument.tab.o lex.yy.o list.o memory.o port.o cexp.o -o "mcstas.exe" -L%LIB% -I%INCLUDE%
|
|---|
| 72 |
|
|---|
| 73 | %CC% mcformat.c -o "mcformat.exe" -L%LIB% -I%INCLUDE%
|
|---|
| 74 |
|
|---|
| 75 | @if %DOZIP%=="0" goto end
|
|---|
| 76 | @echo creating zipfile for Win Distribution (requires zip)...
|
|---|
| 77 | cd ..
|
|---|
| 78 | zip -r mcstas-%VERSION%-i686-Intel-Win32 .\mcstas-%VERSION%
|
|---|
| 79 | cd mcstas-%VERSION%
|
|---|
| 80 | @if %DONSIS%=="0" goto end
|
|---|
| 81 | @echo creating Nullsoft installer .exe (requires nullsoft builder)
|
|---|
| 82 | copy mcstas.ini ..
|
|---|
| 83 | copy mcstas.nsi ..
|
|---|
| 84 | copy mcstas.bmp ..
|
|---|
| 85 | copy LICENSE.rtf ..
|
|---|
| 86 | cd ..
|
|---|
| 87 | @rem In principle, we could have a check for the other support apps here...
|
|---|
| 88 | c:\progra~1\nsis\makensis mcstas.nsi
|
|---|
| 89 | :end
|
|---|
| 90 |
|
|---|
| 91 | @echo Build for Windows done. Press a key to exit.
|
|---|
| 92 | @pause |
|---|