New directory, framework for automated GObject tests.
[platform/upstream/glib.git] / tests / gobject / Makefile.am
1 INCLUDES =                                      \
2         -I$(top_srcdir)                         \
3         -I$(top_srcdir)/glib                    \
4         -I$(top_srcdir)/gmodule                 \
5         $(GLIB_DEBUG_FLAGS)
6
7 libglib = $(top_builddir)/glib/libglib-2.0.la
8 libgthread = $(top_builddir)/gthread/libgthread-2.0.la
9 libgmodule = $(top_builddir)/gmodule/libgmodule-2.0.la
10 libgobject = $(top_builddir)/gobject/libgobject-2.0.la
11
12 ########################################################################
13
14 noinst_LTLIBRARIES = libtestgobject.la
15
16 libtestgobject_la_SOURCES =     \
17         testcommon.h            \
18         testmarshal.h           \
19         testmarshal.c
20
21 if CROSS_COMPILING
22   glib_genmarshal=$(GLIB_GENMARSHAL)
23 else
24   glib_genmarshal=$(top_builddir)/gobject/glib-genmarshal
25 endif
26
27 testmarshal.h: stamp-testmarshal.h
28         @true
29 stamp-testmarshal.h: @REBUILD@ testmarshal.list $(glib_genmarshal)
30         $(glib_genmarshal) --prefix=test_marshal $(srcdir)/testmarshal.list --header >> xgen-gmh \
31         && (cmp -s xgen-gmh testmarshal.h 2>/dev/null || cp xgen-gmh testmarshal.h) \
32         && rm -f xgen-gmh xgen-gmh~ \
33         && echo timestamp > $@
34 testmarshal.c: @REBUILD@ testmarshal.list $(glib_genmarshal)
35         $(glib_genmarshal) --prefix=test_marshal $(srcdir)/testmarshal.list --body >> xgen-gmc \
36         && cp xgen-gmc testmarshal.c \
37         && rm -f xgen-gmc xgen-gmc~
38
39 BUILT_SOURCES = testmarshal.h testmarshal.c
40
41 ########################################################################
42
43 LDADD = $(libgobject) libtestgobject.la
44
45 test_programs =                                 \
46         accumulator                             \
47         ifaceinit                               \
48         override
49
50 check_PROGRAMS = $(test_programs)
51
52 TESTS = $(test_programs)
53 TESTS_ENVIRONMENT = srcdir=$(srcdir) \
54         LIBCHARSET_ALIAS_DIR=$(top_builddir)/glib/libcharset
55
56 ########################################################################
57
58 BUILT_EXTRA_DIST =                              \
59         testmarshal.h                           \
60         testmarshal.c
61
62 dist-hook: $(BUILT_EXTRA_DIST)                                  \
63         files='$(BUILT_EXTRA_DIST)';                            \
64         for f in $$files; do                                    \
65           if test -f $$f; then d=.; else d=$(srcdir); fi;       \
66           cp $$d/$$f $(distdir) || exit 1; done
67
68 distclean-local:                                \
69         if test $(srcdir) = .; then :; else     \
70             rm -f $(BUILT_EXTRA_DIST);          \
71         fi