Index: Makefile |
diff --git a/Makefile b/Makefile |
index 03e1930f336c451d6161feeb0919e1b7fc95ad7c..81211513a392af3b01b14d754e0ae8b02fde87ae 100644 |
--- a/Makefile |
+++ b/Makefile |
@@ -10,19 +10,28 @@ |
include common.mk |
PKG_CONFIG ?= pkg-config |
+DBUSXX_XML2CPP = dbusxx-xml2cpp |
-INCLUDE_DIRS = -I.. $(shell $(PKG_CONFIG) --cflags dbus-1 dbus-glib-1\ |
+INCLUDE_DIRS = -I.. -I$(OUT)include $(shell $(PKG_CONFIG) --cflags dbus-1 dbus-glib-1\ |
dbus-c++-1 glib-2.0) |
LIB_DIRS = $(shell $(PKG_CONFIG) --libs dbus-1 dbus-glib-1 dbus-c++-1 glib-2.0) |
CFLAGS := -Iinclude $(CFLAGS) |
CXXFLAGS := -Iinclude -I../ $(INCLUDE_DIRS) $(CXXFLAGS) |
-LDFLAGS += -lbase -lgflags -lmetrics $(LIB_DIRS) |
+LDFLAGS += -lbase -lgflags -lmetrics -ludev $(LIB_DIRS) |
-disks: $(OUT)disks |
+$(OUT)include/cros-disks-server.h: cros-disks.xml |
+ mkdir -p $(OUT)include |
+ $(DBUSXX_XML2CPP) cros-disks.xml --adaptor=$@ |
+RM_ON_CLEAN += $(OUT)include/cros-disks-server.h |
$(OUT)disks: $(filter-out %_testrunner.o %_unittest.o,$(C_OBJECTS)) \ |
+ $(OUT)include/cros-disks-server.h \ |
$(CXX_OBJECTS) |
$(call cxx_binary) |
all: $(OUT)disks |
RM_ON_CLEAN += $(OUT)disks |
+ |
+# Some shortcuts |
+disks: $(OUT)disks |
+dbus-headers: $(OUT)include/cros-disks-server.h |