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