common,core: added top-level convenience include files.
[profile/ivi/murphy.git] / src / Makefile.am
1 SUBDIRS         = . murphy-db common/tests core/tests daemon/tests
2 AM_CFLAGS       = $(WARNING_CFLAGS) -I$(top_builddir) -DLIBDIR=\"@LIBDIR@\"
3 MURPHY_CFLAGS   = 
4 pkgconfigdir    = ${libdir}/pkgconfig
5
6 bin_PROGRAMS    =
7 lib_LTLIBRARIES =
8 pkgconfig_DATA  =
9 EXTRA_DIST      =
10
11
12 ###################################
13 # murphy common library
14 #
15
16 lib_LTLIBRARIES += libmurphy-common.la
17 EXTRA_DIST      += common/murphy-common.pc
18 pkgconfig_DATA  += common/murphy-common.pc
19
20
21 libmurphy_commonh_ladir      =          \
22                 $(includedir)/murphy
23
24 libmurphy_commonh_la_HEADERS =          \
25                 common.h
26
27 libmurphy_common_ladir      =           \
28                 $(includedir)/murphy/common
29
30 libmurphy_common_la_HEADERS =           \
31                 common/macros.h         \
32                 common/list.h           \
33                 common/log.h            \
34                 common/mm.h             \
35                 common/hashtbl.h        \
36                 common/mainloop.h       \
37                 common/utils.h          \
38                 common/file-utils.h
39
40 libmurphy_common_la_SOURCES =           \
41                 common/log.c            \
42                 common/mm.c             \
43                 common/hashtbl.c        \
44                 common/mainloop.c       \
45                 common/utils.c          \
46                 common/file-utils.c
47
48 libmurphy_common_la_CFLAGS  =           \
49                 $(AM_CFLAGS)
50
51 libmurphy_common_la_LDFLAGS =           \
52                 -Wl,-version-script=linker-script.common \
53                 -version-info @MURPHY_VERSION_INFO@
54
55 libmurphy_common_la_LIBADD  =           \
56                 -lrt
57
58 libmurphy_common_la_DEPENDENCIES = linker-script.common
59
60 libcommonincludedir      = $(includedir)/murphy/common
61 libcommoninclude_HEADERS = $(libmurphy_common_la_HEADERS)
62
63 # linker script generation
64 linker-script.common: $(libmurphy_common_la_HEADERS)
65         $(top_builddir)/build-aux/gen-linker-script -o $@ $^
66
67 clean-linker-script::
68         -rm -f linker-script.common
69
70 ###################################
71 # murphy core library
72 #
73
74 lib_LTLIBRARIES += libmurphy-core.la
75 EXTRA_DIST      += core/murphy-core.pc
76 pkgconfig_DATA  += core/murphy-core.pc
77
78 libmurphy_coreh_ladir      =            \
79                 $(includedir)/murphy
80
81 libmurphy_coreh_la_HEADERS =            \
82                 core.h
83
84 libmurphy_core_ladir      =             \
85                 $(includedir)/murphy/core
86
87 libmurphy_core_la_HEADERS =             \
88                 core/context.h          \
89                 core/plugin.h
90
91 libmurphy_core_la_SOURCES =             \
92                 core/context.c          \
93                 core/plugin.c
94
95 libmurphy_core_la_CFLAGS  =             \
96                 $(AM_CFLAGS)
97
98 libmurphy_core_la_LDFLAGS =             \
99                 -Wl,-version-script=linker-script.core \
100                 -version-info @MURPHY_VERSION_INFO@
101
102 libmurphy_core_la_LIBADD  =     \
103                 libmurphy-common.la -ldl
104
105 libmurphy_core_la_DEPENDENCIES = linker-script.core
106
107 # core linker script generation
108 linker-script.core: $(libmurphy_core_la_HEADERS)
109         $(top_builddir)/build-aux/gen-linker-script -o $@ $^
110
111 clean-linker-script::
112         -rm -f linker-script.core
113
114 ###################################
115 # murphy plugins
116 #
117
118 BUILTIN_PLUGINS    =
119 BUILTIN_CFLAGS     = -D__MURPHY_BUILTIN_PLUGIN__ $(AM_CFLAGS)
120 BUILTIN_LIBS       =
121
122 plugin_LTLIBRARIES = 
123 plugindir          = $(libdir)/murphy/plugins
124
125
126 # test plugin
127 TEST_PLUGIN_SOURCES = plugins/plugin-test.c
128 TEST_PLUGIN_CFLAGS  =
129 TEST_PLUGIN_LIBS    =
130
131 if BUILTIN_PLUGIN_TEST
132 BUILTIN_PLUGINS += $(TEST_PLUGIN_SOURCES)
133 BUILTIN_CFLAGS  += $(TEST_PLUGIN_CFLAGS)
134 BUILTIN_LIBS    += $(TEST_PLUGIN_LIBS)
135 else
136 plugin_test_la_SOURCES = $(TEST_PLUGIN_SOURCES)
137 plugin_test_la_CFLAGS  = $(TEST_PLUGIN_CFLAGS) $(MURPHY_CFLAGS) $(AM_CFLAGS)
138 plugin_test_la_LDFLAGS = -module -avoid-version
139 plugin_test_la_LIBADD  = $(TEST_PLUGIN_LIBS)
140
141 plugin_LTLIBRARIES    += plugin-test.la
142 endif
143
144 # dbus plugin
145 DBUS_PLUGIN_SOURCES = plugins/plugin-dbus.c
146 DBUS_PLUGIN_CFLAGS  = $(DBUS_CFLAGS)
147 DBUS_PLUGIN_LIBS    = $(DBUS_LIBS)
148
149 if BUILTIN_PLUGIN_DBUS
150 BUILTIN_PLUGINS += $(DBUS_PLUGIN_SOURCES)
151 BUILTIN_CFLAGS  += $(DBUS_PLUGIN_CFLAGS)
152 BUILTIN_LIBS    += $(DBUS_PLUGIN_LIBS)
153 else
154 plugin_dbus_la_SOURCES = $(DBUS_PLUGIN_SOURCES)
155 plugin_dbus_la_CFLAGS  = $(DBUS_PLUGIN_CFLAGS) $(MURPHY_CFLAGS) $(AM_CFLAGS)
156 plugin_dbus_la_LDFLAGS = -module -avoid-version
157 plugin_dbus_la_LIBADD  = $(DBUS_PLUGIN_LIBS)
158
159 plugin_LTLIBRARIES    += plugin-dbus.la
160 endif
161
162 # glib plugin
163 GLIB_PLUGIN_SOURCES = plugins/plugin-glib.c
164 GLIB_PLUGIN_CFLAGS  = $(GLIB_CFLAGS)
165 GLIB_PLUGIN_LIBS    = $(GLIB_LIBS)
166
167 if BUILTIN_PLUGIN_GLIB
168 BUILTIN_PLUGINS += $(GLIB_PLUGIN_SOURCES)
169 BUILTIN_CFLAGS  += $(GLIB_PLUGIN_CFLAGS)
170 BUILTIN_LIBS    += $(GLIB_PLUGIN_LIBS)
171 else
172 plugin_glib_la_SOURCES = $(GLIB_PLUGIN_SOURCES)
173 plugin_glib_la_CFLAGS  = $(GLIB_PLUGIN_CFLAGS) $(MURPHY_CFLAGS) $(AM_CFLAGS)
174 plugin_glib_la_LDFLAGS = -module -avoid-version
175 plugin_glib_la_LIBADD  = $(GLIB_PLUGIN_LIBS)
176
177 plugin_LTLIBRARIES    += plugin-glib.la
178 endif
179
180
181 ###################################
182 # murphy daemon
183 #
184
185 bin_PROGRAMS += murphyd
186
187 murphyd_SOURCES =                       \
188                 daemon/daemon.c         \
189                 daemon/config.c         \
190                 $(BUILTIN_PLUGINS)
191
192 murphyd_CFLAGS  =                       \
193                 $(AM_CFLAGS)            \
194                 $(BUILTIN_CFLAGS)
195
196 murphyd_LDADD  =                        \
197                 libmurphy-core.la       \
198                 libmurphy-common.la     \
199                 $(BUILTIN_LIBS)
200
201 murphyd_LDFLAGS = -rdynamic
202
203
204 # cleanup
205 clean-local:: clean-linker-script
206         -rm -f *~