16854ff9333ae5ad0201de502582823a8a166608
[gedcom-parse.git] / t / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2 # $Id$
3 # $Name$
4
5 SUBDIRS=input
6 INCLUDES = -DPKGDATADIR=\"$(pkgdatadir)\" -I $(srcdir)/../include \
7            -I $(srcdir)/../utf8
8 CFLAGS   = -g -O2
9
10 noinst_PROGRAMS = testgedcom pathtest gomtest @EXTRA_PROGS@
11 EXTRA_PROGRAMS  = gomtest_static
12
13 testgedcom_SOURCES = standalone.c
14 testgedcom_LDFLAGS = -L ../gedcom/.libs -lgedcom
15 testgedcom_LDADD  = @INTLLIBS@ ../utf8/libutf8.la
16
17 pathtest_SOURCES = pathtest.c
18 pathtest_LDFLAGS = -L ../gedcom/.libs -lgedcom
19
20 gomtest_SOURCES = gomtest.c
21 gomtest_LDFLAGS = -L ../gedcom/.libs -L ../gom/.libs -lgedcom_gom -lgedcom
22
23 gomtest_static_SOURCES = gomtest.c
24 gomtest_static_LDADD = ../gedcom/.libs/libgedcom.a ../gom/.libs/libgedcom_gom.a
25 DMALLOC_LOG = dmalloc.log
26
27 TEST_SCRIPT=test_script test_gom
28 TESTS := $(wildcard $(srcdir)/*.test)
29
30 EXTRA_DIST=$(TEST_SCRIPT) $(TESTS)
31
32 all-local:
33         @rm -f testgedcom.out $(DMALLOC_LOG)
34
35 check-% :       %.test all-local
36         @srcdir=$(srcdir); export srcdir; \
37         if $(TESTS_ENVIRONMENT) ./$<; then \
38           echo "Test succeeded"; \
39         else \
40           echo "Test failed"; \
41         fi
42
43 check-dmalloc-%:        %.test all-local
44         @if [ "@EXTRA_PROGS@" = "" ]; then \
45           echo "Please run './configure --with-dmalloc' first"; \
46           exit; \
47         fi; \
48         srcdir=$(srcdir); export srcdir; \
49         GOM_DMALLOC_TEST=$(DMALLOC_LOG); export GOM_DMALLOC_TEST; \
50         if $(TESTS_ENVIRONMENT) ./$<; then \
51           echo "Test succeeded"; \
52         else \
53           echo "Test failed"; \
54         fi
55