1 | |
---|
2 | prefix = @prefix@ |
---|
3 | exec_prefix = @exec_prefix@ |
---|
4 | bindir = @bindir@ |
---|
5 | libdir = @libdir@ |
---|
6 | includedir = @includedir@ |
---|
7 | mandir = @mandir@ |
---|
8 | |
---|
9 | INSTALL = @INSTALL@ |
---|
10 | INSTALL_PROGRAM = ${INSTALL} -m 755 |
---|
11 | INSTALL_DATA = ${INSTALL} -m 644 |
---|
12 | INSTALL_SCRIPT = ${INSTALL} -m 644 |
---|
13 | |
---|
14 | |
---|
15 | build_date := $(shell date +%Y%m%d) |
---|
16 | machine := $(shell uname -m | sed 's/\ //') |
---|
17 | os := $(shell uname -s) |
---|
18 | bn := $(shell basename $(prefix)) |
---|
19 | TarfileBasename=rappture-$(os)-$(machine)-$(build_date) |
---|
20 | |
---|
21 | # fix this before commiting |
---|
22 | all: rplib build_bindings build_gui |
---|
23 | install: install_rplib install_bindings install_gui install_examples |
---|
24 | ${INSTALL_PROGRAM} gui/apps/rappture $(bindir)/rappture |
---|
25 | ${INSTALL_DATA} gui/apps/rappture.env $(bindir)/rappture.env |
---|
26 | ${INSTALL_PROGRAM} gui/apps/driver $(bindir)/driver |
---|
27 | ${INSTALL_PROGRAM} gui/apps/nanovis-test $(bindir)/nanovis-test |
---|
28 | ${INSTALL_PROGRAM} gui/apps/rerun $(bindir)/rerun |
---|
29 | ${INSTALL_PROGRAM} gui/apps/simsim $(bindir)/simsim |
---|
30 | ${INSTALL_PROGRAM} gui/apps/simsim.tcl $(bindir)/simsim.tcl |
---|
31 | find $(prefix) -name .svn | xargs rm -rf |
---|
32 | |
---|
33 | ########################################################################### |
---|
34 | # Makefile - build and install all Rappture libraries |
---|
35 | ########################################################################### |
---|
36 | |
---|
37 | |
---|
38 | build_gui: |
---|
39 | make -C gui |
---|
40 | |
---|
41 | install_gui: |
---|
42 | make -C gui install |
---|
43 | |
---|
44 | rplib: |
---|
45 | @if ! test -d "include"; then \ |
---|
46 | mkdir include;\ |
---|
47 | fi |
---|
48 | make -C src2/core librappture2.a librappture2.so.0.0 |
---|
49 | make -C src librappture; |
---|
50 | |
---|
51 | install_rplib: |
---|
52 | make -C src2/core install; |
---|
53 | make -C src install_rappture; |
---|
54 | |
---|
55 | build_bindings: build_matlab build_octave build_python build_perl |
---|
56 | |
---|
57 | install_bindings: install_matlab install_octave install_python install_perl install_tcl |
---|
58 | |
---|
59 | ############################################################################# |
---|
60 | # build rappture examples |
---|
61 | # examples: |
---|
62 | # - compile rappture examples in rappture/examples |
---|
63 | ############################################################################# |
---|
64 | build_examples: |
---|
65 | ifneq ($(strip @F77@),) |
---|
66 | make -C examples/app-fermi/fortran |
---|
67 | endif |
---|
68 | ifneq ($(strip @CC@),) |
---|
69 | make -C examples/app-fermi/cee |
---|
70 | make -C examples/app-fermi/wrapper/cee |
---|
71 | make -C examples/c-example |
---|
72 | endif |
---|
73 | |
---|
74 | install_examples: build_examples |
---|
75 | cp -r examples $(prefix) |
---|
76 | rm -f $(prefix)/examples/demo.bash.in |
---|
77 | find $(prefix)/examples -name .svn | xargs rm -rf |
---|
78 | |
---|
79 | |
---|
80 | |
---|
81 | ############################################################################# |
---|
82 | |
---|
83 | #tcl bindings |
---|
84 | install_tcl: |
---|
85 | cd tcl; $(bindir)/tclsh install.tcl |
---|
86 | # cd tcl; @TCLSH@ install.tcl |
---|
87 | make -C src/tcl install |
---|
88 | |
---|
89 | # matlab bindings |
---|
90 | build_matlab: |
---|
91 | @if test "x@MEX@" != "x" ; then \ |
---|
92 | make -C src/matlab; \ |
---|
93 | fi |
---|
94 | |
---|
95 | install_matlab: build_matlab |
---|
96 | @if test "x@MEX@" != "x" ; then \ |
---|
97 | make -C src/matlab install; \ |
---|
98 | fi |
---|
99 | |
---|
100 | # octave bindings |
---|
101 | build_octave: |
---|
102 | @if test "x@MKOCTFILE@" != "x" ; then \ |
---|
103 | make -C src/octave; \ |
---|
104 | fi |
---|
105 | |
---|
106 | install_octave: build_octave |
---|
107 | @if test "x@MKOCTFILE@" != "x" ; then \ |
---|
108 | make -C src/octave install; \ |
---|
109 | fi |
---|
110 | |
---|
111 | build_python: |
---|
112 | @if test "x@PYTHON@" != "x" ; then \ |
---|
113 | set -x; \ |
---|
114 | cd python; \ |
---|
115 | @PYTHON@ setup.py \ |
---|
116 | build_ext \ |
---|
117 | --library-dirs=$(libdir):../src \ |
---|
118 | --include-dirs=$(includedir) \ |
---|
119 | build; \ |
---|
120 | fi |
---|
121 | |
---|
122 | install_python: build_python |
---|
123 | @if test "x@PYTHON@" != "x" ; then \ |
---|
124 | cd python; \ |
---|
125 | @PYTHON@ setup.py install --prefix=$(prefix); \ |
---|
126 | fi |
---|
127 | |
---|
128 | build_perl: |
---|
129 | @if test "x@PERL@" != "x" ; then \ |
---|
130 | cd perl; \ |
---|
131 | @PERL@ Makefile.PL INSTALLSITELIB=$(libdir)/perl5 INSTALLSITEARCH=$(libdir)/perl5 INSTALLSITEMAN3DIR=$(mandir)/man3; \ |
---|
132 | make; LD_LIBRARY_PATH=$(libdir):../src make test; \ |
---|
133 | fi |
---|
134 | |
---|
135 | install_perl: build_perl |
---|
136 | @if test "x@PERL@" != "x" ; then \ |
---|
137 | make -C perl install; \ |
---|
138 | fi |
---|
139 | |
---|
140 | build_pkgs: |
---|
141 | @if ! test -d "bin"; then \ |
---|
142 | mkdir bin;\ |
---|
143 | fi |
---|
144 | # building rappture binary package |
---|
145 | cd $(prefix)/..; tar czf @RP_BASE@/bin/$(TarfileBasename).tar.gz $(bn) |
---|
146 | |
---|
147 | clean: |
---|
148 | make -C examples/app-fermi/cee clean |
---|
149 | make -C examples/app-fermi/fortran clean |
---|
150 | make -C examples/app-fermi/wrapper/cee clean |
---|
151 | make -C examples/c-example clean |
---|
152 | make -C gui clean |
---|
153 | @if test -r "perl/Makefile" ; then \ |
---|
154 | make -C perl clean; \ |
---|
155 | fi |
---|
156 | rm -rf python/build |
---|
157 | make -C src clean |
---|
158 | make -C src/matlab clean |
---|
159 | make -C src/octave clean |
---|
160 | make -C src/tcl clean |
---|
161 | make -C src2/core clean |
---|
162 | rm -f include/* |
---|
163 | |
---|
164 | distclean: |
---|
165 | rm examples/demo.bash |
---|
166 | make -C examples/app-fermi/cee distclean |
---|
167 | make -C examples/app-fermi/fortran distclean |
---|
168 | make -C examples/app-fermi/wrapper/cee distclean |
---|
169 | make -C examples/c-example distclean |
---|
170 | make -C gui distclean |
---|
171 | make -C perl clean; rm perl/Makefile.PL |
---|
172 | rm -rf python/build python/setup.py |
---|
173 | make -C src distclean |
---|
174 | make -C src/matlab distclean |
---|
175 | make -C src/octave distclean |
---|
176 | make -C src/tcl distclean |
---|
177 | make -C src2/core distclean |
---|
178 | make -C test distclean |
---|
179 | rm gui/apps/rappture gui/apps/simsim gui/apps/rappture.env; |
---|
180 | rm -rf Makefile config.status config.log bin; |
---|
181 | rm -f include/* |
---|