summaryrefslogtreecommitdiff
path: root/src/Makefile.am
blob: 7d7c2b4e7175ce76714a6bfc3cd83b83907cf911 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
## Process this file with automake to produce Makefile.in

INCLUDES = \
	-I$(top_builddir)/src -I$(top_srcdir)/src \
	-DPACKAGE_LIBEXEC_DIR=\""$(libexecdir)"\" \
	-DPACKAGE_SYSCONF_DIR=\""$(sysconfdir)"\" \
	-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
	-DPACKAGE_BIN_DIR=\""$(bindir)"\" \
	-DPACKAGE_LOCALSTATE_DIR=\""$(localstatedir)"\" \
	-DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
	-DPACKAGE_LIB_DIR=\""$(libdir)"\" \
	-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT	\
	-DEGG_LOG_FILE=\""$(DKP_LOG_DIR)/DeviceKit-power"\"	\
	-DEGG_VERBOSE="\"DKP_VERBOSE\""				\
	-DEGG_LOGGING="\"DKP_LOGGING\""				\
	-DEGG_CONSOLE="\"DKP_CONSOLE\""				\
	-I$(top_srcdir)/libdevkit-power \
	$(GIO_CFLAGS) \
	$(DBUS_GLIB_CFLAGS) \
	$(POLKIT_DBUS_CFLAGS) \
	$(DEVKIT_CFLAGS) \
	$(GLIB_CFLAGS)

DEVKIT_POWER_LIBS = $(top_builddir)/libdevkit-power/libdevkit-power.la

BUILT_SOURCES =							\
	dkp-daemon-glue.h					\
	dkp-device-glue.h					\
	dkp-qos-glue.h					\
	dkp-marshal.h						\
	dkp-marshal.c

dkp-marshal.h: dkp-marshal.list
	glib-genmarshal $< --prefix=dkp_marshal --header > $@

dkp-marshal.c: dkp-marshal.list
	echo "#include \"dkp-marshal.h\"" > $@ && glib-genmarshal $< --prefix=dkp_marshal --body >> $@

dkp-daemon-glue.h: org.freedesktop.DeviceKit.Power.xml Makefile.am
	dbus-binding-tool --prefix=dkp_daemon --mode=glib-server --output=dkp-daemon-glue.h org.freedesktop.DeviceKit.Power.xml

dkp-device-glue.h: org.freedesktop.DeviceKit.Power.Device.xml Makefile.am
	dbus-binding-tool --prefix=dkp_device --mode=glib-server --output=dkp-device-glue.h org.freedesktop.DeviceKit.Power.Device.xml

dkp-qos-glue.h: org.freedesktop.DeviceKit.Power.QoS.xml Makefile.am
	dbus-binding-tool --prefix=dkp_qos --mode=glib-server --output=dkp-qos-glue.h org.freedesktop.DeviceKit.Power.QoS.xml

libexec_PROGRAMS = devkit-power-daemon

dbusifdir = $(datadir)/dbus-1/interfaces
dbusif_DATA = 							\
	org.freedesktop.DeviceKit.Power.xml 			\
	org.freedesktop.DeviceKit.Power.Device.xml 		\
	org.freedesktop.DeviceKit.Power.QoS.xml

devkit_power_daemon_SOURCES = 					\
	egg-debug.c						\
	egg-debug.h						\
	dkp-daemon.h			dkp-daemon.c		\
	dkp-device.h			dkp-device.c		\
	dkp-device-list.h		dkp-device-list.c	\
	dkp-supply.h			dkp-supply.c		\
	dkp-csr.h			dkp-csr.c		\
	dkp-wup.h			dkp-wup.c		\
	dkp-hid.h			dkp-hid.c		\
	dkp-history.h			dkp-history.c		\
	sysfs-utils.h			sysfs-utils.c		\
	main.c							\
	$(BUILT_SOURCES)

devkit_power_daemon_CPPFLAGS = 					\
	-I$(top_srcdir)/src					\
	-DG_LOG_DOMAIN=\"dkp-daemon\"				\
	$(DISABLE_DEPRECATED)					\
	$(AM_CPPFLAGS)

devkit_power_daemon_LDADD = 					\
	-lm							\
	$(USB_LIBS)						\
	$(GIO_LIBS)						\
	$(DBUS_GLIB_LIBS)					\
	$(POLKIT_DBUS_LIBS)					\
	$(DEVKIT_POWER_LIBS)					\
	$(DEVKIT_LIBS)

servicedir       = $(datadir)/dbus-1/system-services
service_in_files = org.freedesktop.DeviceKit.Power.service.in
service_DATA     = $(service_in_files:.service.in=.service)

$(service_DATA): $(service_in_files) Makefile
	@sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@

dbusconfdir = $(sysconfdir)/dbus-1/system.d
dbusconf_in_files = org.freedesktop.DeviceKit.Power.conf.in
dbusconf_DATA = $(dbusconf_in_files:.conf.in=.conf)

$(dbusconf_DATA): $(dbusconf_in_files) Makefile
	cp $< $@

udevrulesdir = $(sysconfdir)/udev/rules.d
udevrules_DATA = 						\
	95-devkit-power-wup.rules        			\
	95-devkit-power-hid.rules        			\
	95-devkit-power-csr.rules

install-data-hook:
	$(mkinstalldirs) $(DESTDIR)$(localstatedir)/lib/DeviceKit-power

CLEANFILES = $(BUILT_SOURCES)

EXTRA_DIST =							\
	org.freedesktop.DeviceKit.Power.xml        		\
	org.freedesktop.DeviceKit.Power.Device.xml		\
	org.freedesktop.DeviceKit.Power.QoS.xml		\
	dkp-marshal.list					\
	95-devkit-power-csr.rules				\
	95-devkit-power-hid.rules				\
	95-devkit-power-wup.rules				\
	$(service_in_files)                        		\
	$(dbusconf_in_files)

clean-local :
	rm -f *~ $(service_DATA) $(dbusconf_DATA)