Makefile.am 8.75 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE).
#
# This file is part of Olena.
#
# Olena is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, version 2 of the License.
#
# Olena is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Olena.  If not, see <http://www.gnu.org/licenses/>.
Roland Levillain's avatar
Roland Levillain committed
16
17
18
19
20
21
22
23
24

## ------------------ ##
## Generic material.  ##
## ------------------ ##

## FIXME: Factor as much as possible.  See how we handled this in TC.

CLEANFILES =
AM_CPPFLAGS = -I$(PYTHONINC) -I$(top_srcdir)/milena
Roland Levillain's avatar
Roland Levillain committed
25
26
TOOLS_CXXFLAGS = @TOOLS_CXXFLAGS@
AM_CXXFLAGS = $(TOOLS_CXXFLAGS)
27
AM_SWIGFLAGS = -Wall -c++ -python -I$(top_srcdir)/milena
Roland Levillain's avatar
Roland Levillain committed
28
29
30
31
32
33
34
35
36
37
38
39
## We build modules, not plain libs.
AM_LDFLAGS = -avoid-version -module -shared

## Run Swig to create the C++ wrapper files, the Python interface
## files, and the dependency Makefile snippets.
%-wrap.cc %.py: $(top_srcdir)/swilena/%.i
	if $(SWIG) $(AM_SWIGFLAGS) $(SWIGFLAGS) -MD -MF "$(DEPDIR)/$*-wrap.Tcc" -o $@ $<; then \
	  mv -f "$(DEPDIR)/$*-wrap.Tcc" "$(DEPDIR)/$*-wrap.Pcc";\
	else \
	  rm -f "$(DEPDIR)/$*-wrap.Tcc"; exit 1;\
	fi

Roland Levillain's avatar
Roland Levillain committed
40

Roland Levillain's avatar
Roland Levillain committed
41
42
# ltihooks.py: Python import hooks that understand Libtool libraries.
python_PYTHON = ltihooks.py
Roland Levillain's avatar
Roland Levillain committed
43
44
# swilena.py: The whole Swilena suite.
python_PYTHON += swilena.py
45
46
# data.py: Access to the data of the distribution (images, meshes, etc.)
python_PYTHON += data.py
Roland Levillain's avatar
Roland Levillain committed
47
48
49
50
51
52
53
54
55


## ----------------- ##
## Wrapped modules.  ##
## ----------------- ##

## FIXME: All of this should be generated.
## Don't forget to add a `deps-reset' target as in TC.

Roland Levillain's avatar
Roland Levillain committed
56
57
58
59
60
## FIXME: Dependencies do not work as expected, e.g., touching
## mln/core/point.hh will not void point-wrap.cc, and Swig will not
## regen it (it will merely recompile _point2d.la).  See how other
## projects people handle this.

61
62
63
nodist_python_PYTHON =
pyexec_LTLIBRARIES =

Roland Levillain's avatar
Roland Levillain committed
64
65
66
67
68
69
70
71
72
73
## config.
pyexec_LTLIBRARIES += _config.la
nodist__config_la_SOURCES = config-wrap.cc
_config_la_LIBADD = $(AM_LIBADD)
CLEANFILES += $(nodist__config_la_SOURCES) config.py config.py[co]
## Include the dependency files.  Copied from Automake's generated
## case for C++.
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_config-wrap.Pcc@am__quote@
nodist_python_PYTHON += config.py

74
75
76
77
78
## point2d.
pyexec_LTLIBRARIES += _point2d.la
nodist__point2d_la_SOURCES = point2d-wrap.cc
_point2d_la_LIBADD = $(AM_LIBADD)
CLEANFILES += $(nodist__point2d_la_SOURCES) point2d.py point2d.py[co]
Roland Levillain's avatar
Roland Levillain committed
79
80
## Include the dependency files.  Copied from Automake's generated
## case for C++.
81
82
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_point2d-wrap.Pcc@am__quote@
nodist_python_PYTHON += point2d.py
Roland Levillain's avatar
Roland Levillain committed
83

84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
## dpoint2d.
pyexec_LTLIBRARIES += _dpoint2d.la
nodist__dpoint2d_la_SOURCES = dpoint2d-wrap.cc
_dpoint2d_la_LIBADD = $(AM_LIBADD)
CLEANFILES += $(nodist__dpoint2d_la_SOURCES) dpoint2d.py dpoint2d.py[co]
## Include the dependency files.  Copied from Automake's generated
## case for C++.
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_dpoint2d-wrap.Pcc@am__quote@
nodist_python_PYTHON += dpoint2d.py

## box2d.
pyexec_LTLIBRARIES += _box2d.la
nodist__box2d_la_SOURCES = box2d-wrap.cc
_box2d_la_LIBADD = $(AM_LIBADD)
CLEANFILES += $(nodist__box2d_la_SOURCES) box2d.py box2d.py[co]
## Include the dependency files.  Copied from Automake's generated
## case for C++.
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_box2d-wrap.Pcc@am__quote@
nodist_python_PYTHON += box2d.py

104
105
106
107
108
109
110
111
112
113
## box2d_piter.
pyexec_LTLIBRARIES += _box2d_piter.la
nodist__box2d_piter_la_SOURCES = box2d_piter-wrap.cc
_box2d_piter_la_LIBADD = $(AM_LIBADD)
CLEANFILES += $(nodist__box2d_piter_la_SOURCES) box2d_piter.py box2d_piter.py[co]
## Include the dependency files.  Copied from Automake's generated
## case for C++.
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_box2d_piter-wrap.Pcc@am__quote@
nodist_python_PYTHON += box2d_piter.py

114
115
116
117
118
119
120
121
122
123
## int_u8.
pyexec_LTLIBRARIES += _int_u8.la
nodist__int_u8_la_SOURCES = int_u8-wrap.cc
_int_u8_la_LIBADD = $(AM_LIBADD)
CLEANFILES += $(nodist__int_u8_la_SOURCES) int_u8.py int_u8.py[co]
## Include the dependency files.  Copied from Automake's generated
## case for C++.
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_int_u8-wrap.Pcc@am__quote@
nodist_python_PYTHON += int_u8.py

124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
## int_u32.
pyexec_LTLIBRARIES += _int_u32.la
nodist__int_u32_la_SOURCES = int_u32-wrap.cc
_int_u32_la_LIBADD = $(AM_LIBADD)
CLEANFILES += $(nodist__int_u32_la_SOURCES) int_u32.py int_u32.py[co]
## Include the dependency files.  Copied from Automake's generated
## case for C++.
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_int_u32-wrap.Pcc@am__quote@
nodist_python_PYTHON += int_u32.py

## neighb2d.
pyexec_LTLIBRARIES += _neighb2d.la
nodist__neighb2d_la_SOURCES = neighb2d-wrap.cc
_neighb2d_la_LIBADD = $(AM_LIBADD)
CLEANFILES += $(nodist__neighb2d_la_SOURCES) neighb2d.py neighb2d.py[co]
## Include the dependency files.  Copied from Automake's generated
## case for C++.
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_neighb2d-wrap.Pcc@am__quote@
nodist_python_PYTHON += neighb2d.py

144
145
146
147
148
149
150
151
152
153
## window2d.
pyexec_LTLIBRARIES += _window2d.la
nodist__window2d_la_SOURCES = window2d-wrap.cc
_window2d_la_LIBADD = $(AM_LIBADD)
CLEANFILES += $(nodist__window2d_la_SOURCES) window2d.py window2d.py[co]
## Include the dependency files.  Copied from Automake's generated
## case for C++.
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_window2d-wrap.Pcc@am__quote@
nodist_python_PYTHON += window2d.py

154
155
156
157
158
159
160
161
162
## image2d_int.
pyexec_LTLIBRARIES += _image2d_int.la
nodist__image2d_int_la_SOURCES = image2d_int-wrap.cc
_image2d_int_la_LIBADD = $(AM_LIBADD)
CLEANFILES += $(nodist__image2d_int_la_SOURCES) image2d_int.py image2d_int.py[co]
## Include the dependency files.  Copied from Automake's generated
## case for C++.
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_image2d_int-wrap.Pcc@am__quote@
nodist_python_PYTHON += image2d_int.py
Roland Levillain's avatar
Roland Levillain committed
163

164
165
166
167
168
169
170
171
172
173
## image2d_int_u8.
pyexec_LTLIBRARIES += _image2d_int_u8.la
nodist__image2d_int_u8_la_SOURCES = image2d_int_u8-wrap.cc
_image2d_int_u8_la_LIBADD = $(AM_LIBADD)
CLEANFILES += $(nodist__image2d_int_u8_la_SOURCES) image2d_int_u8.py image2d_int_u8.py[co]
## Include the dependency files.  Copied from Automake's generated
## case for C++.
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_image2d_int_u8-wrap.Pcc@am__quote@
nodist_python_PYTHON += image2d_int_u8.py

174
175
## dynamic_image2d.
pyexec_LTLIBRARIES += _dynamic_image2d.la
176
177
178
179
180
# Swig also generates a header for this module, since it makes use of
# directors.
nodist__dynamic_image2d_la_SOURCES =		\
  dynamic_image2d-wrap.h			\
  dynamic_image2d-wrap.cc
181
182
183
184
185
186
187
_dynamic_image2d_la_LIBADD = $(AM_LIBADD)
CLEANFILES += $(nodist__dynamic_image2d_la_SOURCES) dynamic_image2d.py dynamic_image2d.py[co]
## Include the dependency files.  Copied from Automake's generated
## case for C++.
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_dynamic_image2d-wrap.Pcc@am__quote@
nodist_python_PYTHON += dynamic_image2d.py

Roland Levillain's avatar
Roland Levillain committed
188

189
190
191
192
193
## ---------------------------- ##
## Swilena Python Shell (sps).  ##
## ---------------------------- ##

# FIXME: We might want to rename this shell as something else.
Roland Levillain's avatar
Roland Levillain committed
194
python_PYTHON += sps.py
195
196
197

# The script to be used in installed distributions.
bin_SCRIPTS = sps
Roland Levillain's avatar
Roland Levillain committed
198
# The script to be used in non-installed build trees.
199
200
201
202
203
noinst_SCRIPTS = sps-local

CLEANFILES += $(bin_SCRIPTS) $(noinst_SCRIPTS)


Roland Levillain's avatar
Roland Levillain committed
204
205
206
207
208
209
210
## ------- ##
## Tests.  ##
## ------- ##

include $(top_srcdir)/swilena/run.mk

## FIXME: Do we really need to pass top_srcdir and top_builddir to run?
211
212
TESTS_ENVIRONMENT = \
  top_srcdir="$(top_srcdir)" top_builddir="$(top_builddir)" $(RUN)
Roland Levillain's avatar
Roland Levillain committed
213
214
215
216
217
218
219
220
221
222
223
224
225
# Ensure `run' is rebuilt before the tests are run.
$(TESTS): $(srcdir)/run.stamp
# The dependency is on `run.in' and not `run', since `run' is
# regenerated at distribution time, and voids the time stamps (which
# we don't want!).
EXTRA_DIST = $(srcdir)/run.stamp
$(srcdir)/run.stamp: $(RUN_IN)
	@rm -f $@
	@rm -f $@.tmp
	@touch $@.tmp
	$(MAKE) $(AM_MAKEFLAGS) $(RUN)
	@mv -f $@.tmp $@

226
227
228
229
230
231
232
# FIXME: We should not use the `.py' extension: it is not needed, and
# it prevents us from using the same name for both a module (wrapper)
# and a test.  Alas, the script `run' expects a file name with an
# extension as argument.  We could improve this by adding options such
# as `--python' to `run'.
TESTS =									\
  box2d-misc.py								\
233
  image2d-misc.py morpho-fun.py morpho-segm.py dynamic-image2d-misc.py
234

Roland Levillain's avatar
Roland Levillain committed
235
EXTRA_DIST += $(TESTS)
236
237
238
239
240
241
242
243
244
245
246
247
248

# Images generated by tests.
CLEANFILES +=					\
  closing.pgm					\
  closing_area.pgm				\
  dilation.pgm					\
  erosion.pgm					\
  gradient.pgm					\
  gradient_external.pgm				\
  gradient_internal.pgm				\
  opening.pgm					\
  opening_area.pgm				\
  segm.pgm