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