source: trunk/test/Makefile.am @ 1822

Revision 1810, 9.4 KB checked in by Freddie Akeroyd, 4 months ago (diff)

Fix MinGW build issues. Refs #325

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1## Process this file with automake to produce Makefile.in
2#====================================================================
3#  NeXus - Neutron & X-ray Common Data Format
4
5#  $Id$
6
7#  Makefile for generating test programs
8#
9#  Copyright (C) 2004 Freddie Akeroyd
10
11#  This library is free software; you can redistribute it and/or
12#  modify it under the terms of the GNU Lesser General Public
13#  License as published by the Free Software Foundation; either
14#  version 2 of the License, or (at your option) any later version.
15#
16#  This library is distributed in the hope that it will be useful,
17#  but WITHOUT ANY WARRANTY; without even the implied warranty of
18#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19#  Lesser General Public License for more details.
20#
21#  You should have received a copy of the GNU Lesser General Public
22#  License along with this library; if not, write to the Free
23#  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24#  MA  02111-1307  USA
25#             
26#  For further information, see <http://www.nexusformat.org>
27#
28#====================================================================
29
30# so   "make test"   is the same as   "make check"
31test: check
32
33LIBNEXUS=$(top_builddir)/src/libNeXus.la
34LIBNEXUS77=$(top_builddir)/bindings/f77/libNeXus77.la
35LIBNEXUS90=$(top_builddir)/bindings/f90/libNeXus90.la
36LIBNEXUSCPP=$(top_builddir)/bindings/cpp/libNeXusCPP.la
37
38AM_CPPFLAGS=-I. -I$(top_srcdir)/include -I$(top_srcdir)/bindings/cpp
39AM_FFLAGS=-I$(top_srcdir)/bindings/f77
40AM_FCFLAGS=-I$(top_builddir)/bindings/f90
41CLEANFILES=NXtest.nx4 NXtest.nx5 NXtest.nxs NXtest.xml NXtest-table.xml \
42        leak_test.nxs leak_test1.nxs leak_test2_*.nxs \
43        nxtranslate nxsummary nxconvert nxvalidate nxdir nxbrowse \
44        NXtest.h4 NXtest.h5 test_unlimited.*
45
46
47## testdir=$(prefix)/nexus/test
48
49HDF4_TARGETS = napi_test-hdf4 napi_test-hdf4-static napi_test_cpp-hdf4
50
51HDF5_TARGETS = napi_test-hdf5 napi_test-hdf5-static napi_test_cpp-hdf5
52
53XML_TARGETS = napi_test-xml napi_test-xml-static \
54                napi_test-xml-table-static \
55                napi_test_cpp-xml napi_test_cpp-xml-table
56
57F77_TARGETS = napif_test-hdf4 napif_test-hdf5
58
59F90_TARGETS = NXtest
60
61if HAVE_CPP
62CPP_TARGETS = leak_test2 leak_test3
63endif
64
65EXTRA_DIST      = testsuite.at $(TESTSUITE_AT) testsuite package.m4 \
66                        NXtest.f90 napif_test.f README.tests \
67                        napi_test.c napif4_test.f napif5_test.f \
68                        setup_test $(srcdir)/data/dmc* \
69                        nxbrowse.txt napi_test_cpp.cxx
70
71TESTSUITE       = $(srcdir)/testsuite
72
73TESTSUITE_AT    = ## dbase.at devices.at starter.at
74
75AUTOTEST        = $(AUTOM4TE) --language=autotest
76
77check_PROGRAMS = run_test skip_test $(HDF4_TARGETS) $(HDF5_TARGETS) $(F77_TARGETS) $(F90_TARGETS) $(XML_TARGETS) $(CPP_TARGETS) leak_test1 test_nxunlimited
78
79#nxtestdir=$(NXTESTDIR)
80#nxtest_PROGRAMS = $(HDF4_TARGETS) $(HDF5_TARGETS) $(F77_TARGETS) $(F90_TARGETS) $(XML_TARGETS) leak_test1 leak_test2 leak_test3
81#nxtest_DATA = README.tests
82
83nxexampledir=$(NXEXAMPLEDIR)
84nxexample_DATA = napi_test.c napif4_test.f napif5_test.f napif_test.f \
85        NXtest.f90 napi_test_cpp.cxx
86
87nxsummary:
88        rm -f $@
89        if test -r ../applications/NXsummary/$@$(EXEEXT); then \
90            ln -s ../applications/NXsummary/$@$(EXEEXT) $@; \
91        fi
92
93nxconvert:
94        rm -f $@
95        ln -s ../applications/NXconvert/$@$(EXEEXT) $@
96
97nxvalidate:
98        rm -f $@
99        ln -s ../applications/NXvalidate/$@ $@
100
101nxbrowse:
102        rm -f $@
103        ln -s ../applications/NXbrowse/$@$(EXEEXT) $@
104
105nxdir:
106        rm -f $@
107        ln -s ../applications/NXdir/$@$(EXEEXT) $@
108
109nxtranslate:
110        rm -f $@
111        if test -r ../applications/NXtranslate/$@$(EXEEXT); then \
112            ln -s ../applications/NXtranslate/$@$(EXEEXT) $@; \
113        fi
114
115# for running tests via   "make check"
116## check_PROGRAMS = $(test_PROGRAMS)    # what to build
117## TESTS = $(test_PROGRAMS)             # what to run
118
119# this sets the test running environment - in case we
120# have got built with shared HDF libraries we need to set LD_LIBRARY_PATH
121TESTS_ENVIRONMENT=env PYTHON=$(PYTHON) IDL_PATH="@abs_top_srcdir@/bindings/idl:<IDL_DEFAULT>" IDL_DLM_PATH="@abs_top_builddir@/bindings/idl:<IDL_DEFAULT>" LD_LIBRARY_PATH=@abs_top_builddir@/src/.libs:@abs_top_builddir@/bindings/cpp/.libs:@abs_top_builddir@/bindings/idl:$${LD_LIBRARY_PATH}:@EXTRA_LD_LIBRARY_PATH@:/usr/local/lib DYLD_LIBRARY_PATH=@abs_top_builddir@/src/.libs:@abs_top_builddir@/bindings/cpp/.libs:@abs_top_builddir@/bindings/idl:$${DYLD_LIBRARY_PATH}:@EXTRA_LD_LIBRARY_PATH@:/usr/local/lib
122
123run_test_SOURCES=run_test.c
124run_test_LDFLAGS=-static $(HDF4_LDFLAGS) $(HDF5_LDFLAGS) $(XML_LDFLAGS) $(LDFLAGS)
125
126skip_test_SOURCES=skip_test.c
127skip_test_LDFLAGS=-static $(HDF4_LDFLAGS) $(HDF5_LDFLAGS) $(XML_LDFLAGS) $(LDFLAGS)
128
129leak_test1_SOURCES=leak_test1.c
130leak_test1_LDADD=$(LIBNEXUS)
131leak_test1_LDFLAGS=-static $(HDF4_LDFLAGS) $(HDF5_LDFLAGS) $(XML_LDFLAGS) $(LDFLAGS)
132
133leak_test2_SOURCES=leak_test2.cxx
134leak_test2_LDADD=$(LIBNEXUS)
135leak_test2_LDFLAGS=-static $(HDF4_LDFLAGS) $(HDF5_LDFLAGS) $(XML_LDFLAGS) $(LDFLAGS)
136
137leak_test3_SOURCES=leak_test3.cxx
138leak_test3_LDADD=$(LIBNEXUS)
139leak_test3_LDFLAGS=-static $(HDF4_LDFLAGS) $(HDF5_LDFLAGS) $(XML_LDFLAGS) $(LDFLAGS)
140
141test_nxunlimited_SOURCES=test_nxunlimited.c
142test_nxunlimited_LDADD=$(LIBNEXUS)
143test_nxunlimited_LDFLAGS=-static $(HDF4_LDFLAGS) $(HDF5_LDFLAGS) $(XML_LDFLAGS) $(LDFLAGS)
144
145if HAVE_XML
146napi_test_xml_SOURCES = napi_test.c
147napi_test_xml_CPPFLAGS = -I$(top_srcdir)/include @XML_CPPFLAGS@
148napi_test_xml_LDADD = $(LIBNEXUS) @XML_LDFLAGS@
149napi_test_xml_static_SOURCES = napi_test.c
150napi_test_xml_static_CPPFLAGS = -I$(top_srcdir)/include @XML_CPPFLAGS@
151napi_test_xml_static_LDADD = $(LIBNEXUS) @XML_LDFLAGS@
152napi_test_xml_static_LDFLAGS = -static $(HDF4_LDFLAGS) $(HDF5_LDFLAGS) $(XML_LDFLAGS) $(LDFLAGS)
153napi_test_xml_table_static_SOURCES = napi_test.c
154napi_test_xml_table_static_CPPFLAGS = -I$(top_srcdir)/include @XML_CPPFLAGS@
155napi_test_xml_table_static_LDADD = $(LIBNEXUS) @XML_LDFLAGS@
156napi_test_xml_table_static_LDFLAGS = -static $(HDF4_LDFLAGS) $(HDF5_LDFLAGS) $(XML_LDFLAGS) $(LDFLAGS)
157napi_test_cpp_xml_SOURCES = napi_test_cpp.cxx
158napi_test_cpp_xml_LDADD = $(LIBNEXUSCPP)
159napi_test_cpp_xml_table_SOURCES = napi_test_cpp.cxx
160napi_test_cpp_xml_table_LDADD = $(LIBNEXUSCPP)
161else
162napi_test_xml_SOURCES = dummy.c
163napi_test_xml_static_SOURCES = dummy.c
164napi_test_xml_table_static_SOURCES = dummy.c
165napi_test_xml_static_LDFLAGS = $(LDFLAGS)
166napi_test_cpp_xml_SOURCES = dummy.c
167napi_test_cpp_xml_table_SOURCES = dummy.c
168endif
169
170if HAVE_HDF4
171napi_test_hdf4_SOURCES = napi_test.c
172napi_test_hdf4_CPPFLAGS = -I$(top_srcdir)/include @HDF4_CPPFLAGS@
173napi_test_hdf4_LDADD = $(LIBNEXUS) @HDF4_LDFLAGS@
174napi_test_hdf4_static_SOURCES = napi_test.c
175napi_test_hdf4_static_CPPFLAGS = -I$(top_srcdir)/include @HDF4_CPPFLAGS@
176napi_test_hdf4_static_LDADD = $(LIBNEXUS) @HDF4_LDFLAGS@
177napi_test_hdf4_static_LDFLAGS = -static $(HDF4_LDFLAGS) $(HDF5_LDFLAGS) $(XML_LDFLAGS) $(LDFLAGS)
178napi_test_cpp_hdf4_SOURCES = napi_test_cpp.cxx
179napi_test_cpp_hdf4_LDADD = $(LIBNEXUSCPP)
180if HAVE_F77
181napif_test_hdf4_SOURCES = napif4_test.f
182napif_test_hdf4_LDADD = $(LIBNEXUS77) # $(FLIBS)
183napif_test_hdf4_LINK = $(F77LINK)
184napif_test_hdf4_LDFLAGS = -static $(HDF4_LDFLAGS) $(HDF5_LDFLAGS) $(XML_LDFLAGS) $(LDFLAGS)
185else
186napif_test_hdf4_SOURCES = dummy.c
187napif_test_hdf4_LINK = $(LINK)
188endif
189else
190napi_test_hdf4_SOURCES = dummy.c
191napi_test_hdf4_static_SOURCES = dummy.c
192napi_test_hdf4_static_LDFLAGS = $(LDFLAGS)
193napif_test_hdf4_SOURCES = dummy.c
194napif_test_hdf4_LINK = $(LINK)
195napi_test_cpp_hdf4_SOURCES = dummy.c
196endif
197
198if HAVE_HDF5
199napi_test_hdf5_SOURCES = napi_test.c
200napi_test_hdf5_CPPFLAGS = -I$(top_srcdir)/include @HDF5_CPPFLAGS@
201napi_test_hdf5_LDADD = $(LIBNEXUS) @HDF5_LDFLAGS@
202napi_test_hdf5_static_SOURCES = napi_test.c
203napi_test_hdf5_static_CPPFLAGS = -I$(top_srcdir)/include @HDF5_CPPFLAGS@
204napi_test_hdf5_static_LDADD = $(LIBNEXUS) @HDF5_LDFLAGS@
205napi_test_hdf5_static_LDFLAGS = -static $(HDF4_LDFLAGS) $(HDF5_LDFLAGS) $(XML_LDFLAGS) $(LDFLAGS)
206napi_test_cpp_hdf5_SOURCES = napi_test_cpp.cxx
207napi_test_cpp_hdf5_LDADD=$(LIBNEXUSCPP)
208if HAVE_F77
209napif_test_hdf5_SOURCES = napif5_test.f
210napif_test_hdf5_LDADD = $(LIBNEXUS77) # $(FLIBS)
211napif_test_hdf5_LINK = $(F77LINK)
212napif_test_hdf5_LDFLAGS = -static $(HDF4_LDFLAGS) $(HDF5_LDFLAGS) $(XML_LDFLAGS) $(LDFLAGS)
213else
214napif_test_hdf5_SOURCES = dummy.c
215napif_test_hdf5_LINK = $(LINK)
216endif
217else
218napi_test_hdf5_SOURCES = dummy.c
219napi_test_hdf5_static_SOURCES = dummy.c
220napi_test_hdf5_static_LDFLAGS = $(LDFLAGS)
221napif_test_hdf5_SOURCES = dummy.c
222napif_test_hdf5_LINK = $(LINK)
223napi_test_cpp_hdf5_SOURCES = dummy.c
224endif
225
226if HAVE_F90
227NXtest_SOURCES = NXtest.f90
228NXtest_LDADD = $(LIBNEXUS90)
229NXtest_LINK = $(FCLINK)
230NXtest_LDFLAGS = -static $(HDF4_LDFLAGS) $(HDF5_LDFLAGS) $(XML_LDFLAGS) $(LDFLAGS)
231else
232NXtest_SOURCES = dummy.c
233NXtest_LINK = $(LINK)
234endif
235
236include $(top_srcdir)/build_rules.am
237
238$(srcdir)/package.m4:   $(top_srcdir)/configure.ac
239        {\
240                echo '# Signature of the current package.'; \
241                echo 'm4_define([AT_PACKAGE_NAME],      [@PACKAGE_NAME@])'; \
242                echo 'm4_define([AT_PACKAGE_TARNAME],   [@PACKAGE_TARNAME@])'; \
243                echo 'm4_define([AT_PACKAGE_VERSION],   [@PACKAGE_VERSION@])'; \
244                echo 'm4_define([AT_PACKAGE_STRING],    [@PACKAGE_STRING@])'; \
245                echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
246        } > $(srcdir)/package.m4
247
248check-local: atconfig atlocal nxconvert nxvalidate nxsummary nxdir nxbrowse nxtranslate $(TESTSUITE)
249        $(TESTS_ENVIRONMENT) $(SHELL) $(TESTSUITE)
250
251$(TESTSUITE):   $(srcdir)/testsuite.at $(TESTSUITE_AT) $(srcdir)/package.m4
252        $(AUTOTEST) -I $(srcdir) $@.at -o $@.tmp
253        mv $@.tmp $@
254
255atconfig:       $(top_builddir)/config.status
256        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
257
258clean-local:
259        -$(SHELL) $(TESTSUITE) --clean
260
261
262DISTCLEANFILES = atconfig
Note: See TracBrowser for help on using the repository browser.