## Process this file with automake to produce Makefile.in

##   This file is part of the UVES Pipeline Library
##   Copyright (C) 2002,2003 European Southern Observatory

##   This library 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; either version 2 of the License, or
##   (at your option) any later version.

##   This program 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 this program; if not, write to the Free Software
##   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

AUTOMAKE_OPTIONS = 1.6 foreign

DISTCLEANFILES = *~


if MAINTAINER_MODE

MAINTAINERCLEANFILES = Makefile.in

endif

AM_CPPFLAGS = $(all_includes)

LDADD = $(LIBUVES) $(LIBFLAMES) $(LIBCPLUI) $(LIBCPLCORE) $(LIBCEXT) $(LIBCFITSIO)
LDFLAGS = $(CPL_LDFLAGS)

pkginclude_HEADERS =

noinst_HEADERS = uves_test_simulate.h

LIBSIMULATE = libsimulate.la
noinst_LTLIBRARIES = $(LIBSIMULATE)
libsimulate_la_SOURCES =  uves_test_simulate.c
libsimulate_la_LIBADD = $(LIBUVES)
libsimulate_la_DEPENDENCIES = $(LIBUVES)

check_PROGRAMS = uves_wavecal-test           \
                 uves_propertylist-test      \
                 uves-test                   \
                 uves_utils-test             \
                 uves_response-test          \
                 uves_dfs-test               \
                 uves_polynomial-test        \
                 uves_qclog-test             \
                 uves_corrbadpix-test        \
                 uves_cd_align-test          \
                 uves_extract-test           \
                 cpl_propertylist-test      

uves_test_SOURCES = uves-test.c
uves_test_DEPENDENCIES = $(LIBUVES)

uves_utils_test_SOURCES = uves_utils-test.c
uves_utils_test_DEPENDENCIES = $(LIBUVES)

uves_extract_test_SOURCES = uves_extract-test.c
uves_extract_test_DEPENDENCIES = $(LIBUVES) $(LIBSIMULATE)
uves_extract_test_LDADD = $(LIBUVES) $(LIBSIMULATE)

uves_response_test_SOURCES = uves_response-test.c
uves_response_test_DEPENDENCIES = $(LIBUVES)

uves_dfs_test_SOURCES = uves_dfs-test.c
uves_dfs_test_DEPENDENCIES = $(LIBUVES) $(LIBSIMULATE)
uves_dfs_test_LDADD = $(LIBUVES) $(LIBSIMULATE)

uves_polynomial_test_SOURCES = uves_polynomial-test.c
uves_polynomial_test_DEPENDENCIES = $(LIBUVES)

uves_qclog_test_SOURCES = uves_qclog-test.c
uves_qclog_test_DEPENDENCIES = $(LIBUVES)

uves_corrbadpix_test_SOURCES = uves_corrbadpix-test.c
uves_corrbadpix_test_DEPENDENCIES = $(LIBUVES)

uves_cd_align_test_SOURCES = uves_cd_align-test.c
uves_cd_align_test_DEPENDENCIES = $(LIBUVES)

uves_wavecal_test_SOURCES = uves_wavecal-test.c
uves_wavecal_test_DEPENDENCIES = $(LIBUVES)

uves_propertylist_test_SOURCES = uves_propertylist-test.c
uves_propertylist_test_DEPENDENCIES = $(LIBUVES)

cpl_propertylist_test_SOURCES = cpl_propertylist-test.c
cpl_propertylist_test_DEPENDENCIES = $(LIBUVES)


TESTS          = $(check_PROGRAMS)
#TESTS          = uves_polynomial-test

# Expected failures
# XFAIL_TESTS =

# Be sure to reexport important environment variables.
TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
        CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
        LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
        OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" \
        MALLOC_PERTURB_=227 MALLOC_CHECK_=2

# We need to remove any files that the above tests created.
clean-local: 
	 $(RM) *.fits *.tfits *.log

if PURIFY
include $(top_builddir)/Makefile.purify
endif
