aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile.am122
1 files changed, 88 insertions, 34 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index b2cf3df..2aff220 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,36 +1,90 @@
+BUILT_SOURCES =
+EXTRA_DIST =
CLEANFILES =
-ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-
-###################
-# Indicator Stuff
-###################
-
-powerlibdir = $(INDICATORDIR)
-powerlib_LTLIBRARIES = libpower.la
-
-libpower_la_SOURCES = \
- dbus-listener.c \
- dbus-listener.h \
- device.c \
- device.h \
- indicator-power.h \
- indicator-power.c
-
-CLEANFILES += .libs/*.gcda .libs/*.gcno *.gcda *.gcno
-
-libpower_la_CFLAGS = \
- $(UPOWER_CFLAGS) \
- $(INDICATOR_CFLAGS) \
- $(COVERAGE_CFLAGS) \
- -Wall -Werror \
- -DG_LOG_DOMAIN=\"Indicator-Power\"
-
-libpower_la_LIBADD = \
- $(UPOWER_LIBS) \
- $(INDICATOR_LIBS)
-
-libpower_la_LDFLAGS = \
- $(COVERAGE_LDFLAGS) \
- -module \
- -avoid-version
+
+SHARED_CFLAGS = \
+ -Wall -Werror \
+ $(SERVICE_DEPS_CFLAGS) \
+ -DG_LOG_DOMAIN=\"Indicator-Power\"
+
+###
+###
+
+upower_dbus_sources = \
+ dbus-upower.c \
+ dbus-upower.h
+
+$(upower_dbus_sources): org.freedesktop.UPower.xml
+ $(AM_V_GEN) gdbus-codegen \
+ --c-namespace Dbus \
+ --interface-prefix org.freedesktop \
+ --generate-c-code dbus-upower \
+ $^
+
+BUILT_SOURCES += $(upower_dbus_sources)
+CLEANFILES += $(upower_dbus_sources)
+EXTRA_DIST += org.freedesktop.UPower.xml
+
+###
+###
+
+upower_device_dbus_sources = \
+ dbus-upower-device.c \
+ dbus-upower-device.h
+
+$(upower_device_dbus_sources): org.freedesktop.UPower.Device.xml
+ $(AM_V_GEN) gdbus-codegen \
+ --c-namespace Dbus \
+ --interface-prefix org.freedesktop.UPower \
+ --generate-c-code dbus-upower-device \
+ $^
+
+BUILT_SOURCES += $(upower_device_dbus_sources)
+CLEANFILES += $(upower_device_dbus_sources)
+EXTRA_DIST += org.freedesktop.UPower.Device.xml
+
+###
+###
+###
+
+noinst_LIBRARIES = libindicatorpower-upower.a libindicatorpower-service.a
+
+libindicatorpower_upower_a_SOURCES = \
+ $(upower_dbus_sources) \
+ $(upower_device_dbus_sources) \
+ device-provider-upower.c \
+ device-provider-upower.h
+
+libindicatorpower_upower_a_CFLAGS = $(SHARED_CFLAGS) -Wextra -Wno-unused-parameter
+
+libindicatorpower_service_a_SOURCES = \
+ device-provider.c \
+ device-provider.h \
+ device.c \
+ device.h \
+ service.c \
+ service.h
+
+libindicatorpower_service_a_CFLAGS = $(SHARED_CFLAGS)
+
+###
+###
+###
+
+libexec_PROGRAMS = indicator-power-service
+
+indicator_power_service_SOURCES = main.c
+
+indicator_power_service_CFLAGS = \
+ $(SHARED_CFLAGS) \
+ -Wextra -Wno-missing-field-initializers
+
+indicator_power_service_LDADD = \
+ libindicatorpower-upower.a \
+ libindicatorpower-service.a \
+ $(SERVICE_DEPS_LIBS)
+
+indicator_power_service_LDFLAGS = \
+ $(COVERAGE_LDFLAGS)
+