Makefile.am
6.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
## Process this file with automake to produce Makefile.in
# we use srcdir/src for "private" includes
# we use srcdir/include for the static global include files
# we use builddir/src for the generated include files to get found
# Optional instrument specific tests
if WITH_INST_MWL
INST_MWL = test_MWL
INCL_MWL = -I$(top_srcdir)/inst/mwl/include
TEST_MWL = :$(top_srcdir)/inst/mwl/test
test_MWL_SOURCES = $(top_srcdir)/inst/mwl/test/test_MWL.cpp
test_MWL_LDFLAGS = @LDFLAGS@
test_MWL_CPPFLAGS = @CPPFLAGS@
test_MWL_LDADD = $(top_srcdir)/src/libgamma.la
endif
if WITH_INST_CTA
INST_CTA = test_CTA
INCL_CTA = -I$(top_srcdir)/inst/cta/include
TEST_CTA = :$(top_srcdir)/inst/cta/test
test_CTA_SOURCES = $(top_srcdir)/inst/cta/test/test_CTA.cpp
test_CTA_LDFLAGS = @LDFLAGS@
test_CTA_CPPFLAGS = @CPPFLAGS@
test_CTA_LDADD = $(top_srcdir)/src/libgamma.la
endif
if WITH_INST_LAT
INST_LAT = test_LAT
INCL_LAT = -I$(top_srcdir)/inst/lat/include
TEST_LAT = :$(top_srcdir)/inst/lat/test
test_LAT_SOURCES = $(top_srcdir)/inst/lat/test/test_LAT.cpp
test_LAT_LDFLAGS = @LDFLAGS@
test_LAT_CPPFLAGS = @CPPFLAGS@
test_LAT_LDADD = $(top_srcdir)/src/libgamma.la
endif
if WITH_INST_COM
INST_COM = test_COM
INCL_COM = -I$(top_srcdir)/inst/com/include
TEST_COM = :$(top_srcdir)/inst/com/test
test_COM_SOURCES = $(top_srcdir)/inst/com/test/test_COM.cpp
test_COM_LDFLAGS = @LDFLAGS@
test_COM_CPPFLAGS = @CPPFLAGS@
test_COM_LDADD = $(top_srcdir)/src/libgamma.la
endif
# Optional python bindings
if WITH_PYTHON
TEST_PYTHON_SCRIPT = test_python.py
TEST_PYTHON_ENV = PYTHONPATH=$(top_builddir)/pyext:$(top_builddir)/pyext/build/gammalib$(TEST_MWL)$(TEST_CTA)$(TEST_LAT)$(TEST_COM):$(PYTHONPATH)
endif
# Darwin support
MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
@EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET
# Include directories
INCLUDES = -I$(top_srcdir)/include \
-I$(top_builddir)/src \
-I$(top_srcdir)/src/support \
$(INCL_MWL) \
$(INCL_CTA) \
$(INCL_LAT) \
$(INCL_COM)
# Test programs (those will be compiled)
check_PROGRAMS = test_GSupport \
test_GVector \
test_GMatrix \
test_GMatrixSparse \
test_GMatrixSymmetric \
test_GNumerics \
test_GFits \
test_GXml \
test_GVO \
test_GXspec \
test_GApplication \
test_GModel \
test_GSky \
test_GOptimizer \
test_GObservation \
$(INST_MWL) $(INST_CTA) $(INST_LAT) $(INST_COM)
# Set test environment (needed for linking with cfitsio and readline)
TESTS_ENVIRONMENT = @RUNSHARED@=$(top_builddir)/src/.libs$(TEST_ENV_DIR):$(@RUNSHARED@) \
$(TEST_PYTHON_ENV) \
PACKAGE_SOURCE=$(PACKAGE_SOURCE)
# Tests (these are the tests to be executed)
TESTS = test_GSupport \
test_GVector \
test_GMatrix \
test_GMatrixSparse \
test_GMatrixSymmetric \
test_GNumerics \
test_GFits \
test_GXml \
test_GVO \
test_GXspec \
test_GApplication \
test_GModel \
test_GSky \
test_GOptimizer \
test_GObservation \
$(INST_MWL) $(INST_CTA) $(INST_LAT) $(INST_COM) \
$(TEST_PYTHON_SCRIPT)
# Standard test sources and links
test_GSupport_SOURCES = test_GSupport.cpp
test_GSupport_LDFLAGS = @LDFLAGS@
test_GSupport_CPPFLAGS = @CPPFLAGS@
test_GSupport_LDADD = $(top_srcdir)/src/libgamma.la
#
test_GVector_SOURCES = test_GVector.cpp
test_GVector_LDFLAGS = @LDFLAGS@
test_GVector_CPPFLAGS = @CPPFLAGS@
test_GVector_LDADD = $(top_srcdir)/src/libgamma.la
#
test_GMatrix_SOURCES = test_GMatrix.cpp
test_GMatrix_LDFLAGS = @LDFLAGS@
test_GMatrix_CPPFLAGS = @CPPFLAGS@
test_GMatrix_LDADD = $(top_srcdir)/src/libgamma.la
#
test_GMatrixSparse_SOURCES = test_GMatrixSparse.cpp
test_GMatrixSparse_LDFLAGS = @LDFLAGS@
test_GMatrixSparse_CPPFLAGS = @CPPFLAGS@
test_GMatrixSparse_LDADD = $(top_srcdir)/src/libgamma.la
#
test_GMatrixSymmetric_SOURCES = test_GMatrixSymmetric.cpp
test_GMatrixSymmetric_LDFLAGS = @LDFLAGS@
test_GMatrixSymmetric_CPPFLAGS = @CPPFLAGS@
test_GMatrixSymmetric_LDADD = $(top_srcdir)/src/libgamma.la
#
test_GNumerics_SOURCES = test_GNumerics.cpp
test_GNumerics_LDFLAGS = @LDFLAGS@
test_GNumerics_CPPFLAGS = @CPPFLAGS@
test_GNumerics_LDADD = $(top_srcdir)/src/libgamma.la
#
test_GFits_SOURCES = test_GFits.cpp
test_GFits_LDFLAGS = @LDFLAGS@
test_GFits_CPPFLAGS = @CPPFLAGS@
test_GFits_LDADD = $(top_srcdir)/src/libgamma.la
#
test_GXml_SOURCES = test_GXml.cpp
test_GXml_LDFLAGS = @LDFLAGS@
test_GXml_CPPFLAGS = @CPPFLAGS@
test_GXml_LDADD = $(top_srcdir)/src/libgamma.la
#
test_GVO_SOURCES = test_GVO.cpp
test_GVO_LDFLAGS = @LDFLAGS@
test_GVO_CPPFLAGS = @CPPFLAGS@
test_GVO_LDADD = $(top_srcdir)/src/libgamma.la
#
test_GXspec_SOURCES = test_GXspec.cpp
test_GXspec_LDFLAGS = @LDFLAGS@
test_GXspec_CPPFLAGS = @CPPFLAGS@
test_GXspec_LDADD = $(top_srcdir)/src/libgamma.la
#
test_GApplication_SOURCES = test_GApplication.cpp
test_GApplication_LDFLAGS = @LDFLAGS@
test_GApplication_CPPFLAGS = @CPPFLAGS@
test_GApplication_LDADD = $(top_srcdir)/src/libgamma.la
#
test_GModel_SOURCES = test_GModel.cpp
test_GModel_LDFLAGS = @LDFLAGS@
test_GModel_CPPFLAGS = @CPPFLAGS@
test_GModel_LDADD = $(top_srcdir)/src/libgamma.la
#
test_GSky_SOURCES = test_GSky.cpp
test_GSky_LDFLAGS = @LDFLAGS@
test_GSky_CPPFLAGS = @CPPFLAGS@
test_GSky_LDADD = $(top_srcdir)/src/libgamma.la
#
test_GOptimizer_SOURCES = test_GOptimizer.cpp
test_GOptimizer_LDFLAGS = @LDFLAGS@
test_GOptimizer_CPPFLAGS = @CPPFLAGS@
test_GOptimizer_LDADD = $(top_srcdir)/src/libgamma.la
#
test_GObservation_SOURCES = test_GObservation.cpp
test_GObservation_LDFLAGS = @LDFLAGS@
test_GObservation_CPPFLAGS = @CPPFLAGS@
test_GObservation_LDADD = $(top_srcdir)/src/libgamma.la
# Add Valgrind rule
#
valgrind:
@export PACKAGE_SOURCE=$(PACKAGE_SOURCE) ; \
if type valgrind >/dev/null 2>&1; then \
cd .. ; \
ln -s test/data data ; \
mkdir reports ; \
for prog in $(check_PROGRAMS) ; do \
$(SHELL) $(abs_top_builddir)/libtool --mode=execute valgrind --leak-check=full \
--xml=yes --xml-file=tmp.xml --show-reachable=yes test/$$prog; \
sed '/<\/valgrindoutput>/d' tmp.xml > test/valgrind_$$prog.xml; \
echo '</valgrindoutput>' >> test/valgrind_$$prog.xml; \
done ; \
mv reports/* test/reports/ ; \
cd test ; \
else \
echo "valgrind not found in PATH."; \
fi