390f41af823f726055bae1b3bdecc9bede42385a
[platform/upstream/glib.git] / gobject / tests / Makefile.am
1 include $(top_srcdir)/Makefile.decl
2 NULL =
3
4 AM_CPPFLAGS =                                   \
5         -g                                      \
6         -DG_LOG_DOMAIN=\"GLib-GObject\"         \
7         $(gobject_INCLUDES)                     \
8         $(GLIB_DEBUG_FLAGS)
9
10 AM_CFLAGS = $(GLIB_WARN_CFLAGS)
11
12 if CROSS_COMPILING
13   glib_genmarshal=$(GLIB_GENMARSHAL)
14 else
15   glib_genmarshal=$(top_builddir)/gobject/glib-genmarshal
16 endif
17
18 noinst_PROGRAMS  = $(TEST_PROGS)
19 LDADD = ../libgobject-2.0.la $(top_builddir)/gthread/libgthread-2.0.la $(top_builddir)/glib/libglib-2.0.la
20
21 TEST_PROGS +=           \
22         qdata           \
23         boxed           \
24         enums           \
25         param           \
26         signals         \
27         threadtests     \
28         dynamictests    \
29         binding         \
30         properties      \
31         reference       \
32         ifaceproperties \
33         valuearray      \
34         type            \
35         $(NULL)
36
37 signals_SOURCES = signals.c marshalers.c
38
39 marshalers.h: Makefile.am marshalers.list
40         $(AM_V_GEN) $(glib_genmarshal) --prefix=test $(srcdir)/marshalers.list --header --valist-marshallers > marshalers.h
41
42 marshalers.c: Makefile.am marshalers.list
43         $(AM_V_GEN) (echo "#include \"marshalers.h\""; $(glib_genmarshal) --prefix=test $(srcdir)/marshalers.list --body --valist-marshallers) > $@.tmp && mv $@.tmp $@
44
45 BUILT_SOURCES = marshalers.h marshalers.c
46 CLEANFILES = marshalers.h marshalers.c
47
48 ifaceproperties_SOURCES = ifaceproperties.c testcommon.h
49
50 EXTRA_DIST += marshalers.list
51
52 if BUILDOPT_INSTALL_TESTS
53 insttestdir = $(pkglibexecdir)/installed-tests
54 insttest_PROGRAMS = $(TEST_PROGS)
55
56 testmetadir = $(datadir)/installed-tests/$(PACKAGE)
57 testmeta_DATA = $(TEST_PROGS:=.test)
58
59 %.test: %$(EXEEXT) Makefile
60         $(AM_V_GEN) (echo '[Test]' > $@.tmp; \
61          echo 'Type=session' >> $@.tmp; \
62          echo 'Exec=env G_TEST_DATA=$(pkglibexecdir)/installed-tests $(pkglibexecdir)/installed-tests/$<' >> $@.tmp; \
63          mv $@.tmp $@)
64
65
66 endif