Add gobject performance tests for threaded code
[platform/upstream/glib.git] / tests / gobject / Makefile.am
1 include $(top_srcdir)/Makefile.decl
2
3 INCLUDES =                                      \
4         -I$(top_srcdir)                         \
5         -I$(top_srcdir)/glib                    \
6         -I$(top_srcdir)/gmodule                 \
7         $(GLIB_DEBUG_FLAGS)
8
9 libglib = $(top_builddir)/glib/libglib-2.0.la
10 libgthread = $(top_builddir)/gthread/libgthread-2.0.la
11 libgmodule = $(top_builddir)/gmodule/libgmodule-2.0.la
12 libgobject = $(top_builddir)/gobject/libgobject-2.0.la
13
14 ########################################################################
15
16 noinst_LTLIBRARIES = libtestgobject.la
17
18 libtestgobject_la_SOURCES =     \
19         testcommon.h            \
20         testmarshal.h           \
21         testmarshal.c           \
22         testmodule.c            \
23         testmodule.h
24
25 if CROSS_COMPILING
26   glib_genmarshal=$(GLIB_GENMARSHAL)
27 else
28   glib_genmarshal=$(top_builddir)/gobject/glib-genmarshal
29 endif
30
31 testmarshal.h: stamp-testmarshal.h
32         @true
33 stamp-testmarshal.h: @REBUILD@ testmarshal.list $(glib_genmarshal)
34         $(glib_genmarshal) --prefix=test_marshal $(srcdir)/testmarshal.list --header >> xgen-gmh \
35         && (cmp -s xgen-gmh testmarshal.h 2>/dev/null || cp xgen-gmh testmarshal.h) \
36         && rm -f xgen-gmh xgen-gmh~ \
37         && echo timestamp > $@
38 testmarshal.c: @REBUILD@ testmarshal.list $(glib_genmarshal)
39         $(glib_genmarshal) --prefix=test_marshal $(srcdir)/testmarshal.list --body >> xgen-gmc \
40         && cp xgen-gmc testmarshal.c \
41         && rm -f xgen-gmc xgen-gmc~
42
43 BUILT_SOURCES = testmarshal.h testmarshal.c
44 CLEANFILES = stamp-testmarshal.h
45
46 ########################################################################
47
48 LDADD = libtestgobject.la $(libgobject) 
49
50 test_programs =                                 \
51         deftype                                 \
52         gvalue-test                             \
53         paramspec-test                          \
54         accumulator                             \
55         defaultiface                            \
56         dynamictype                             \
57         ifacecheck                              \
58         ifaceinit                               \
59         ifaceinherit                            \
60         ifaceproperties                         \
61         override                                \
62         performance                             \
63         performance-threaded                    \
64         singleton                               \
65         references
66
67 performance_LDADD = $(libgobject) $(libgthread)
68 performance_threaded_LDADD = $(libgobject) $(libgthread)
69 check_PROGRAMS = $(test_programs)
70
71 TESTS = $(test_programs)
72 TESTS_ENVIRONMENT = srcdir=$(srcdir) \
73         LIBCHARSET_ALIAS_DIR=$(top_builddir)/glib/libcharset \
74         MALLOC_CHECK_=2 \
75         MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256))
76
77 ########################################################################
78
79 EXTRA_DIST +=             \
80         testmarshal.list
81
82 BUILT_EXTRA_DIST =                              \
83         testmarshal.h                           \
84         testmarshal.c
85
86 dist-hook: $(BUILT_EXTRA_DIST)
87         files='$(BUILT_EXTRA_DIST)';                            \
88         for f in $$files; do                                    \
89           if test -f $$f; then d=.; else d=$(srcdir); fi;       \
90           cp $$d/$$f $(distdir) || exit 1; done
91
92 distclean-local:
93         if test $(srcdir) = .; then :; else     \
94             rm -f $(BUILT_EXTRA_DIST);          \
95         fi