system-controller: fix message types in printouts
[profile/ivi/murphy.git] / src / Makefile.am
1 SUBDIRS         = murphy-db . \
2                   common/tests breedline/tests core/tests \
3                   core/lua-decision/tests resolver/tests \
4                   daemon/tests  plugins/tests
5
6 AM_CFLAGS       = $(WARNING_CFLAGS) $(AM_CPPFLAGS) \
7                   -DSYSCONFDIR=\"@SYSCONFDIR@\" -DLIBDIR=\"@LIBDIR@\"
8 MURPHY_CFLAGS   =
9 pkgconfigdir    = ${libdir}/pkgconfig
10
11 bin_PROGRAMS    =
12 lib_LTLIBRARIES =
13 pkgconfig_DATA  =
14 EXTRA_DIST      =
15
16 QUIET_GEN      = $(Q:@=@echo '  GEN   '$@;)
17
18 LEXCOMPILE      = $(LEX) $(LFLAGS) $(AM_LFLAGS)
19 YACCCOMPILE     = $(YACC) $(YFLAGS) $(AM_YFLAGS)
20
21 AM_CPPFLAGS     = -I$(top_builddir) -I$(top_builddir)/src \
22                   -I$(top_builddir)/src/murphy-db/include
23 BUILT_SOURCES   =
24
25 ###################################
26 # murphy common library
27 #
28
29 lib_LTLIBRARIES += libmurphy-common.la
30 EXTRA_DIST      += common/murphy-common.pc
31 pkgconfig_DATA  += common/murphy-common.pc
32
33
34 libmurphy_commonh_ladir      =          \
35                 $(includedir)/murphy
36
37 libmurphy_commonh_la_HEADERS =          \
38                 common.h                \
39                 config.h
40
41 libmurphy_common_ladir      =           \
42                 $(includedir)/murphy/common
43
44 libmurphy_common_la_HEADERS =           \
45                 common/macros.h         \
46                 common/list.h           \
47                 common/log.h            \
48                 common/debug.h          \
49                 common/debug-info.h     \
50                 common/env.h            \
51                 common/mm.h             \
52                 common/hashtbl.h        \
53                 common/process.h        \
54                 common/mainloop.h       \
55                 common/utils.h          \
56                 common/file-utils.h     \
57                 common/socket-utils.h   \
58                 common/msg.h            \
59                 common/refcnt.h         \
60                 common/fragbuf.h        \
61                 common/json.h           \
62                 common/transport.h      \
63                 common/tlv.h            \
64                 common/native-types.h   \
65                 common/mask.h
66
67 libmurphy_common_la_REGULAR_SOURCES =           \
68                 common/log.c                    \
69                 common/debug.c                  \
70                 common/env.c                    \
71                 common/mm.c                     \
72                 common/hashtbl.c                \
73                 common/mainloop.c               \
74                 common/utils.c                  \
75                 common/file-utils.c             \
76                 common/socket-utils.c           \
77                 common/process.c                \
78                 common/msg.c                    \
79                 common/fragbuf.c                \
80                 common/json.c                   \
81                 common/transport.c              \
82                 common/stream-transport.c       \
83                 common/internal-transport.c     \
84                 common/dgram-transport.c        \
85                 common/tlv.c                    \
86                 common/native-types.c
87
88 libmurphy_common_la_SOURCES =                           \
89                 $(libmurphy_common_la_REGULAR_SOURCES)
90
91 libmurphy_common_la_CFLAGS  =           \
92                 $(AM_CFLAGS)            \
93                 $(JSON_CFLAGS)
94
95 libmurphy_common_la_LDFLAGS =                                   \
96                 -Wl,-version-script=linker-script.common        \
97                 -version-info @MURPHY_VERSION_INFO@
98
99 libmurphy_common_la_LIBADD  =           \
100                 $(JSON_LIBS)            \
101                 -lrt
102
103 libmurphy_common_la_DEPENDENCIES =      \
104                 linker-script.common    \
105                 $(filter %.la, $(libmurphy_common_la_LIBADD))
106
107 libcommonincludedir      = $(includedir)/murphy/common
108 libcommoninclude_HEADERS = $(libmurphy_common_la_HEADERS)
109
110 if WEBSOCKETS_ENABLED
111 libmurphy_common_la_HEADERS +=                  \
112                 common/websocklib.h             \
113                 common/websocket.h
114
115 libmurphy_common_la_REGULAR_SOURCES +=          \
116                 common/websocklib.c             \
117                 common/websocket.c              \
118                 common/wsck-transport.c
119
120 libmurphy_common_la_CFLAGS +=                   \
121                 $(WEBSOCKETS_CFLAGS)
122
123 libmurphy_common_la_LIBADD +=                   \
124                 $(WEBSOCKETS_LIBS)
125
126 EXTRA_DIST     += $(webconsole_DATA);
127 webconsoledir   = $(datadir)/murphy/webconsole
128 webconsole_DATA =                               \
129                 plugins/console/console.js      \
130                 plugins/console/console.html
131 endif
132
133
134 # linker script generation
135 linker-script.common: $(libmurphy_common_la_HEADERS)
136         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
137                 -P "$(CC)" -c "$(libmurphy_common_la_CFLAGS)" -o $@ $^
138
139 clean-linker-script::
140         -rm -f linker-script.common
141
142 ###################################
143 # murphy lua utilities
144 #
145
146 lib_LTLIBRARIES += libmurphy-lua-utils.la
147 EXTRA_DIST      += core/lua-utils/murphy-lua-utils.pc
148 pkgconfig_DATA  += core/lua-utils/murphy-lua-utils.pc
149
150 libmurphy_lua_utils_ladir =                                     \
151                 $(includedir)/murphy/core/lua-utils
152
153 libmurphy_lua_utils_la_HEADERS =                                \
154                 core/lua-utils/lua-utils.h                      \
155                 core/lua-utils/strarray.h                       \
156                 core/lua-utils/funcbridge.h                     \
157                 core/lua-utils/object.h                         \
158                 core/lua-utils/error.h                          \
159                 core/lua-utils/include.h
160
161 libmurphy_lua_utils_la_REGULAR_SOURCES =                        \
162                 core/lua-utils/lua-utils.c                      \
163                 core/lua-utils/strarray.c                       \
164                 core/lua-utils/funcbridge.c                     \
165                 core/lua-utils/object.c                         \
166                 core/lua-utils/error.c                          \
167                 core/lua-utils/include.c
168
169 libmurphy_lua_utils_la_SOURCES =                                \
170                 $(libmurphy_lua_utils_la_REGULAR_SOURCES)
171
172 libmurphy_lua_utils_la_CFLAGS =                                 \
173                 $(AM_CFLAGS)                                    \
174                 $(LUA_CFLAGS)
175
176 libmurphy_lua_utils_la_LDFLAGS =                                \
177                 -Wl,-version-script=linker-script.lua-utils     \
178                 -version-info @MURPHY_VERSION_INFO@
179
180 libmurphy_lua_utils_la_LIBADD =                                 \
181                 libmurphy-common.la                             \
182                 $(LUA_LIBS)
183
184 libmurphy_lua_utils_la_DEPENDENCIES =                           \
185                 linker-script.lua-utils                         \
186                 $(filter %.la, $(libmurphy_lua_utils_la_LIBADD))
187
188 # lua-utils linker script generation
189 linker-script.lua-utils: $(libmurphy_lua_utils_la_HEADERS)
190         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
191                 -P "$(CC)" -c "$(libmurphy_lua_utils_la_CFLAGS)" -o $@ $^
192
193 clean-linker-script::
194         -rm -f linker-script.lua-utils
195
196 ###################################
197 # murphy lua decision network
198 #
199
200 lib_LTLIBRARIES += libmurphy-lua-decision.la
201 EXTRA_DIST      += core/lua-decision/murphy-lua-decision.pc
202 pkgconfig_DATA  += core/lua-decision/murphy-lua-decision.pc
203
204 libmurphy_lua_decision_ladir =                                  \
205                 $(includedir)/murphy/core/lua-decision
206
207 libmurphy_lua_decision_la_HEADERS =                             \
208                 core/lua-decision/mdb.h                         \
209                 core/lua-decision/element.h
210
211 libmurphy_lua_decision_la_REGULAR_SOURCES =                     \
212                 core/lua-decision/mdb.c                         \
213                 core/lua-decision/element.c
214
215 libmurphy_lua_decision_la_SOURCES =                             \
216                 $(libmurphy_lua_decision_la_REGULAR_SOURCES)
217
218 libmurphy_lua_decision_la_CFLAGS =                              \
219                 $(AM_CFLAGS)                                    \
220                 $(LUA_CFLAGS)
221
222 libmurphy_lua_decision_la_LDFLAGS =                             \
223                 -Wl,-version-script=linker-script.lua-decision  \
224                 -version-info @MURPHY_VERSION_INFO@
225
226 libmurphy_lua_decision_la_LIBADD =      \
227                 libmurphy-common.la     \
228                 libmurphy-lua-utils.la  \
229                 murphy-db/mql/libmql.la \
230                 murphy-db/mqi/libmqi.la \
231                 murphy-db/mdb/libmdb.la \
232                 $(LUA_LIBS)
233
234 libmurphy_lua_decision_la_DEPENDENCIES =        \
235                 linker-script.lua-decision      \
236                 $(filter %.la, $(libmurphy_lua_decision_la_LIBADD))
237
238 # lua-decision linker script generation
239 linker-script.lua-decision: $(libmurphy_lua_decision_la_HEADERS)
240         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
241                 -P "$(CC)" -c "$(libmurphy_lua_decision_la_CFLAGS)" -o $@ $^
242
243 clean-linker-script::
244         -rm -f linker-script.lua-decision
245
246 ###################################
247 # murphy core library
248 #
249
250 lib_LTLIBRARIES += libmurphy-core.la
251 EXTRA_DIST      += core/murphy-core.pc
252 pkgconfig_DATA  += core/murphy-core.pc
253
254 LUA_BINDINGS_SOURCES =                                  \
255                 core/lua-bindings/lua-murphy.c          \
256                 core/lua-bindings/lua-lua.c             \
257                 core/lua-bindings/lua-plugin.c          \
258                 core/lua-bindings/lua-log.c             \
259                 core/lua-bindings/lua-console.c         \
260                 core/lua-bindings/lua-bitwise.c         \
261                 core/lua-bindings/lua-json.c            \
262                 core/lua-bindings/lua-timer.c           \
263                 core/lua-bindings/lua-event.c           \
264                 core/lua-bindings/lua-deferred.c        \
265                 core/lua-bindings/lua-sighandler.c      \
266                 core/lua-bindings/lua-transport.c       \
267                 core/lua-bindings/lua-env.c
268
269 libmurphy_core_lua_bindings_ladir =                     \
270                 $(includedir)/murphy/core/lua-bindings
271
272 libmurphy_core_lua_bindings_la_HEADERS =                \
273                 core/lua-bindings/murphy.h              \
274                 core/lua-bindings/lua-json.h
275
276 libmurphy_coreh_ladir      =            \
277                 $(includedir)/murphy
278
279 libmurphy_coreh_la_HEADERS =            \
280                 core.h
281
282 libmurphy_core_ladir =                  \
283                 $(includedir)/murphy/core
284
285 libmurphy_core_la_HEADERS =             \
286                 core/context.h          \
287                 core/plugin.h           \
288                 core/console-command.h  \
289                 core/console.h          \
290                 core/scripting.h        \
291                 core/method.h           \
292                 core/auth.h             \
293                 core/domain.h           \
294                 core/domain-types.h
295
296 libmurphy_core_la_REGULAR_SOURCES =     \
297                 core/context.c          \
298                 core/plugin.c           \
299                 core/console.c          \
300                 core/scripting.c        \
301                 core/method.c           \
302                 core/auth.c             \
303                 core/auth-deny.c        \
304                 core/domain.c           \
305                 $(LUA_BINDINGS_SOURCES)
306
307 if SMACK_ENABLED
308 libmurphy_core_la_REGULAR_SOURCES +=    \
309                 core/auth-smack.c
310 endif
311
312 libmurphy_core_la_SOURCES =             \
313                 $(libmurphy_core_la_REGULAR_SOURCES)
314
315 libmurphy_core_la_CFLAGS  =             \
316                 $(AM_CFLAGS)            \
317                 $(LUA_CFLAGS)           \
318                 $(JSON_CFLAGS)          \
319                 $(SMACK_CFLAGS)
320
321 libmurphy_core_la_LDFLAGS =             \
322                 -Wl,-version-script=linker-script.core \
323                 -version-info @MURPHY_VERSION_INFO@
324
325 libmurphy_core_la_LIBADD  =                     \
326                 libmurphy-common.la             \
327                 libmurphy-lua-decision.la       \
328                 libmurphy-lua-utils.la          \
329                 murphy-db/mql/libmql.la         \
330                 murphy-db/mqi/libmqi.la         \
331                 murphy-db/mdb/libmdb.la         \
332                 $(LUA_LIBS)                     \
333                 $(SMACK_LIBS)                   \
334                 -ldl
335
336 libmurphy_core_la_DEPENDENCIES =                \
337                 linker-script.core              \
338                 $(filter %.la, $(libmurphy_core_la_LIBADD))
339
340 # core linker script generation
341 linker-script.core: $(libmurphy_core_la_HEADERS) \
342                     $(libmurphy_core_lua_bindings_la_HEADERS)
343         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
344                 -P "$(CC)" -c "$(libmurphy_core_la_CFLAGS)" -o $@ $^
345
346 clean-linker-script::
347         -rm -f linker-script.core
348
349 ###################################
350 # murphy dbus library
351 #
352 # Right now we have three variants of the murphy D-Bus library. The
353 # original with leaky libdbus abstraction, a revised one that plugs
354 # the most gaping abstraction holes, and one which uses systemd-bus,
355 # the licensing-wise much easier/liberal D-Bus implementation from
356 # systemd.
357 #
358 # All original code uses/used to use the libdbus-based one with leaky
359 # abstraction. This would make it very difficult to move away from
360 # the license-troubled libdbus even if/when a viable alternative (eg.
361 # from the kdbus effort) became available. To get rid of this problem,
362 # we need to get rid of the direct dependency on libdbus. Once that is
363 # done, we can (hopefully) switch easily and transparently between
364 # D-Bus libraries, if needed by touching only one component, the
365 # murphy-dbus library.
366 #
367 # To recap these are the different library variants:
368 #
369 # 1) murphy-libdbus
370 #    This is the original murphy-dbus library. It uses libdbus as the
371 #    underlying D-Bus client library implementation. It does not provide
372 #    a proper abstraction on top of libdbus. Messages, message building,
373 #    and parsing used DBusMessage.
374 #
375 # 2) murphy-dbus-libdbus
376 #    This is a modified version of murphy-libdbus which provides an
377 #    additional abstraction for messages, message building and parsing.
378 #
379 # 3) murphy-dbus-systemdbus
380 #    This library provides an identical API to murphy-dbus-libdbus but
381 #    it uses the systemd dbus library implementation (systemd-bus) as
382 #    the underlying D-Bus client library implementation.
383 #
384 # So all current code still using libdbus for message building/parsing
385 # needs to get rid of it and changed to use murphy-dbus-libdbus.
386 #
387
388 # original libdbus-based library
389 murphy_libdbus_headers =                \
390                 common/libdbus.h
391
392 if LIBDBUS_ENABLED
393 lib_LTLIBRARIES += libmurphy-libdbus.la
394 EXTRA_DIST      += common/murphy-libdbus.pc
395 pkgconfig_DATA  += common/murphy-libdbus.pc
396
397 libmurphy_libdbus_ladir =               \
398                 $(includedir)/murphy/common
399
400 libmurphy_libdbus_la_HEADERS = $(murphy_libdbus_headers)
401
402 libmurphy_libdbus_la_REGULAR_SOURCES =          \
403                 common/libdbus.c                \
404                 common/libdbus-glue.c
405
406 libmurphy_libdbus_la_SOURCES =          \
407                 $(libmurphy_libdbus_la_REGULAR_SOURCES)
408
409 libmurphy_libdbus_la_CFLAGS =           \
410                 $(AM_CFLAGS)            \
411                 $(LIBDBUS_CFLAGS)
412
413 libmurphy_libdbus_la_LDFLAGS =          \
414                 -Wl,-version-script=linker-script.libdbus \
415                 -version-info @MURPHY_VERSION_INFO@
416
417 libmurphy_libdbus_la_LIBADD  =          \
418                 libmurphy-common.la     \
419                 $(LIBDBUS_LIBS)         \
420                 -lrt
421
422 libmurphy_libdbus_la_DEPENDENCIES =     \
423                 linker-script.libdbus   \
424                 $(filter %.la, $(libmurphy_libdbus_la_LIBADD))
425
426 libmurphy_libdbusdir      = $(includedir)/murphy/dbus
427 libmurphy_libdbus_HEADERS = $(libmurphy_libdbus_la_HEADERS)
428 endif
429
430 # linker script generation
431 linker-script.libdbus: $(murphy_libdbus_headers)
432         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
433                 -P "$(CC)" -c "$(libmurphy_libdbus_la_CFLAGS)" -o $@ $^
434
435 clean-linker-script::
436         -rm -f linker-script.libdbus
437
438 # libdbus-based library with full abstraction
439 murphy_dbus_libdbus_headers =           \
440                 common/dbus-libdbus.h   \
441                 common/dbus-error.h
442
443 if LIBDBUS_ENABLED
444 lib_LTLIBRARIES += libmurphy-dbus-libdbus.la
445 EXTRA_DIST      += common/murphy-dbus-libdbus.pc
446 pkgconfig_DATA  += common/murphy-dbus-libdbus.pc
447
448 libmurphy_dbus_libdbus_ladir =          \
449                 $(includedir)/murphy/common
450
451 libmurphy_dbus_libdbus_la_HEADERS = $(murphy_dbus_libdbus_headers)
452
453 libmurphy_dbus_libdbus_la_REGULAR_SOURCES =     \
454                 common/dbus-libdbus.c           \
455                 common/dbus-libdbus-glue.c      \
456                 common/dbus-libdbus-transport.c
457
458 libmurphy_dbus_libdbus_la_SOURCES =             \
459                 $(libmurphy_dbus_libdbus_la_REGULAR_SOURCES)
460
461 libmurphy_dbus_libdbus_la_CFLAGS =      \
462                 $(AM_CFLAGS)            \
463                 $(LIBDBUS_CFLAGS)
464
465 libmurphy_dbus_libdbus_la_LDFLAGS =     \
466                 -Wl,-version-script=linker-script.dbus-libdbus \
467                 -version-info @MURPHY_VERSION_INFO@
468
469 libmurphy_dbus_libdbus_la_LIBADD  =     \
470                 libmurphy-common.la     \
471                 -lrt $(LIBDBUS_LIBS)
472
473 libmurphy_dbus_libdbus_la_DEPENDENCIES =        \
474                 linker-script.dbus-libdbus      \
475                 $(filter %.la, $(libmurphy_dbus_libdbus_la_LIBADD))
476
477 libmurphy_dbus_libdbusdir      = $(includedir)/murphy/dbus
478 libmurphy_dbus_libdbus_HEADERS = $(libmurphy_dbus_libdbus_la_HEADERS)
479 endif
480
481 # linker script generation
482 linker-script.dbus-libdbus: $(murphy_dbus_libdbus_headers)
483         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
484                 -P "$(CC)" -c "$(libmurphy_dbus_libdbus_la_CFLAGS)" -o $@ $^
485
486 clean-linker-script::
487         -rm -f linker-script.dbus-libdbus
488
489 # systemd-bus based library
490 murphy_dbus_sdbus_headers =                     \
491                 common/dbus-sdbus.h             \
492                 common/dbus-error.h
493
494 if SDBUS_ENABLED
495 lib_LTLIBRARIES += libmurphy-dbus-sdbus.la
496 EXTRA_DIST      += common/murphy-dbus-sdbus.pc
497 pkgconfig_DATA  += common/murphy-dbus-sdbus.pc
498
499 libmurphy_dbus_sdbus_ladir      =               \
500                 $(includedir)/murphy/common
501
502 libmurphy_dbus_sdbus_la_HEADERS = $(murphy_dbus_sdbus_headers)
503
504 libmurphy_dbus_sdbus_la_REGULAR_SOURCES =       \
505                 common/dbus-sdbus.c             \
506                 common/dbus-sdbus-glue.c        \
507                 common/dbus-sdbus-transport.c
508
509 libmurphy_dbus_sdbus_la_SOURCES =               \
510                 $(libmurphy_dbus_sdbus_la_REGULAR_SOURCES)
511
512 libmurphy_dbus_sdbus_la_CFLAGS  =       \
513                 $(AM_CFLAGS)            \
514                 $(SDBUS_CFLAGS)
515
516 libmurphy_dbus_sdbus_la_LDFLAGS =               \
517                 -Wl,-version-script=linker-script.dbus-sdbus \
518                 -version-info @MURPHY_VERSION_INFO@
519
520 libmurphy_dbus_sdbus_la_LIBADD  =               \
521                 -lrt $(SDBUS_LIBS)
522
523 libmurphy_dbus_sdbus_la_DEPENDENCIES =          \
524                 linker-script.dbus-sdbus        \
525                 $(filter %.la, $(libmurphy_dbus_sdbus_la_LIBADD))
526
527 libmurphy_dbus_sdbusdir      = $(includedir)/murphy/dbus
528 libmurphy_dbus_sdbus_HEADERS = $(libmurphy_dbus_sdbus_la_HEADERS)
529 endif
530
531 # linker script generation
532 linker-script.dbus-sdbus: $(murphy_dbus_sdbus_headers)
533         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
534                 -P "$(CC)" -c "$(libmurphy_dbus_sdbus_la_CFLAGS)" -o $@ $^
535
536 clean-linker-script::
537         -rm -f linker-script.sd-bus
538
539 ###################################
540 # murphy pulse glue library
541 #
542
543 murphy_pulse_headers =                  \
544                 common/pulse-glue.h     \
545                 common/pulse-subloop.h
546
547 if PULSE_ENABLED
548 lib_LTLIBRARIES += libmurphy-pulse.la
549 EXTRA_DIST      += common/murphy-pulse.pc
550 pkgconfig_DATA  += common/murphy-pulse.pc
551
552 libmurphy_pulse_ladir      =            \
553                 $(includedir)/murphy/common
554
555 libmurphy_pulse_la_HEADERS = $(murphy_pulse_headers)
556
557 libmurphy_pulse_la_SOURCES =            \
558                 common/pulse-glue.c     \
559                 common/pulse-subloop.c
560
561 libmurphy_pulse_la_CFLAGS  =            \
562                 $(AM_CFLAGS)            \
563                 $(PULSE_CFLAGS)
564
565 libmurphy_pulse_la_LDFLAGS =            \
566                 -Wl,-version-script=linker-script.pulse \
567                 -version-info @MURPHY_VERSION_INFO@
568
569 libmurphy_pulse_la_LIBADD  =            \
570                 libmurphy-common.la     \
571                 $(PULSE_LIBS)
572
573 libmurphy_pulse_la_DEPENDENCIES =       \
574                 linker-script.pulse     \
575                 $(filter %.la, $(libmurphy_pulse_la_LIBADD))
576
577 libpulseincludedir      = $(includedir)/murphy/pulse
578 libpulseinclude_HEADERS = $(libmurphy_pulse_la_HEADERS)
579 endif
580
581 # linker script generation
582 linker-script.pulse: $(murphy_pulse_headers)
583         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
584                 -P "$(CC)" -c "$(libmurphy_pulse_la_CFLAGS)" \
585                 -p '^mrp_|^_mrp|^pa_' -o $@ $^
586
587 clean-linker-script::
588         -rm -f linker-script.pulse
589
590 ###################################
591 # murphy ecore glue library
592 #
593
594 murphy_ecore_headers =                  \
595                 common/ecore-glue.h
596
597 if ECORE_ENABLED
598 lib_LTLIBRARIES += libmurphy-ecore.la
599 EXTRA_DIST      += common/murphy-ecore.pc
600 pkgconfig_DATA  += common/murphy-ecore.pc
601
602 libmurphy_ecore_ladir      =            \
603                 $(includedir)/murphy/common
604
605 libmurphy_ecore_la_HEADERS = $(murphy_ecore_headers)
606
607 libmurphy_ecore_la_SOURCES =            \
608                 common/ecore-glue.c
609
610 libmurphy_ecore_la_CFLAGS  =            \
611                 $(AM_CFLAGS)            \
612                 $(ECORE_CFLAGS)
613
614 libmurphy_ecore_la_LDFLAGS =            \
615                 -Wl,-version-script=linker-script.ecore \
616                 -version-info @MURPHY_VERSION_INFO@
617
618 libmurphy_ecore_la_LIBADD  =            \
619                 libmurphy-common.la     \
620                 $(ECORE_LIBS)
621
622 libmurphy_ecore_la_DEPENDENCIES =       \
623                 linker-script.ecore     \
624                 $(filter %.la, $(libmurphy_ecore_la_LIBADD))
625
626 libecoreincludedir      = $(includedir)/murphy/ecore
627 libecoreinclude_HEADERS = $(libmurphy_ecore_la_HEADERS)
628 endif
629
630 # linker script generation
631 linker-script.ecore: $(murphy_ecore_headers)
632         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
633                 -P "$(CC)" -c "$(libmurphy_ecore_la_CFLAGS)" -o $@ $^
634
635 clean-linker-script::
636         -rm -f linker-script.ecore
637
638 ###################################
639 # murphy glib glue library
640 #
641
642 murphy_glib_headers =                   \
643                 common/glib-glue.h
644
645 if GLIB_ENABLED
646 lib_LTLIBRARIES += libmurphy-glib.la
647 EXTRA_DIST      += common/murphy-glib.pc
648 pkgconfig_DATA  += common/murphy-glib.pc
649
650 libmurphy_glib_ladir      =             \
651                 $(includedir)/murphy/common
652
653 libmurphy_glib_la_HEADERS = $(murphy_glib_headers)
654
655 libmurphy_glib_la_SOURCES =             \
656                 common/glib-glue.c
657
658 libmurphy_glib_la_CFLAGS  =             \
659                 $(AM_CFLAGS)            \
660                 $(GLIB_CFLAGS)
661
662 libmurphy_glib_la_LDFLAGS =             \
663                 -Wl,-version-script=linker-script.glib \
664                 -version-info @MURPHY_VERSION_INFO@
665
666 libmurphy_glib_la_LIBADD  =             \
667                 libmurphy-common.la     \
668                 $(GLIB_LIBS)
669
670 libmurphy_glib_la_DEPENDENCIES =        \
671                 linker-script.glib      \
672                 $(filter %.la, $(libmurphy_glib_la_LIBADD))
673
674 libglibincludedir      = $(includedir)/murphy/glib
675 libglibinclude_HEADERS = $(libmurphy_glib_la_HEADERS)
676 endif
677
678 # linker script generation
679 linker-script.glib: $(murphy_glib_headers)
680         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
681                 -P "$(CC)" -c "$(libmurphy_glib_la_CFLAGS)" -o $@ $^
682
683 clean-linker-script::
684         -rm -f linker-script.glib
685
686 ###################################
687 # murphy qt glue library
688 #
689
690 murphy_qt_headers       =               \
691                 common/qt-glue.h
692
693 if QT_ENABLED
694 lib_LTLIBRARIES += libmurphy-qt.la
695 EXTRA_DIST      += common/murphy-qt.pc
696 pkgconfig_DATA  += common/murphy-qt.pc
697
698 BUILT_SOURCES   += common/qt-glue-priv.moc.h
699
700 libmurphy_qt_ladir      =               \
701                 $(includedir)/murphy/common
702
703 libmurphy_qt_la_HEADERS = $(murphy_qt_headers)
704
705 libmurphy_qt_la_SOURCES =               \
706                 common/qt-glue.cpp
707
708 libmurphy_qt_la_CPPFLAGS  =             \
709                 $(AM_CFLAGS)            \
710                 $(QTCORE_CFLAGS)
711
712 libmurphy_qt_la_LDFLAGS =               \
713                 -Wl,-version-script=linker-script.qt \
714                 -version-info @MURPHY_VERSION_INFO@
715
716 libmurphy_qt_la_LIBADD  = $(QTCORE_LIBS)
717
718 libmurphy_qt_la_DEPENDENCIES =          \
719                 linker-script.qt        \
720                 $(filter %.la, $(libmurphy_qt_la_LIBADD))
721
722 libqtincludedir      = $(includedir)/murphy/qt
723 libqtinclude_HEADERS = $(libmurphy_qt_la_HEADERS)
724
725 # run moc to generate Qt meta objects
726 common/qt-glue-priv.moc.h: common/qt-glue-priv.h
727         $(QUIET_GEN)$(QT_MOC) -DQT_ENABLED=1 $< -o$@
728 endif
729
730 # linker script generation
731 linker-script.qt: $(murphy_qt_headers)
732         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
733                 -P "$(CC)" -c "$(libmurphy_qt_la_CPPFLAGS) -DQT_ENABLED=1" \
734                 -o $@ $^
735
736 clean-linker-script::
737         -rm -f linker-script.qt
738
739 ###################################
740 # murphy resolver library
741 #
742
743 lib_LTLIBRARIES += libmurphy-resolver.la
744 EXTRA_DIST      += resolver/murphy-resolver.pc
745 pkgconfig_DATA  += resolver/murphy-resolver.pc
746
747 BUILT_SOURCES   += resolver/scanner.c resolver/parser.c
748
749 libmurphy_resolver_ladir =                      \
750                 $(includedir)/murphy/resolver
751
752 libmurphy_resolver_la_HEADERS =                 \
753                 resolver/resolver.h
754
755 SIMPLE_SCRIPT_SOURCES =                                         \
756                 resolver/scripting/simple/simple-script.c       \
757                 resolver/scripting/simple/simple-scanner.c      \
758                 resolver/scripting/simple/simple-parser.c       \
759                 resolver/scripting/simple/call.c                \
760                 resolver/scripting/simple/builtins.c
761
762 libmurphy_resolver_la_REGULAR_SOURCES =                         \
763                 resolver/resolver.c                             \
764                 resolver/parser.c                               \
765                 resolver/scanner.c                              \
766                 resolver/target.c                               \
767                 resolver/target-sorter.c                        \
768                 resolver/fact.c                                 \
769                 resolver/events.c                               \
770                 resolver/console.c                              \
771                 $(SIMPLE_SCRIPT_SOURCES)
772
773 libmurphy_resolver_la_SOURCES =                 \
774                 $(libmurphy_resolver_la_REGULAR_SOURCES)
775
776 libmurphy_resolver_la_CFLAGS =                  \
777                 $(AM_CFLAGS)                    \
778                 $(JSON_CFLAGS)
779
780 libmurphy_resolver_la_LDFLAGS =                 \
781                 -Wl,-version-script=linker-script.resolver \
782                 -version-info @MURPHY_VERSION_INFO@
783
784 libmurphy_resolver_la_LIBADD =          \
785                 libmurphy-core.la       \
786                 libmurphy-common.la     \
787                 murphy-db/mql/libmql.la \
788                 murphy-db/mqi/libmqi.la \
789                 murphy-db/mdb/libmdb.la
790
791 libmurphy_resolver_la_DEPENDENCIES =    \
792                 linker-script.resolver  \
793                 $(filter %.la, $(libmurphy_resolver_la_LIBADD))
794
795 # resolver lexical analyser and parser generation
796 RESOLVER_PARSER_PREFIX = yy_res_
797
798 resolver/scanner.c: resolver/scanner.l resolver/parser.c
799         $(LEXCOMPILE) -P $(RESOLVER_PARSER_PREFIX) $<
800         mv lex.$(RESOLVER_PARSER_PREFIX).c $@
801
802 resolver/parser.h resolver/parser.c: resolver/parser.y
803         $(YACCCOMPILE) -p $(RESOLVER_PARSER_PREFIX) $< -o resolver/parser.c
804
805 # resolver linker script generation
806 linker-script.resolver: $(libmurphy_resolver_la_HEADERS)
807         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
808                 -P "$(CC)" -c "$(libmurphy_resolver_la_CFLAGS)" -o $@ $^
809
810 clean-linker-script::
811         -rm -f linker-script.resolver
812
813 # simple interpreter lexical analyser and parser generation
814 SIMPLE_PARSER_PREFIX  = yy_smpl_
815 BUILT_SOURCES        += resolver/scripting/simple/simple-scanner.c \
816                         resolver/scripting/simple/simple-parser.c
817
818 resolver/scripting/simple/simple-scanner.c:             \
819     resolver/scripting/simple/simple-scanner.l          \
820     resolver/scripting/simple/simple-parser.c
821         $(LEXCOMPILE) -P $(SIMPLE_PARSER_PREFIX) $<
822         mv lex.$(SIMPLE_PARSER_PREFIX).c $@
823
824 # simple interpreter parser generation
825 resolver/scripting/simple/simple-parser.h       \
826 resolver/scripting/simple/simple-parser.c:      \
827     resolver/scripting/simple/simple-parser.y
828         $(YACCCOMPILE) -p $(SIMPLE_PARSER_PREFIX) $< -o \
829             resolver/scripting/simple/simple-parser.c
830
831 ###################################
832 # murphy backend resource library
833 #
834
835 if BUILD_RESOURCES
836 RESOURCE_LIBRARY = libmurphy-resource-backend.la
837 else
838 RESOURCE_LIBRARY =
839 endif
840
841 if BUILD_RESOURCES
842 lib_LTLIBRARIES += $(RESOURCE_LIBRARY)
843
844 libmurphy_resource_backend_ladir =                     \
845                 $(includedir)/murphy/resource
846
847 libmurphy_resource_backend_la_HEADERS =                        \
848                 resource/data-types.h           \
849                 resource/common-api.h           \
850                 resource/client-api.h           \
851                 resource/manager-api.h          \
852                 resource/config-api.h           \
853                 resource/protocol.h
854
855 libmurphy_resource_backend_la_REGULAR_SOURCES =                \
856                 resource/attribute.c            \
857                 resource/resource.c             \
858                 resource/resource-set.c         \
859                 resource/application-class.c    \
860                 resource/resource-owner.c       \
861                 resource/resource-client.c      \
862                 resource/zone.c                 \
863                 resource/config-lua.c           \
864                 resource/resource-lua.c         \
865                 resource/lua-resource.c
866
867 libmurphy_resource_backend_la_SOURCES =                        \
868                 $(libmurphy_resource_backend_la_REGULAR_SOURCES)
869
870 libmurphy_resource_backend_la_CFLAGS =          \
871                 $(AM_CFLAGS)                    \
872                 $(LUA_CFLAGS)
873
874 libmurphy_resource_backend_la_LDFLAGS =                        \
875                 -Wl,-version-script=linker-script.resource_backend \
876                 -version-info @MURPHY_VERSION_INFO@
877
878 libmurphy_resource_backend_la_LIBADD =     \
879                 libmurphy-core.la          \
880                 libmurphy-common.la        \
881                 libmurphy-lua-utils.la     \
882                 murphy-db/mql/libmql.la    \
883                 murphy-db/mqi/libmqi.la    \
884                 murphy-db/mdb/libmdb.la    \
885                 $(LUA_LIBS)
886
887 libmurphy_resource_backend_la_DEPENDENCIES =    \
888                 linker-script.resource_backend  \
889                 $(filter %.la, $(libmurphy_resource_backend_la_LIBADD))
890 endif
891
892 # resource linker script generation
893 linker-script.resource_backend: $(libmurphy_resource_backend_la_HEADERS)
894         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
895                 -P "$(CC)" -c "$(libmurphy_resource_backend_la_CFLAGS)" -o $@ $^
896
897 clean-linker-script::
898         -rm -f linker-script.resource_backend
899
900 ##########################
901 # readline replacement
902 #
903 lib_LTLIBRARIES += libbreedline.la
904 EXTRA_DIST      += breedline/breedline.pc
905 pkgconfig_DATA  += breedline/breedline.pc
906
907 libbreedline_ladir      =               \
908                 $(includedir)/breedline
909
910 libbreedline_la_HEADERS =               \
911                 breedline/breedline.h   \
912                 breedline/macros.h
913
914 libbreedline_la_SOURCES =               \
915                 breedline/breedline.c
916
917 libbreedline_la_CFLAGS  =               \
918                 $(AM_CFLAGS)
919
920 libbreedline_la_LDFLAGS =                                       \
921                 -Wl,-version-script=linker-script.breedline     \
922                 -version-info @MURPHY_VERSION_INFO@
923
924 libbreedline_la_LIBADD =
925
926 libbreedline_la_DEPENDENCIES =                  \
927                 linker-script.breedline         \
928                 $(filter %.la, $(libbreedline_la_LIBADD))
929
930 libbreedlineincludedir      = $(includedir)/breedline
931 libbreedlineinclude_HEADERS = $(libbreedline_la_HEADERS)
932
933 # linker script generation
934 linker-script.breedline: $(libbreedline_la_HEADERS)
935         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
936                 -P "$(CC)" -c "$(libbreedline_la_CFLAGS)" -p '^brl_' -o $@ $^
937
938 clean-linker-script::
939         -rm -f linker-script.breedline
940
941 ##########################
942 # breedline murphy glue library
943 #
944 lib_LTLIBRARIES += libbreedline-murphy.la
945 EXTRA_DIST      += breedline/breedline-murphy.pc
946 pkgconfig_DATA  += breedline/breedline-murphy.pc
947
948 libbreedline_murphy_ladir      = $(includedir)/breedline
949
950 libbreedline_murphy_la_HEADERS = breedline/breedline-murphy.h
951 libbreedline_murphy_la_SOURCES = breedline/breedline-murphy.c
952 libbreedline_murphy_la_CFLAGS  = $(AM_CFLAGS)
953
954 libbreedline_murphy_la_LDFLAGS =        \
955                 -Wl,-version-script=linker-script.breedline-murphy      \
956                 -version-info @MURPHY_VERSION_INFO@
957
958 libbreedline_murphy_la_LIBADD =         \
959                 libmurphy-common.la     \
960                 libbreedline.la
961
962 libbreedline_murphy_la_DEPENDENCIES =           \
963                 linker-script.breedline-murphy  \
964                 $(filter %.la,$(libbreedline_murphy_la_LIBADD))
965
966 libbreedline_murphyincludedir      = $(includedir)/breedline
967 libbreedline_murphyinclude_HEADERS = $(libbreedline_murphy_la_HEADERS)
968
969 # linker script generation
970 linker-script.breedline-murphy: $(libbreedline_murphy_la_HEADERS)
971         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
972             -P "$(CC)" -c "$(libbreedline_murphy_la_CFLAGS)" -p '^brl_' -o $@ $^
973
974 clean-linker-script::
975         -rm -f linker-script.breedline-murphy
976
977 ##########################
978 # breedline glib glue library
979 #
980
981 breedline_glib_headers =        \
982                 breedline/breedline-glib.h
983
984 if GLIB_ENABLED
985 lib_LTLIBRARIES += libbreedline-glib.la
986 EXTRA_DIST      += breedline/breedline-glib.pc
987 pkgconfig_DATA  += breedline/breedline-glib.pc
988
989 libbreedline_glib_ladir      = $(includedir)/breedline
990
991 libbreedline_glib_la_HEADERS = $(breedline_glib_headers)
992 libbreedline_glib_la_SOURCES = breedline/breedline-glib.c
993 libbreedline_glib_la_CFLAGS  = $(AM_CFLAGS) $(GLIB_CFLAGS)
994
995 libbreedline_glib_la_LDFLAGS = \
996                 -Wl,-version-script=linker-script.breedline-glib        \
997                 -version-info @MURPHY_VERSION_INFO@
998
999 libbreedline_glib_la_LIBADD =           \
1000                 libbreedline.la         \
1001                 $(GLIB_LIBS)
1002
1003 libbreedline_glib_la_DEPENDENCIES =             \
1004                 linker-script.breedline-glib    \
1005                 $(filter %.la, $(libbreedline_glib_la_LIBADD))
1006
1007 libbreedline_glibincludedir      = $(includedir)/breedline
1008 libbreedline_glibinclude_HEADERS = $(libbreedline_glib_la_HEADERS)
1009 endif
1010
1011 # linker script generation
1012 linker-script.breedline-glib: $(breedline_glib_headers)
1013         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
1014                 -P "$(CC)" -c "$(libbreedline_glib_la_CFLAGS)" -p '^brl_' \
1015                 -o $@ $^
1016
1017 clean-linker-script::
1018         -rm -f linker-script.breedline-glib
1019
1020 ###################################
1021 # murphy resource external library
1022
1023 # TODO: put this under conditional compilation
1024
1025 lib_LTLIBRARIES += libmurphy-resource.la
1026 EXTRA_DIST      += plugins/resource-native/libmurphy-resource/murphy-resource.pc
1027 pkgconfig_DATA  += plugins/resource-native/libmurphy-resource/murphy-resource.pc
1028
1029 libmurphy_resource_ladir =          \
1030         $(includedir)/murphy/plugins/resource-native/libmurphy-resource
1031
1032 libmurphy_resource_la_HEADERS =         \
1033         plugins/resource-native/libmurphy-resource/resource-api.h     \
1034         plugins/resource-native/libmurphy-resource/resource-private.h
1035
1036 libmurphy_resource_la_SOURCES =         \
1037         plugins/resource-native/libmurphy-resource/resource.c \
1038         plugins/resource-native/libmurphy-resource/attribute.c \
1039         plugins/resource-native/libmurphy-resource/rset.c \
1040         plugins/resource-native/libmurphy-resource/string_array.c \
1041         plugins/resource-native/libmurphy-resource/message.c \
1042         plugins/resource-native/libmurphy-resource/resource-log.c
1043
1044 libmurphy_resource_la_CFLAGS =          \
1045         $(AM_CFLAGS)
1046
1047 libmurphy_resource_la_LDFLAGS = \
1048                 -Wl,-version-script=linker-script.resource      \
1049                 -version-info @MURPHY_VERSION_INFO@
1050
1051 libmurphy_resource_la_LIBADD =      \
1052                 libmurphy-common.la
1053
1054 libmurphy_resource_la_DEPENDENCIES =    \
1055                 libmurphy-common.la     \
1056                 linker-script.resource  \
1057                 $(filter %.la, $(libmurphy_resource_la_LIBADD))
1058
1059 # linker script generation
1060 linker-script.resource: $(libmurphy_resource_la_HEADERS)
1061         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
1062                 -P "$(CC)" -c "$(libmurphy_resource_la_CFLAGS)" -o $@ $^
1063
1064 clean-linker-script::
1065         -rm -f linker-script.resource
1066
1067 # resource-api-test
1068 bin_PROGRAMS += resource-api-test
1069
1070 resource_api_test_SOURCES = plugins/resource-native/libmurphy-resource/api_test.c
1071 resource_api_test_CFLAGS  = $(AM_CFLAGS)
1072 resource_api_test_LDADD   = libmurphy-common.la libmurphy-resource.la
1073
1074 # resource-api-fuzz
1075 bin_PROGRAMS += resource-api-fuzz
1076
1077 resource_api_fuzz_SOURCES = plugins/resource-native/libmurphy-resource/resource-fuzz.c
1078 resource_api_fuzz_CFLAGS  = $(AM_CFLAGS)
1079 resource_api_fuzz_LDADD   = libmurphy-common.la libmurphy-resource.la
1080
1081 # context-create
1082 bin_PROGRAMS += resource-context-create
1083
1084 resource_context_create_SOURCES = plugins/resource-native/libmurphy-resource/context-create.c
1085 resource_context_create_CFLAGS  = $(AM_CFLAGS)
1086 resource_context_create_LDADD   = libmurphy-common.la libmurphy-resource.la
1087
1088 ###################################
1089 # murphy plugins
1090 #
1091
1092 BUILTIN_PLUGINS    =
1093 BUILTIN_CFLAGS     = -D__MURPHY_BUILTIN_PLUGIN__ $(AM_CFLAGS)
1094 BUILTIN_LIBS       =
1095
1096 LINKEDIN_PLUGINS   =
1097
1098 plugin_LTLIBRARIES =
1099 plugindir          = $(libdir)/murphy/plugins
1100
1101
1102 # test plugin
1103 TEST_PLUGIN_SOURCES = plugins/plugin-test.c
1104 TEST_PLUGIN_CFLAGS  =
1105 TEST_PLUGIN_LIBS    =
1106
1107 if !DISABLED_PLUGIN_TEST
1108 if BUILTIN_PLUGIN_TEST
1109 BUILTIN_PLUGINS += $(TEST_PLUGIN_SOURCES)
1110 BUILTIN_CFLAGS  += $(TEST_PLUGIN_CFLAGS)
1111 BUILTIN_LIBS    += $(TEST_PLUGIN_LIBS)
1112 else
1113 plugin_test_la_SOURCES = $(TEST_PLUGIN_SOURCES)
1114 plugin_test_la_CFLAGS  = $(TEST_PLUGIN_CFLAGS) $(MURPHY_CFLAGS) $(AM_CFLAGS)
1115 plugin_test_la_LDFLAGS = -module -avoid-version
1116 plugin_test_la_LIBADD  = $(TEST_PLUGIN_LIBS)
1117
1118 plugin_LTLIBRARIES    += plugin-test.la
1119 endif
1120 endif
1121
1122 # dbus plugin
1123 if LIBDBUS_ENABLED
1124 DBUS_PLUGIN_SOURCES = plugins/plugin-dbus.c
1125 DBUS_PLUGIN_CFLAGS  = $(LIBDBUS_CFLAGS)
1126 DBUS_PLUGIN_LIBS    = libmurphy-dbus-libdbus.la $(LIBDBUS_LIBS)
1127
1128 if !DISABLED_PLUGIN_DBUS
1129 if BUILTIN_PLUGIN_DBUS
1130 BUILTIN_PLUGINS += $(DBUS_PLUGIN_SOURCES)
1131 BUILTIN_CFLAGS  += $(DBUS_PLUGIN_CFLAGS)
1132 BUILTIN_LIBS    += $(DBUS_PLUGIN_LIBS)
1133 else
1134 plugin_dbus_la_SOURCES = $(DBUS_PLUGIN_SOURCES)
1135 plugin_dbus_la_CFLAGS  = $(DBUS_PLUGIN_CFLAGS) $(MURPHY_CFLAGS) $(AM_CFLAGS)
1136 plugin_dbus_la_LDFLAGS = -module -avoid-version
1137 plugin_dbus_la_LIBADD  = $(DBUS_PLUGIN_LIBS)
1138
1139 plugin_LTLIBRARIES    += plugin-dbus.la
1140 endif
1141 endif
1142 endif
1143
1144 # automotive message broker plugin
1145 if LIBDBUS_ENABLED
1146 AMB_PLUGIN_SOURCES = plugins/plugin-amb.c
1147 AMB_PLUGIN_CFLAGS  = $(LIBDBUS_CFLAGS)
1148 AMB_PLUGIN_LIBS    = libmurphy-dbus-libdbus.la
1149
1150 if !DISABLED_PLUGIN_AMB
1151 if BUILTIN_PLUGIN_AMB
1152 BUILTIN_PLUGINS += $(AMB_PLUGIN_SOURCES)
1153 BUILTIN_CFLAGS  += $(AMB_PLUGIN_CFLAGS)
1154 BUILTIN_LIBS    += $(AMB_PLUGIN_LIBS)
1155 else
1156 plugin_amb_la_SOURCES = $(AMB_PLUGIN_SOURCES)
1157 plugin_amb_la_CFLAGS  = $(AMB_PLUGIN_CFLAGS) $(MURPHY_CFLAGS) $(AM_CFLAGS)
1158 plugin_amb_la_LDFLAGS = -module -avoid-version
1159 plugin_amb_la_LIBADD  = $(AMB_PLUGIN_LIBS)
1160
1161 plugin_LTLIBRARIES    += plugin-amb.la
1162 endif
1163 endif
1164 endif
1165
1166 if GLIB_ENABLED
1167 # glib plugin
1168 GLIB_PLUGIN_SOURCES = plugins/plugin-glib.c
1169 GLIB_PLUGIN_CFLAGS  = $(GLIB_CFLAGS)
1170 GLIB_PLUGIN_LIBS    = $(GLIB_LIBS)
1171
1172 if !DISABLED_PLUGIN_GLIB
1173 if BUILTIN_PLUGIN_GLIB
1174 BUILTIN_PLUGINS += $(GLIB_PLUGIN_SOURCES)
1175 BUILTIN_CFLAGS  += $(GLIB_PLUGIN_CFLAGS)
1176 BUILTIN_LIBS    += $(GLIB_PLUGIN_LIBS)
1177 else
1178 plugin_glib_la_SOURCES = $(GLIB_PLUGIN_SOURCES)
1179 plugin_glib_la_CFLAGS  = $(GLIB_PLUGIN_CFLAGS) $(MURPHY_CFLAGS) $(AM_CFLAGS)
1180 plugin_glib_la_LDFLAGS = -module -avoid-version
1181 plugin_glib_la_LIBADD  = $(GLIB_PLUGIN_LIBS)
1182
1183 plugin_LTLIBRARIES    += plugin-glib.la
1184 endif
1185 endif
1186 endif
1187
1188 # resource-dbus plugin
1189 if BUILD_RESOURCES
1190 if LIBDBUS_ENABLED
1191 RESOURCE_DBUS_PLUGIN_SOURCES = plugins/plugin-resource-dbus.c
1192 RESOURCE_DBUS_PLUGIN_CFLAGS  = $(LIBDBUS_CFLAGS)
1193 RESOURCE_DBUS_PLUGIN_LIBS    =                                  \
1194                                 libmurphy-dbus-libdbus.la       \
1195                                 libmurphy-core.la               \
1196                                 libmurphy-common.la             \
1197                                 $(RESOURCE_LIBRARY)
1198
1199 if !DISABLED_PLUGIN_RESOURCE_DBUS
1200 if BUILTIN_PLUGIN_RESOURCE_DBUS
1201 BUILTIN_PLUGINS += $(RESOURCE_DBUS_PLUGIN_SOURCES)
1202 BUILTIN_CFLAGS  += $(RESOURCE_DBUS_PLUGIN_CFLAGS)
1203 BUILTIN_LIBS    += $(RESOURCE_DBUS_PLUGIN_LIBS)
1204 else
1205 plugin_resource_dbus_la_SOURCES = $(RESOURCE_DBUS_PLUGIN_SOURCES)
1206 plugin_resource_dbus_la_CFLAGS  = $(RESOURCE_DBUS_PLUGIN_CFLAGS) $(MURPHY_CFLAGS) $(AM_CFLAGS)
1207 plugin_resource_dbus_la_LDFLAGS = -module -avoid-version
1208 plugin_resource_dbus_la_LIBADD  = $(RESOURCE_DBUS_PLUGIN_LIBS)
1209 plugin_LTLIBRARIES    += plugin-resource-dbus.la
1210 endif
1211 endif
1212 endif
1213 endif
1214
1215 # resource-wrt plugin
1216 if BUILD_RESOURCES
1217 if WEBSOCKETS_ENABLED
1218 RESOURCE_WRT_PLUGIN_SOURCES = plugins/resource-wrt/plugin-resource-wrt.c
1219 RESOURCE_WRT_PLUGIN_CFLAGS  = $(WEBSOCKETS_CFLAGS)
1220 RESOURCE_WRT_PLUGIN_LIBS    =
1221
1222 if !DISABLED_PLUGIN_RESOURCE_WRT
1223 if BUILTIN_PLUGIN_RESOURCE_WRT
1224 BUILTIN_PLUGINS += $(RESOURCE_WRT_PLUGIN_SOURCES)
1225 BUILTIN_CFLAGS  += $(RESOURCE_WRT_PLUGIN_CFLAGS)
1226 BUILTIN_LIBS    += $(RESOURCE_WRT_PLUGIN_LIBS)
1227 else
1228 plugin_resource_wrt_la_SOURCES = $(RESOURCE_WRT_PLUGIN_SOURCES)
1229 plugin_resource_wrt_la_CFLAGS  = $(RESOURCE_WRT_PLUGIN_CFLAGS) \
1230                                  $(MURPHY_CFLAGS) $(AM_CFLAGS)
1231 plugin_resource_wrt_la_LDFLAGS = -module -avoid-version
1232 plugin_resource_wrt_la_LIBADD  = $(RESOURCE_WRT_PLUGIN_LIBS)
1233 plugin_LTLIBRARIES    += plugin-resource-wrt.la
1234
1235 EXTRA_DIST       += $(resource_wrt_DATA);
1236 resource_wrtdir   = $(datadir)/murphy/resource-wrt
1237 resource_wrt_DATA =                                     \
1238                 plugins/resource-wrt/resource-api.js    \
1239                 plugins/resource-wrt/resource-test.html
1240
1241 endif
1242 endif
1243 endif
1244 endif
1245
1246 # console plugin
1247 CONSOLE_PLUGIN_REGULAR_SOURCES = plugins/console/plugin-console.c
1248 CONSOLE_PLUGIN_SOURCES         = $(CONSOLE_PLUGIN_REGULAR_SOURCES)
1249 CONSOLE_PLUGIN_CFLAGS          =
1250 CONSOLE_PLUGIN_LIBS            =
1251
1252 if CONSOLE_ENABLED
1253 if !DISABLED_PLUGIN_CONSOLE
1254 if BUILTIN_PLUGIN_CONSOLE
1255 BUILTIN_PLUGINS += $(CONSOLE_PLUGIN_SOURCES)
1256 BUILTIN_CFLAGS  += $(CONSOLE_PLUGIN_CFLAGS)
1257 BUILTIN_LIBS    += $(CONSOLE_PLUGIN_LIBS)
1258 else
1259 plugin_console_la_SOURCES = $(CONSOLE_PLUGIN_SOURCES)
1260 plugin_console_la_CFLAGS  = $(CONSOLE_PLUGIN_CFLAGS) \
1261                             $(MURPHY_CFLAGS) $(AM_CFLAGS)
1262 plugin_console_la_LDFLAGS = -module -avoid-version
1263 plugin_console_la_LIBADD  = $(CONSOLE_PLUGIN_LIBS)
1264
1265 plugin_LTLIBRARIES    += plugin-console.la
1266 endif
1267 endif
1268 endif
1269
1270 # dlog plugin
1271 DLOG_PLUGIN_REGULAR_SOURCES = plugins/plugin-dlog.c
1272 DLOG_PLUGIN_SOURCES         = $(DLOG_PLUGIN_REGULAR_SOURCES)
1273 DLOG_PLUGIN_CFLAGS          = $(DLOG_CFLAGS)
1274 DLOG_PLUGIN_LIBS            = $(DLOG_LIBS)
1275
1276 if DLOG_ENABLED
1277 if !DISABLED_PLUGIN_DLOG
1278 if BUILTIN_PLUGIN_DLOG
1279 BUILTIN_PLUGINS += $(DLOG_PLUGIN_SOURCES)
1280 BUILTIN_CFLAGS  += $(DLOG_PLUGIN_CFLAGS)
1281 BUILTIN_LIBS    += $(DLOG_PLUGIN_LIBS)
1282 else
1283 plugin_dlog_la_SOURCES = $(DLOG_PLUGIN_SOURCES)
1284 plugin_dlog_la_CFLAGS  = $(DLOG_PLUGIN_CFLAGS) \
1285                             $(MURPHY_CFLAGS) $(AM_CFLAGS)
1286 plugin_dlog_la_LDFLAGS = -module -avoid-version
1287 plugin_dlog_la_LIBADD  = $(DLOG_PLUGIN_LIBS)
1288
1289 plugin_LTLIBRARIES    += plugin-dlog.la
1290 endif
1291 endif
1292 endif
1293
1294 # native resource plugin
1295 if BUILD_RESOURCES
1296 PLUGIN_RESOURCE_NATIVE_REGULAR_SOURCES =                                \
1297                 plugins/resource-native/plugin-resource-native.c
1298 PLUGIN_RESOURCE_NATIVE_SOURCES =                                        \
1299                 $(PLUGIN_RESOURCE_NATIVE_REGULAR_SOURCES)
1300 PLUGIN_RESOURCE_NATIVE_CFLAGS =                                         \
1301                 $(LUA_CFLAGS)
1302
1303 PLUGIN_RESOURCE_NATIVE_LIBS =                                           \
1304                 libmurphy-common.la                                     \
1305                 $(RESOURCE_LIBRARY)                                     \
1306                 $(LUA_LIBS)
1307
1308 plugin_resource_native_la_SOURCES = $(PLUGIN_RESOURCE_NATIVE_SOURCES)
1309 plugin_resource_native_la_CFLAGS  = $(PLUGIN_RESOURCE_NATIVE_CFLAGS)    \
1310                                     $(MURPHY_CFLAGS) $(AM_CFLAGS)       \
1311                                     $(JSON_CFLAGS)
1312 plugin_resource_native_la_LDFLAGS = -module -avoid-version
1313 plugin_resource_native_la_LIBADD  = $(PLUGIN_RESOURCE_NATIVE_LIBS)
1314
1315 plugin_LTLIBRARIES += plugin-resource-native.la
1316
1317 # resource-client
1318 bin_PROGRAMS += resource-client
1319
1320 resource_client_SOURCES = plugins/resource-native/resource-client.c
1321 resource_client_CFLAGS  = $(AM_CFLAGS)
1322 resource_client_LDADD   =  libmurphy-common.la
1323 endif
1324
1325 # IVI resource manager plugin
1326 if BUILD_RESOURCES
1327 PLUGIN_IVI_RESOURCE_MANAGER_REGULAR_SOURCES =                               \
1328                 plugins/ivi-resource-manager/plugin-ivi-resource-manager.c  \
1329                 plugins/ivi-resource-manager/class.c                        \
1330                 plugins/ivi-resource-manager/screen.c                       \
1331                 plugins/ivi-resource-manager/audio.c                        \
1332                 plugins/ivi-resource-manager/appid.c
1333 PLUGIN_IVI_RESOURCE_MANAGER_SOURCES =                                       \
1334                 $(PLUGIN_IVI_RESOURCE_MANAGER_REGULAR_SOURCES)
1335 PLUGIN_IVI_RESOURCE_MANAGER_CFLAGS =                                        \
1336                 $(LUA_CFLAGS)                                                                           \
1337                 $(TZCONFIG_CFLAGS)
1338
1339 PLUGIN_IVI_RESOURCE_MANAGER_LIBS =                                          \
1340                 libmurphy-common.la                                                                     \
1341                 $(RESOURCE_LIBRARY)                                         \
1342                 $(LUA_LIBS)                                                                             \
1343                 $(TZCONFIG_LIBS)
1344
1345 plugin_ivi_resource_manager_la_SOURCES = $(PLUGIN_IVI_RESOURCE_MANAGER_SOURCES)
1346 plugin_ivi_resource_manager_la_CFLAGS  = $(PLUGIN_IVI_RESOURCE_MANAGER_CFLAGS)\
1347                                          $(MURPHY_CFLAGS) $(AM_CFLAGS)        \
1348                                          $(JSON_CFLAGS)
1349 plugin_ivi_resource_manager_la_LDFLAGS = -module -avoid-version
1350 plugin_ivi_resource_manager_la_LIBADD  = $(PLUGIN_IVI_RESOURCE_MANAGER_LIBS)
1351
1352 plugin_LTLIBRARIES += plugin-ivi-resource-manager.la
1353 endif
1354
1355
1356 # domain control plugin
1357 DOMAIN_CONTROL_PLUGIN_SOURCES = plugins/domain-control/plugin-domain-control.c \
1358                                 plugins/domain-control/domain-control.c        \
1359                                 plugins/domain-control/proxy.c                 \
1360                                 plugins/domain-control/table.c                 \
1361                                 plugins/domain-control/notify.c                \
1362                                 plugins/domain-control/message.c
1363 DOMAIN_CONTROL_PLUGIN_LOADER  = linkedin-domain-control-loader.c
1364
1365
1366 DOMAIN_CONTROL_PLUGIN_CFLAGS  =
1367 DOMAIN_CONTROL_PLUGIN_LIBS    =
1368
1369 if !DISABLED_PLUGIN_DOMAIN_CONTROL
1370 if BUILTIN_PLUGIN_DOMAIN_CONTROL
1371 LINKEDIN_PLUGINS             += libmurphy-plugin-domain-control.la
1372 lib_LTLIBRARIES              += libmurphy-plugin-domain-control.la
1373 DOMAIN_CONTROL_PLUGIN_CFLAGS += $(BUILTIN_CFLAGS)
1374
1375
1376 libmurphy_plugin_domain_control_ladir =                          \
1377                 $(includedir)/murphy/domain-control
1378
1379 libmurphy_plugin_domain_control_la_SOURCES =                     \
1380                 $(DOMAIN_CONTROL_PLUGIN_SOURCES)                 \
1381                 $(DOMAIN_CONTROL_PLUGIN_LOADER)
1382
1383 libmurphy_plugin_domain_control_la_CFLAGS =                      \
1384                 $(DOMAIN_CONTROL_PLUGIN_CFLAGS)                  \
1385                 $(AM_CFLAGS)                                     \
1386                 $(JSON_CFLAGS)
1387
1388 libmurphy_plugin_domain_control_la_LDFLAGS =                     \
1389                 -Wl,-version-script=linker-script.domain-control \
1390                 -version-info @MURPHY_VERSION_INFO@
1391
1392 libmurphy_plugin_domain_control_la_LIBADD =             \
1393                 libmurphy-core.la                       \
1394                 libmurphy-common.la                     \
1395                 murphy-db/mql/libmql.la                 \
1396                 murphy-db/mqi/libmqi.la                 \
1397                 murphy-db/mdb/libmdb.la
1398
1399 libmurphy_plugin_domain_control_la_DEPENDENCIES =       \
1400                 linker-script.domain-control            \
1401         $(filter %.la, $(libmurphy_plugin_domain_control_la_LIBADD))
1402 else
1403 plugin_domain_control_la_SOURCES = $(DOMAIN_CONTROL_PLUGIN_SOURCES)
1404 plugin_domain_control_la_CFLAGS  = $(DOMAIN_CONTROL_PLUGIN_CFLAGS) \
1405                                    $(MURPHY_CFLAGS) $(AM_CFLAGS)
1406 plugin_domain_control_la_LDFLAGS = -module -avoid-version
1407 plugin_domain_control_la_LIBADD  = $(DOMAIN_CONTROL_PLUGIN_LIBS)
1408 plugin_LTLIBRARIES              += plugin-domain-control.la
1409 endif
1410
1411
1412 # domain controller client library
1413 lib_LTLIBRARIES += libmurphy-domain-controller.la
1414 EXTRA_DIST      += plugins/domain-control/murphy-domain-controller.pc
1415 pkgconfig_DATA  += plugins/domain-control/murphy-domain-controller.pc
1416
1417 libmurphy_domain_controller_ladir =                     \
1418                 $(includedir)/murphy/domain-control
1419
1420 libmurphy_domain_controller_la_HEADERS =                \
1421                 plugins/domain-control/client.h
1422
1423 libmurphy_domain_controller_la_SOURCES =                \
1424                 plugins/domain-control/client.c         \
1425                 plugins/domain-control/message.c
1426 libmurphy_domain_controller_la_CFLAGS   =               \
1427                 $(JSON_CFLAGS)
1428 libmurphy_domain_controller_la_LIBADD   =       \
1429                 libmurphy-common.la             \
1430                 murphy-db/mql/libmql.la         \
1431                 murphy-db/mqi/libmqi.la         \
1432                 murphy-db/mdb/libmdb.la         \
1433                 $(JSON_LIBS)
1434
1435 if WEBSOCKETS_ENABLED
1436 EXTRA_DIST          += $(domain_control_DATA)
1437 domain_controldir    = $(datadir)/murphy/domain-control
1438 domain_control_DATA  =                                          \
1439                 plugins/domain-control/domain-control-api.js    \
1440                 plugins/domain-control/domain-control-test.html
1441 endif
1442
1443 # test domain controller (disabled until we have a readline replacement)
1444 bin_PROGRAMS += test-domain-controller
1445
1446 test_domain_controller_SOURCES = plugins/domain-control/test-client.c
1447 test_domain_controller_CFLAGS  = $(AM_CFLAGS)
1448 test_domain_controller_LDADD   = libmurphy-domain-controller.la \
1449                                  libbreedline-murphy.la         \
1450                                  libbreedline.la                \
1451                                  libmurphy-common.la
1452 endif
1453
1454 # linkedin domain control plugin linker script generation
1455 linker-script.domain-control: $(DOMAIN_CONTROL_PLUGIN_LOADER:%.c=%.h)
1456         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
1457                 -P "$(CC)" -c "$(libmurphy_domain_controller_la_CFLAGS)" -o $@ $^
1458
1459 clean-linker-script::
1460         -rm -f linker-script.domain-control
1461
1462 # Lua plugin
1463 LUA_PLUGIN_SOURCES = plugins/plugin-lua.c
1464 LUA_PLUGIN_CFLAGS  = $(AM_CFLAGS) $(LUA_CFLAGS)
1465 LUA_PLUGIN_LIBS    = $(LUA_LIBS)
1466
1467
1468 if BUILTIN_PLUGIN_LUA
1469 BUILTIN_PLUGINS += $(LUA_PLUGIN_SOURCES)
1470 BUILTIN_CFLAGS  += $(LUA_PLUGIN_CFLAGS)
1471 BUILTIN_LIBS    += $(LUA_PLUGIN_LIBS)
1472 else
1473 plugin_lua_la_SOURCES = plugins/plugin-lua.c
1474 plugin_lua_la_CFLAGS  = $(LUA_PLUGIN_CFLAGS) \
1475                         $(MURPHY_CFLAGS) $(AM_CFLAGS)
1476 plugin_lua_la_LDFLAGS = -module -avoid-version
1477 plugin_lua_la_LIBADD  = $(LUA_PLUGIN_LIBS) $(LUA_LIBS)
1478
1479 plugin_LTLIBRARIES    += plugin-lua.la
1480 endif
1481
1482 # systemd (logging) plugin
1483 if SYSTEMD_ENABLED
1484 SYSTEMD_PLUGIN_SOURCES = plugins/plugin-systemd.c
1485 SYSTEMD_PLUGIN_CFLAGS  = $(SYSTEMD_CFLAGS)
1486 SYSTEMD_PLUGIN_LIBS    = $(SYSTEMD_LIBS)
1487
1488 if !DISABLED_PLUGIN_SYSTEMD
1489 if BUILTIN_PLUGIN_SYSTEMD
1490 BUILTIN_PLUGINS += $(SYSTEMD_PLUGIN_SOURCES)
1491 BUILTIN_CFLAGS  += $(SYSTEMD_PLUGIN_CFLAGS)
1492 BUILTIN_LIBS    += $(SYSTEMD_PLUGIN_LIBS)
1493 else
1494 plugin_systemd_la_SOURCES = $(SYSTEMD_PLUGIN_SOURCES)
1495 plugin_systemd_la_CFLAGS  = $(SYSTEMD_PLUGIN_CFLAGS) \
1496                             $(MURPHY_CFLAGS) \
1497                             $(AM_CFLAGS)
1498 plugin_systemd_la_LDFLAGS = -module -avoid-version
1499 plugin_systemd_la_LIBADD  = $(SYSTEMD_PLUGIN_LIBS)
1500
1501 plugin_LTLIBRARIES += plugin-systemd.la
1502 endif
1503 endif
1504 endif
1505
1506 # system-controller
1507 if SYSTEMCTL_ENABLED
1508 SYSTEMCTL_DIR = plugins/system-controller
1509
1510 SYSTEMCTL_PLUGIN_SOURCES =                                             \
1511         $(SYSTEMCTL_DIR)/plugin-system-controller.c                    \
1512         $(SYSTEMCTL_DIR)/resource-manager/resource-manager.c           \
1513         $(SYSTEMCTL_DIR)/resource-manager/scripting-resource-manager.c \
1514         $(SYSTEMCTL_DIR)/resource-manager/screen.c                     \
1515         $(SYSTEMCTL_DIR)/resource-manager/audio.c                      \
1516         $(SYSTEMCTL_DIR)/resource-manager/notifier.c                   \
1517         $(SYSTEMCTL_DIR)/resource-manager/scripting-notifier.c         \
1518         $(SYSTEMCTL_DIR)/resource-client/resource-client.c             \
1519         $(SYSTEMCTL_DIR)/resource-client/scripting-resource-client.c   \
1520         $(SYSTEMCTL_DIR)/application/application.c                     \
1521         $(SYSTEMCTL_DIR)/application/scripting-application.c           \
1522         $(SYSTEMCTL_DIR)/application-tracker/application-tracker.c     \
1523         $(SYSTEMCTL_DIR)/user/user.c                                   \
1524         $(SYSTEMCTL_DIR)/wayland/wayland.c                             \
1525         $(SYSTEMCTL_DIR)/wayland/output.c                              \
1526         $(SYSTEMCTL_DIR)/wayland/layer.c                               \
1527         $(SYSTEMCTL_DIR)/wayland/area.c                                \
1528         $(SYSTEMCTL_DIR)/wayland/window.c                              \
1529         $(SYSTEMCTL_DIR)/wayland/animation.c                           \
1530         $(SYSTEMCTL_DIR)/wayland/input.c                               \
1531         $(SYSTEMCTL_DIR)/wayland/code.c                                \
1532         $(SYSTEMCTL_DIR)/wayland/scripting-wayland.c                   \
1533         $(SYSTEMCTL_DIR)/wayland/scripting-window-manager.c            \
1534         $(SYSTEMCTL_DIR)/wayland/scripting-animation.c                 \
1535         $(SYSTEMCTL_DIR)/wayland/scripting-window.c                    \
1536         $(SYSTEMCTL_DIR)/wayland/scripting-output.c                    \
1537         $(SYSTEMCTL_DIR)/wayland/scripting-area.c                      \
1538         $(SYSTEMCTL_DIR)/wayland/scripting-layer.c                     \
1539         $(SYSTEMCTL_DIR)/wayland/scripting-input-manager.c             \
1540         $(SYSTEMCTL_DIR)/wayland/scripting-input.c                     \
1541         $(SYSTEMCTL_DIR)/wayland/scripting-code.c
1542
1543 if WESTON_ICO_PLUGINS
1544 SYSTEMCTL_PLUGIN_SOURCES +=                                            \
1545         $(SYSTEMCTL_DIR)/wayland/ico-window-manager.c                  \
1546         $(SYSTEMCTL_DIR)/wayland/ico-input-manager.c
1547
1548 SYSTEMCTL_PLUGIN_CFLAGS  = \
1549         $(WEBSOCKETS_CFLAGS) $(WAYLAND_CLIENT_CFLAGS) $(LIBXML2_CFLAGS) \
1550         $(AUL_CFLAGS) $(AIL_CFLAGS) \
1551         -DWESTON_ICO_PLUGINS \
1552         -Iico-uxf-weston-plugin \
1553         -I$(top_builddir)/src/$(SYSTEMCTL_DIR)
1554 SYSTEMCTL_PLUGIN_LIBS    = \
1555         $(WEBSOCKET_LIBS) $(WAYLAND_CLIENT_LIBS) $(LIBXML2_LIBS) $(AUL_LIBS) \
1556         $(AIL_CFLAGS) -lico-uxf-weston-plugin $(TZCONFIG_LIBS)
1557 else
1558 SYSTEMCTL_PLUGIN_SOURCES +=                                            \
1559         $(SYSTEMCTL_DIR)/wayland/glm-window-manager.c                  \
1560         $(SYSTEMCTL_DIR)/wayland/glm-input-manager.c
1561 SYSTEMCTL_PLUGIN_CFLAGS  = \
1562         $(WEBSOCKETS_CFLAGS) $(WAYLAND_CLIENT_CFLAGS) $(LIBXML2_CFLAGS) \
1563         $(IVI_EXTENSION_PROTOCOL_CFLAGS) \
1564         -Iico-uxf-weston-plugin \
1565         $(AUL_CFLAGS) $(AIL_CFLAGS) \
1566         -I$(top_builddir)/src/$(SYSTEMCTL_DIR)
1567 SYSTEMCTL_PLUGIN_LIBS    = \
1568         $(WEBSOCKET_LIBS) $(WAYLAND_CLIENT_LIBS) $(LIBXML2_LIBS) \
1569         $(IVI_EXTENSION_PROTOCOL_LIBS) \
1570         $(AUL_LIBS) $(AIL_CFLAGS) -lico-uxf-weston-plugin
1571 endif
1572
1573 SYSTEMCTL_PLUGIN_LOADER  = linkedin-system-controller-loader.c
1574
1575 if !DISABLED_PLUGIN_SYSTEMCTL
1576 if BUILTIN_PLUGIN_SYSTEMCTL
1577 LINKEDIN_PLUGINS             += libmurphy-plugin-system-controller.la
1578 lib_LTLIBRARIES              += libmurphy-plugin-system-controller.la
1579 SYSTEMCTL_PLUGIN_CFLAGS += $(BUILTIN_CFLAGS)
1580
1581
1582 libmurphy_plugin_system_controller_ladir =                              \
1583                 $(includedir)/murphy/system-controller
1584
1585 libmurphy_plugin_system_controller_la_SOURCES =                         \
1586                 $(SYSTEMCTL_PLUGIN_SOURCES)                             \
1587                 $(SYSTEMCTL_PLUGIN_LOADER)
1588
1589 libmurphy_plugin_system_controller_la_CFLAGS =                          \
1590                 $(SYSTEMCTL_PLUGIN_CFLAGS)                              \
1591                 $(AM_CFLAGS)                                            \
1592                 $(TZCONFIG_CFLAGS)
1593
1594 libmurphy_plugin_system_controller_la_LDFLAGS =                         \
1595                 -Wl,-version-script=linker-script.system-controller     \
1596                 -version-info @MURPHY_VERSION_INFO@
1597
1598 libmurphy_plugin_system_controller_la_LIBADD =          \
1599                 libmurphy-core.la                       \
1600                 libmurphy-common.la                     \
1601                 $(SYSTEMCTL_PLUGIN_LIBS)
1602
1603 libmurphy_plugin_system_controller_la_DEPENDENCIES =    \
1604                 linker-script.system-controller         \
1605         $(filter %.la, $(libmurphy_plugin_system_controller_la_LIBADD))
1606 else
1607 plugin_system_controller_la_SOURCES = $(SYSTEMCTL_PLUGIN_SOURCES)
1608 plugin_system_controller_la_CFLAGS  = $(SYSTEMCTL_PLUGIN_CFLAGS) \
1609                                    $(MURPHY_CFLAGS) $(AM_CFLAGS)
1610 plugin_system_controller_la_LDFLAGS = -module -avoid-version
1611 plugin_system_controller_la_LIBADD  = $(SYSTEMCTL_PLUGIN_LIBS)
1612 plugin_LTLIBRARIES                 += plugin-system-controller.la
1613 endif
1614 endif
1615
1616 # linkedin system-controller plugin linker script generation
1617 linker-script.system-controller: $(SYSTEMCTL_PLUGIN_LOADER:%.c=%.h)
1618         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
1619                 -c "$(libmurphy_plugin_system_controller_la_CFLAGS)" -o $@ $^
1620
1621 clean-linker-script::
1622         -rm -f linker-script.system-controller
1623
1624 generate-linker-scripts: linker-script.system-controller
1625 endif
1626
1627 # system-monitor
1628 if SYSMON_ENABLED
1629 SYSMON_PLUGIN_SOURCES =                                         \
1630         plugins/system-monitor/plugin-system-monitor.c          \
1631         plugins/system-monitor/system-monitor.c                 \
1632         plugins/system-monitor/cpu-watch.c                      \
1633         plugins/system-monitor/cpu-sampler.c                    \
1634         plugins/system-monitor/mem-watch.c                      \
1635         plugins/system-monitor/mem-sampler.c                    \
1636         plugins/system-monitor/cgroup.c
1637
1638
1639 SYSMON_PLUGIN_CFLAGS  = -I$(top_builddir)/src/plugins/system-monitor
1640 SYSMON_PLUGIN_LIBS    = -lm
1641
1642 SYSMON_PLUGIN_LOADER  = linkedin-system-monitor-loader.c
1643
1644 if !DISABLED_PLUGIN_SYSMON
1645 if BUILTIN_PLUGIN_SYSMON
1646 LINKEDIN_PLUGINS     += libmurphy-plugin-system-monitor.la
1647 lib_LTLIBRARIES      += libmurphy-plugin-system-monitor.la
1648 SYSMON_PLUGIN_CFLAGS += $(BUILTIN_CFLAGS)
1649
1650
1651 libmurphy_plugin_system_monitor_ladir =                                 \
1652                 $(includedir)/murphy/system-monitor
1653
1654 libmurphy_plugin_system_monitor_la_SOURCES =                            \
1655                 $(SYSMON_PLUGIN_SOURCES)                                \
1656                 $(SYSMON_PLUGIN_LOADER)
1657
1658 libmurphy_plugin_system_monitor_la_CFLAGS =                             \
1659                 $(SYSMON_PLUGIN_CFLAGS)                                 \
1660                 $(AM_CFLAGS)
1661
1662 libmurphy_plugin_system_monitor_la_LDFLAGS =                            \
1663                 -Wl,-version-script=linker-script.system-monitor        \
1664                 -version-info @MURPHY_VERSION_INFO@
1665
1666 libmurphy_plugin_system_monitor_la_LIBADD =                             \
1667                 libmurphy-core.la                                       \
1668                 libmurphy-common.la                                     \
1669                 $(SYSMON_PLUGIN_LIBS)
1670
1671 libmurphy_plugin_system_monitor_la_DEPENDENCIES =                       \
1672                 linker-script.system-monitor                            \
1673         $(filter %.la, $(libmurphy_plugin_system_monitor_la_LIBADD))
1674 else
1675 plugin_system_monitor_la_SOURCES = $(SYSMON_PLUGIN_SOURCES)
1676 plugin_system_monitor_la_CFLAGS  = $(SYSMON_PLUGIN_CFLAGS)              \
1677                                    $(MURPHY_CFLAGS) $(AM_CFLAGS)
1678 plugin_system_monitor_la_LDFLAGS = -module -avoid-version
1679 plugin_system_monitor_la_LIBADD  = $(SYSMON_PLUGIN_LIBS)
1680 plugin_LTLIBRARIES                 += plugin-system-monitor.la
1681 endif
1682 endif
1683
1684 # linkedin system-monitor plugin linker script generation
1685 linker-script.system-monitor: $(SYSMON_PLUGIN_LOADER:%.c=%.h)
1686         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linker-script -q \
1687                 -c "$(libmurphy_plugin_system_monitor_la_CFLAGS)" -o $@ $^
1688
1689 clean-linker-script::
1690         -rm -f linker-script.system-monitor
1691
1692 generate-linker-scripts: linker-script.system-monitor
1693 endif
1694
1695 # telephony plugin
1696 TELEPHONY_PLUGIN_SOURCES =  plugins/plugin-telephony.c          \
1697                             plugins/telephony/telephony.c       \
1698                             plugins/telephony/utils.c           \
1699                             plugins/telephony/ofono.c           \
1700                             plugins/telephony/resctl.c
1701
1702 #TELEPHONY_PLUGIN_HEADERS =  plugins/telephony/telephony.h
1703 TELEPHONY_PLUGIN_CFLAGS  = $(LIBDBUS_CFLAGS)
1704 TELEPHONY_PLUGIN_LIBS    =
1705 #TELEPHONY_PLUGINdir     = $(includedir)/murphy/telephony
1706
1707 if TELEPHONY_ENABLED
1708 if BUILTIN_PLUGIN_TELEPHONY
1709 BUILTIN_PLUGINS += $(TELEPHONY_PLUGIN_SOURCES)
1710 BUILTIN_CFLAGS  += $(TELEPHONY_PLUGIN_CFLAGS)
1711 BUILTIN_LIBS    += $(TELEPHONY_PLUGIN_LIBS)
1712 else
1713 plugin_telephony_la_SOURCES = $(TELEPHONY_PLUGIN_SOURCES)
1714 #plugin_telephony_la_HEADERS = $(TELEPHONY_PLUGIN_HEADERS)
1715 plugin_telephony_la_CFLAGS  = $(TELEPHONY_PLUGIN_CFLAGS) $(MURPHY_CFLAGS) $(AM_CFLAGS)
1716 plugin_telephony_la_LDFLAGS = -module -Wl,-version-script=linker-script.plugin-telephony \
1717                                -version-info @MURPHY_VERSION_INFO@
1718 plugin_telephony_la_LIBADD  = $(TELEPHONY_PLUGIN_LIBS)
1719 plugin_telephony_ladir      = $(TELEPHONY_PLUGINdir)
1720
1721 plugin_LTLIBRARIES    += plugin-telephony.la
1722 endif
1723 endif
1724
1725 # Audio Session Manager plugin
1726 RESOURCE_ASM_PLUGIN_SOURCES = plugins/plugin-resource-asm.c
1727 RESOURCE_ASM_PLUGIN_CFLAGS  = $(AUDIO_SESSION_MANAGER_CFLAGS)
1728 RESOURCE_ASM_PLUGIN_LIBS    =
1729
1730 if AUL_ENABLED
1731 RESOURCE_ASM_PLUGIN_CFLAGS  += $(AUL_CFLAGS) -DAUL
1732 RESOURCE_ASM_PLUGIN_LIBS    += $(AUL_LIBS)
1733 endif
1734
1735 if RESOURCE_ASM_ENABLED
1736
1737 if !DISABLED_PLUGIN_RESOURCE_ASM
1738
1739 if BUILTIN_PLUGIN_RESOURCE_ASM
1740 BUILTIN_PLUGINS += $(RESOURCE_ASM_PLUGIN_SOURCES)
1741 BUILTIN_CFLAGS  += $(RESOURCE_ASM_PLUGIN_CFLAGS)
1742 BUILTIN_LIBS    += $(RESOURCE_ASM_PLUGIN_LIBS)
1743 else
1744 plugin_resource_asm_la_SOURCES = $(RESOURCE_ASM_PLUGIN_SOURCES)
1745 plugin_resource_asm_la_CFLAGS  = $(RESOURCE_ASM_PLUGIN_CFLAGS) $(MURPHY_CFLAGS) $(AM_CFLAGS)
1746 plugin_resource_asm_la_LDFLAGS = -module -avoid-version
1747 plugin_resource_asm_la_LIBADD  = $(RESOURCE_ASM_PLUGIN_LIBS)
1748
1749 plugin_LTLIBRARIES    += plugin-resource-asm.la
1750 endif
1751 SUBDIRS += plugins/resource-asm
1752 endif
1753
1754 endif
1755
1756 ###################################
1757 # murphy daemon
1758 #
1759
1760 bin_PROGRAMS += murphyd
1761 EXTRA_DIST   += $(config_DATA)
1762 configdir     = $(sysconfdir)/murphy
1763 config_DATA   = $(shell ls daemon/sample-config/*.{cfg,rules})
1764
1765 murphyd_SOURCES =                       \
1766                 daemon/daemon.c         \
1767                 daemon/config.c         \
1768                 $(BUILTIN_PLUGINS)      \
1769                 load-linkedin-plugins.c
1770
1771 murphyd_CFLAGS  =                       \
1772                 $(AM_CFLAGS)            \
1773                 $(BUILTIN_CFLAGS)       \
1774                 $(JSON_CFLAGS)
1775
1776 murphyd_LDADD  =                                \
1777                 $(BUILTIN_LIBS)                 \
1778                 $(LINKEDIN_PLUGINS)             \
1779                 $(RESOURCE_LIBRARY)             \
1780                 libmurphy-resolver.la           \
1781                 libmurphy-lua-decision.la       \
1782                 libmurphy-core.la               \
1783                 libmurphy-lua-utils.la          \
1784                 libmurphy-common.la             \
1785                 $(JSON_LIBS)
1786
1787 if LIBDBUS_ENABLED
1788 murphyd_LDADD +=                                \
1789                 libmurphy-dbus-libdbus.la       \
1790                 -lrt $(LIBDBUS_LIBS)
1791 endif
1792
1793
1794 murphyd_LDFLAGS = -rdynamic
1795
1796 install-data-hook::
1797         rm -f $(DESTDIR)/$(sysconfdir)/murphy/murphy.cfg
1798         echo "load-plugin lua config=\"$(sysconfdir)/murphy/main.cfg\"" \
1799             > $(DESTDIR)/$(sysconfdir)/murphy/murphy.conf
1800
1801 ###################################
1802 # linkedin (DSO) loader generation
1803 #
1804
1805 linkedin-%-loader.c:
1806         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linkedin-loader \
1807             -p $(shell echo $@ | \
1808                 sed 's/linkedin-//g;s/-loader.c//g') -o $@
1809
1810 linkedin-%-loader.h:
1811         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linkedin-loader \
1812             -p $(shell echo $@ | \
1813                 sed 's/linkedin-//g;s/-loader.h//g') -o $@
1814
1815 load-linkedin-plugins.c:
1816         $(QUIET_GEN)$(top_builddir)/build-aux/gen-linkedin-loader \
1817             -o $@ -d $(shell echo $(LINKEDIN_PLUGINS) | \
1818                            sed 's/.*plugin-//g;s/\.[^\.]*$$//g')
1819
1820 clean-local::
1821         -rm -f linkedin-*-loader.[hc] load-linkedin-plugins.c
1822
1823 ###################################
1824 # murphy console client
1825 #
1826
1827 if CONSOLE_ENABLED
1828 bin_PROGRAMS += murphy-console
1829
1830 murphy_console_SOURCES =                \
1831                 console-client/client.c
1832
1833 murphy_console_CFLAGS  =                \
1834                 $(AM_CFLAGS)
1835
1836 murphy_console_LDADD  =                 \
1837                 libbreedline-murphy.la  \
1838                 libbreedline.la         \
1839                 libmurphy-common.la
1840
1841 if LIBDBUS_ENABLED
1842 murphy_console_LDADD += libmurphy-dbus-libdbus.la
1843 endif
1844
1845 murphy_console_LDFLAGS = -rdynamic
1846 endif
1847
1848 # cleanup
1849 clean-local:: # clean-linker-script
1850         -rm -f *~