| 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 and perl-PGPLOT install |
|---|
| 28 | # make reconfigure reconfigure @MCCODE_TARNAME@ installation (after software update) |
|---|
| 29 | # make install-pgplot build and install PGPLOT |
|---|
| 30 | # make install-scilab build and install Scilab |
|---|
| 31 | |
|---|
| 32 | SHELL = /bin/sh |
|---|
| 33 | |
|---|
| 34 | prefix = @prefix@ |
|---|
| 35 | exec_prefix = @exec_prefix@ |
|---|
| 36 | bindir = @bindir@ |
|---|
| 37 | srcdir = @srcdir@ |
|---|
| 38 | libdir = @libdir@ |
|---|
| 39 | mandir = @mandir@ |
|---|
| 40 | PWD = `pwd` |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | DEBUG = -DDEBUG=0 |
|---|
| 44 | libdir_@MCCODE_TARNAME@ = $(libdir)/@MCCODE_TARNAME@ |
|---|
| 45 | |
|---|
| 46 | CC = @CC@ |
|---|
| 47 | MINGW = @MINGW@ |
|---|
| 48 | CFLAGS = @CFLAGS@ |
|---|
| 49 | LDFLAGS= @LDFLAGS@ |
|---|
| 50 | |
|---|
| 51 | HAVE_QSORT = @HAVE_QSORT@ |
|---|
| 52 | USE_NEXUS = @HAVE_NEXUS@ |
|---|
| 53 | |
|---|
| 54 | DEFS = @MCCODE_NAME@ @DEFS@ $(DEBUG) |
|---|
| 55 | LIBS = @LIBS@ |
|---|
| 56 | |
|---|
| 57 | PERL = @PERL@ |
|---|
| 58 | |
|---|
| 59 | FLEX = flex |
|---|
| 60 | FLEXFLAGS=-i |
|---|
| 61 | |
|---|
| 62 | BISON = bison |
|---|
| 63 | BISONFLAGS = -v -d |
|---|
| 64 | |
|---|
| 65 | SCILAB = @SCILAB@ |
|---|
| 66 | MATLAB = @MATLAB@ |
|---|
| 67 | PGPLOT = @PGPLOT@ |
|---|
| 68 | VRML = @VRMLVIEW@ |
|---|
| 69 | |
|---|
| 70 | WGET = @WGET@ |
|---|
| 71 | |
|---|
| 72 | XTERM = @TERM@ |
|---|
| 73 | |
|---|
| 74 | INSTALL=@INSTALL@ |
|---|
| 75 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
|---|
| 76 | INSTALL_DATA = @INSTALL_DATA@ |
|---|
| 77 | |
|---|
| 78 | |
|---|
| 79 | # |
|---|
| 80 | # End of configuration section. |
|---|
| 81 | # |
|---|
| 82 | |
|---|
| 83 | all: @MCCODE_TARNAME@ |
|---|
| 84 | |
|---|
| 85 | @MCCODE_TARNAME@: $(OBJECTS) |
|---|
| 86 | cd src/ && $(MAKE) |
|---|
| 87 | |
|---|
| 88 | clean: |
|---|
| 89 | cd src/ && $(MAKE) clean |
|---|
| 90 | rm -f src/config.cache config.cache |
|---|
| 91 | |
|---|
| 92 | distclean: |
|---|
| 93 | cd src/ && $(MAKE) distclean |
|---|
| 94 | rm -f src/config.cache src/Makefile config.cache Makefile |
|---|
| 95 | |
|---|
| 96 | install: |
|---|
| 97 | cd src/ && $(MAKE) install |
|---|
| 98 | |
|---|
| 99 | # Prefer Scilab over Matlab over PGPLOT |
|---|
| 100 | config: |
|---|
| 101 | if [ $(VRML) != no ]; then \ |
|---|
| 102 | $(MAKE) vrml; \ |
|---|
| 103 | fi; \ |
|---|
| 104 | if [ $(SCILAB) != no ]; then \ |
|---|
| 105 | $(MAKE) scilab; \ |
|---|
| 106 | fi; \ |
|---|
| 107 | if [ $(MATLAB) != no ]; then \ |
|---|
| 108 | $(MAKE) matlab; \ |
|---|
| 109 | fi; \ |
|---|
| 110 | if [ $(PGPLOT) != no ]; then \ |
|---|
| 111 | $(MAKE) pgplot; \ |
|---|
| 112 | fi; |
|---|
| 113 | |
|---|
| 114 | scilab: |
|---|
| 115 | sed "s/PLOTTER => '.*'./PLOTTER => 'Scilab'\,/" lib/tools/perl/@MCCODE_TARNAME@_config.perl > lib/tools/perl/@MCCODE_TARNAME@_config.perl.tmp |
|---|
| 116 | mv lib/tools/perl/@MCCODE_TARNAME@_config.perl.tmp lib/tools/perl/@MCCODE_TARNAME@_config.perl |
|---|
| 117 | matlab: |
|---|
| 118 | sed "s/PLOTTER => '.*'./PLOTTER => 'Matlab'\,/" lib/tools/perl/@MCCODE_TARNAME@_config.perl > lib/tools/perl/@MCCODE_TARNAME@_config.perl.tmp |
|---|
| 119 | mv lib/tools/perl/@MCCODE_TARNAME@_config.perl.tmp lib/tools/perl/@MCCODE_TARNAME@_config.perl |
|---|
| 120 | pgplot: |
|---|
| 121 | sed "s/PLOTTER => '.*'./PLOTTER => 'McStas'\,/" lib/tools/perl/@MCCODE_TARNAME@_config.perl > lib/tools/perl/@MCCODE_TARNAME@_config.perl.tmp |
|---|
| 122 | mv lib/tools/perl/@MCCODE_TARNAME@_config.perl.tmp lib/tools/perl/@MCCODE_TARNAME@_config.perl |
|---|
| 123 | vrml: |
|---|
| 124 | sed "s/PLOTTER => '.*'./PLOTTER => 'VRML'\,/" lib/tools/perl/@MCCODE_TARNAME@_config.perl > lib/tools/perl/@MCCODE_TARNAME@_config.perl.tmp |
|---|
| 125 | mv lib/tools/perl/@MCCODE_TARNAME@_config.perl.tmp lib/tools/perl/@MCCODE_TARNAME@_config.perl |
|---|
| 126 | PGPLOT: pgplot |
|---|
| 127 | Matlab: matlab |
|---|
| 128 | Scilab: scilab |
|---|
| 129 | VRML: vrml |
|---|
| 130 | |
|---|
| 131 | test: |
|---|
| 132 | cd src && $(MAKE) test |
|---|
| 133 | |
|---|
| 134 | uninstall: |
|---|
| 135 | cd src && $(MAKE) uninstall |
|---|
| 136 | |
|---|
| 137 | reconfigure: |
|---|
| 138 | cd $(libdir_@MCCODE_TARNAME@)/tools/perl/ |
|---|
| 139 | $(libdir_@MCCODE_TARNAME@)/tools/perl/mccode_reconfigure |
|---|
| 140 | |
|---|
| 141 | # Optional auto install of patched perl-Tk, scilab and pgplot5 libs |
|---|
| 142 | install-pgplot: |
|---|
| 143 | cd support/common && $(MAKE) install-pgplot |
|---|
| 144 | make pgplot |
|---|
| 145 | @echo "@MCCODE_NAME@: run 'make reconfigure'" |
|---|
| 146 | |
|---|
| 147 | install-scilab: |
|---|
| 148 | cd support/common && $(MAKE) compile-scilab && echo "@MCCODE_NAME@: run './configure; make; make install' again" |
|---|
| 149 | |
|---|