| 1 | # Makefile for @MCCODE_NAME@. |
|---|
| 2 | # |
|---|
| 3 | # This file is part of the @MCCODE_NAME@ ray-trace simulation package |
|---|
| 4 | # Copyright (C) 1997-2008, All rights reserved |
|---|
| 5 | # Risoe National Laborartory, Roskilde, Denmark |
|---|
| 6 | # Institut Laue Langevin, Grenoble, France |
|---|
| 7 | # |
|---|
| 8 | # This program is free software; you can redistribute it and/or modify |
|---|
| 9 | # it under the terms of the GNU General Public License as published by |
|---|
| 10 | # the Free Software Foundation; version 2 of the License. |
|---|
| 11 | # |
|---|
| 12 | # This program is distributed in the hope that it will be useful, |
|---|
| 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 15 | # GNU General Public License for more details. |
|---|
| 16 | # |
|---|
| 17 | # You should have received a copy of the GNU General Public License |
|---|
| 18 | # along with this program; if not, write to the Free Software |
|---|
| 19 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 20 | |
|---|
| 21 | # Available methods for installation |
|---|
| 22 | # make normal build |
|---|
| 23 | # make install normal installation |
|---|
| 24 | # make clean clean distro |
|---|
| 25 | # make test distro self-test |
|---|
| 26 | # make plotter best plotter choice |
|---|
| 27 | # make pgplot plotter PGPLOT selection |
|---|
| 28 | # make reconfigure reconfigure @MCCODE_TARNAME@ installation (after software update) |
|---|
| 29 | # make install-pgplot build and install PGPLOT (including perl-PGPLOT) |
|---|
| 30 | # make install-scilab build and install Scilab |
|---|
| 31 | # make install-apps install highligh syntax in gedit/kate |
|---|
| 32 | # and icon in menu/education (requires administrator permissions) |
|---|
| 33 | |
|---|
| 34 | SHELL = /bin/sh |
|---|
| 35 | |
|---|
| 36 | prefix = @prefix@ |
|---|
| 37 | exec_prefix = @exec_prefix@ |
|---|
| 38 | bindir = @bindir@ |
|---|
| 39 | srcdir = @srcdir@ |
|---|
| 40 | libdir = @libdir@ |
|---|
| 41 | mandir = @mandir@ |
|---|
| 42 | PWD = `pwd` |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | DEBUG = -DDEBUG=0 |
|---|
| 46 | libdir_@MCCODE_TARNAME@ = $(libdir)/@MCCODE_TARNAME@ |
|---|
| 47 | |
|---|
| 48 | CC = @CC@ |
|---|
| 49 | MINGW = @MINGW@ |
|---|
| 50 | CFLAGS = @CFLAGS@ |
|---|
| 51 | LDFLAGS= @LDFLAGS@ |
|---|
| 52 | |
|---|
| 53 | HAVE_QSORT = @HAVE_QSORT@ |
|---|
| 54 | USE_NEXUS = @HAVE_NEXUS@ |
|---|
| 55 | |
|---|
| 56 | DEFS = @MCCODE_NAME@ @DEFS@ $(DEBUG) |
|---|
| 57 | LIBS = @LIBS@ |
|---|
| 58 | |
|---|
| 59 | PERL = @PERL@ |
|---|
| 60 | |
|---|
| 61 | FLEX = flex |
|---|
| 62 | FLEXFLAGS=-i |
|---|
| 63 | |
|---|
| 64 | BISON = bison |
|---|
| 65 | BISONFLAGS = -v -d |
|---|
| 66 | |
|---|
| 67 | SCILAB = @SCILAB@ |
|---|
| 68 | MATLAB = @MATLAB@ |
|---|
| 69 | PGPLOT = @PGPLOT@ |
|---|
| 70 | VRML = @VRMLVIEW@ |
|---|
| 71 | |
|---|
| 72 | WGET = @WGET@ |
|---|
| 73 | |
|---|
| 74 | XTERM = @TERM@ |
|---|
| 75 | |
|---|
| 76 | INSTALL=@INSTALL@ |
|---|
| 77 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
|---|
| 78 | INSTALL_DATA = @INSTALL_DATA@ |
|---|
| 79 | |
|---|
| 80 | |
|---|
| 81 | # |
|---|
| 82 | # End of configuration section. |
|---|
| 83 | # |
|---|
| 84 | |
|---|
| 85 | all: @MCCODE_TARNAME@ |
|---|
| 86 | |
|---|
| 87 | @MCCODE_TARNAME@: $(OBJECTS) |
|---|
| 88 | cd src/ && $(MAKE) |
|---|
| 89 | |
|---|
| 90 | @MCCODE_TARNAME@.win32: $(OBJECTS) |
|---|
| 91 | cd src/ && $(MAKE) @MCCODE_TARNAME@.win32 |
|---|
| 92 | |
|---|
| 93 | clean: |
|---|
| 94 | cd src/ && $(MAKE) clean |
|---|
| 95 | rm -f src/config.cache config.cache |
|---|
| 96 | |
|---|
| 97 | distclean: |
|---|
| 98 | cd src/ && $(MAKE) distclean |
|---|
| 99 | rm -f src/config.cache src/Makefile config.cache Makefile |
|---|
| 100 | |
|---|
| 101 | install: |
|---|
| 102 | cd src/ && $(MAKE) install |
|---|
| 103 | |
|---|
| 104 | # Prefer Scilab over Matlab over PGPLOT |
|---|
| 105 | config: plotter |
|---|
| 106 | plotter: |
|---|
| 107 | if [ $(VRML) != no ]; then \ |
|---|
| 108 | $(MAKE) vrml; \ |
|---|
| 109 | fi; \ |
|---|
| 110 | if [ $(SCILAB) != no ]; then \ |
|---|
| 111 | $(MAKE) scilab; \ |
|---|
| 112 | fi; \ |
|---|
| 113 | if [ $(MATLAB) != no ]; then \ |
|---|
| 114 | $(MAKE) matlab; \ |
|---|
| 115 | fi; \ |
|---|
| 116 | if [ $(PGPLOT) != no ]; then \ |
|---|
| 117 | $(MAKE) pgplot; \ |
|---|
| 118 | fi; |
|---|
| 119 | |
|---|
| 120 | scilab: |
|---|
| 121 | sed "s/PLOTTER => '.*'./PLOTTER => 'Scilab'\,/" lib/tools/perl/mccode_config.perl > lib/tools/perl/mccode_config.perl.tmp |
|---|
| 122 | mv lib/tools/perl/mccode_config.perl.tmp lib/tools/perl/mccode_config.perl |
|---|
| 123 | matlab: |
|---|
| 124 | sed "s/PLOTTER => '.*'./PLOTTER => 'Matlab'\,/" lib/tools/perl/mccode_config.perl > lib/tools/perl/mccode_config.perl.tmp |
|---|
| 125 | mv lib/tools/perl/mccode_config.perl.tmp lib/tools/perl/@MCCODE_TARNAME@_config.perl |
|---|
| 126 | pgplot: |
|---|
| 127 | sed "s/PLOTTER => '.*'./PLOTTER => 'McStas'\,/" lib/tools/perl/mccode_config.perl > lib/tools/perl/mccode_config.perl.tmp |
|---|
| 128 | mv lib/tools/perl/mccode_config.perl.tmp lib/tools/perl/mccode_config.perl |
|---|
| 129 | vrml: |
|---|
| 130 | sed "s/PLOTTER => '.*'./PLOTTER => 'VRML'\,/" lib/tools/perl/mccode_config.perl > lib/tools/perl/mccode_config.perl.tmp |
|---|
| 131 | mv lib/tools/perl/mccode_config.perl.tmp lib/tools/perl/mccode_config.perl |
|---|
| 132 | PGPLOT: pgplot |
|---|
| 133 | Matlab: matlab |
|---|
| 134 | Scilab: scilab |
|---|
| 135 | VRML: vrml |
|---|
| 136 | |
|---|
| 137 | test: |
|---|
| 138 | cd src && $(MAKE) test |
|---|
| 139 | |
|---|
| 140 | uninstall: |
|---|
| 141 | cd src && $(MAKE) uninstall |
|---|
| 142 | |
|---|
| 143 | reconfigure: |
|---|
| 144 | cd $(libdir_@MCCODE_TARNAME@)/tools/perl/ |
|---|
| 145 | $(libdir_@MCCODE_TARNAME@)/tools/perl/mccode_reconfigure |
|---|
| 146 | |
|---|
| 147 | # Optional auto install of patched perl-Tk, scilab and pgplot5 libs |
|---|
| 148 | install-pgplot: |
|---|
| 149 | cd support/common && $(MAKE) install-pgplot |
|---|
| 150 | cd support/common && $(MAKE) perl-PGPLOT |
|---|
| 151 | make pgplot |
|---|
| 152 | @echo "@MCCODE_NAME@: pgplot installed, run 'make reconfigure'" |
|---|
| 153 | |
|---|
| 154 | install-scilab: |
|---|
| 155 | cd support/common && $(MAKE) compile-scilab && echo "@MCCODE_NAME@: run './configure; make; make install' again" |
|---|
| 156 | |
|---|
| 157 | install-apps: |
|---|
| 158 | if [ -d /usr/share/applications/ ]; then \ |
|---|
| 159 | cp support/common/Desktop/McStas.desktop /usr/share/applications/; \ |
|---|
| 160 | fi; |
|---|
| 161 | if [ -d /usr/share/pixmaps/ ]; then \ |
|---|
| 162 | cp support/common/Desktop/mcstas-icon.png /usr/share/pixmaps/; \ |
|---|
| 163 | fi; |
|---|
| 164 | if [ -d /usr/share/gtksourceview-1.0/ ]; then \ |
|---|
| 165 | cp support/common/editors/mcstas1.lang /usr/share/gtksourceview-1.0/language-specs/; \ |
|---|
| 166 | fi; |
|---|
| 167 | if [ -d /usr/share/gtksourceview-2.0/ ]; then \ |
|---|
| 168 | cp support/common/editors/mcstas2.lang /usr/share/gtksourceview-2.0/language-specs/; \ |
|---|
| 169 | fi; |
|---|
| 170 | if [ -d /usr/share/apps/katepart/syntax/ ]; then \ |
|---|
| 171 | cp support/common/editors/mcstas.xml /usr/share/apps/katepart/syntax/; \ |
|---|
| 172 | fi; |
|---|
| 173 | |
|---|
| 174 | |
|---|