@@ -133,6 +133,7 @@ tools/flask/utils/flask-loadpolicy
tools/flask/utils/flask-setenforce
tools/flask/utils/flask-set-bool
tools/flask/utils/flask-label-pci
+tools/helpers/init-xenstore-domain
tools/hotplug/common/hotplugpath.sh
tools/hotplug/FreeBSD/rc.d/xencommons
tools/hotplug/FreeBSD/rc.d/xendriverdomain
@@ -201,7 +202,6 @@ tools/xenmon/xenbaked
tools/xenpaging/xenpaging
tools/xenpmd/xenpmd
tools/xenstat/xentop/xentop
-tools/xenstore/init-xenstore-domain
tools/xenstore/xenstore
tools/xenstore/xenstore-chmod
tools/xenstore/xenstore-exists
@@ -30,6 +30,7 @@ endif
SUBDIRS-y += xenpmd
SUBDIRS-y += libxl
+SUBDIRS-y += helpers
SUBDIRS-$(CONFIG_X86) += xenpaging
SUBDIRS-$(CONFIG_X86) += debugger/gdbsx
SUBDIRS-$(CONFIG_X86) += debugger/kdd
new file mode 100644
@@ -0,0 +1,34 @@
+#
+# tools/helpers/Makefile
+#
+
+XEN_ROOT = $(CURDIR)/../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+ifeq ($(CONFIG_Linux),y)
+PROGS += init-xenstore-domain
+endif
+
+INIT_XENSTORE_DOMAIN_OBJS = init-xenstore-domain.o
+$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenguest)
+$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenctrl)
+$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenstore)
+
+.PHONY: all
+all: $(PROGS)
+
+init-xenstore-domain: $(INIT_XENSTORE_DOMAIN_OBJS)
+ $(CC) $(LDFLAGS) -o $@ $(INIT_XENSTORE_DOMAIN_OBJS) $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(APPEND_LDFLAGS)
+
+.PHONY: install
+install: all
+ $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+ifeq ($(CONFIG_Linux),y)
+ $(INSTALL_PROG) init-xenstore-domain $(DESTDIR)$(LIBEXEC_BIN)
+endif
+
+.PHONY: clean
+clean:
+ $(RM) -f *.o $(PROGS) $(DEPS)
+
+distclean: clean
similarity index 100%
rename from tools/xenstore/init-xenstore-domain.c
rename to tools/helpers/init-xenstore-domain.c
@@ -46,10 +46,6 @@ ifeq ($(XENSTORE_XENSTORED),y)
ALL_TARGETS += xs_tdb_dump xenstored
endif
-ifeq ($(CONFIG_Linux),y)
-ALL_TARGETS += init-xenstore-domain
-endif
-
ifdef CONFIG_STUBDOM
CFLAGS += -DNO_SOCKETS=1
endif
@@ -72,11 +68,6 @@ xenstored_probes.o: xenstored_solaris.o
CFLAGS += -DHAVE_DTRACE=1
endif
-init-xenstore-domain.o: CFLAGS += $(CFLAGS_libxenguest)
-
-init-xenstore-domain: init-xenstore-domain.o $(LIBXENSTORE)
- $(CC) $^ $(LDFLAGS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) -o $@ $(APPEND_LDFLAGS)
-
xenstored: $(XENSTORED_OBJS)
$(CC) $^ $(LDFLAGS) $(LDLIBS_libxenctrl) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS)