From: Wei Liu <wei.liu2@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: yi.y.sun@linux.intel.com, Ian Jackson <Ian.Jackson@eu.citrix.com>,
Wei Liu <wei.liu2@citrix.com>,
zhangchen.fnst@cn.fujitsu.com, haozhong.zhang@intel.com
Subject: [PATCH 2/2] tools: move xl to a dedicated directory
Date: Tue, 21 Feb 2017 15:51:42 +0000 [thread overview]
Message-ID: <20170221155142.17288-3-wei.liu2@citrix.com> (raw)
In-Reply-To: <20170221155142.17288-1-wei.liu2@citrix.com>
It makes clear distinction between the client (xl) and library (libxl),
which should help design better APIs. This will also help reduce the
code size in libxl directory.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
.gitignore | 2 +-
tools/libxl/Makefile | 22 ++++---------------
tools/xl/Makefile | 43 +++++++++++++++++++++++++++++++++++++
tools/{libxl => xl}/bash-completion | 0
tools/{libxl => xl}/xl.c | 0
tools/{libxl => xl}/xl.h | 0
tools/{libxl => xl}/xl_cmdimpl.c | 0
tools/{libxl => xl}/xl_cmdtable.c | 0
tools/{libxl => xl}/xl_sxp.c | 0
9 files changed, 48 insertions(+), 19 deletions(-)
create mode 100644 tools/xl/Makefile
rename tools/{libxl => xl}/bash-completion (100%)
rename tools/{libxl => xl}/xl.c (100%)
rename tools/{libxl => xl}/xl.h (100%)
rename tools/{libxl => xl}/xl_cmdimpl.c (100%)
rename tools/{libxl => xl}/xl_cmdtable.c (100%)
rename tools/{libxl => xl}/xl_sxp.c (100%)
diff --git a/.gitignore b/.gitignore
index c8d56d1bdb..a785006e44 100644
--- a/.gitignore
+++ b/.gitignore
@@ -189,7 +189,6 @@ tools/libxl/ssdt*
tools/libxl/testenum
tools/libxl/testenum.c
tools/libxl/tmp.*
-tools/libxl/xl
tools/misc/cpuperf/cpuperf-perfcntr
tools/misc/cpuperf/cpuperf-xen
tools/misc/xc_shadow
@@ -380,6 +379,7 @@ tools/firmware/etherboot/ipxe/
tools/python/xen/lowlevel/xl/_pyxl_types.c
tools/python/xen/lowlevel/xl/_pyxl_types.h
tools/xenstore/xenstore-watch
+tools/xl/xl
docs/txt/misc/*.txt
docs/txt/man/*.txt
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 0f642cc57a..f00d9ef355 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -178,16 +178,9 @@ LIBXLU_OBJS = libxlu_cfg_y.o libxlu_cfg_l.o libxlu_cfg.o \
libxlu_disk_l.o libxlu_disk.o libxlu_vif.o libxlu_pci.o
$(LIBXLU_OBJS): CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h
-CLIENTS = xl testidl libxl-save-helper
+$(TEST_PROG_OBJS) _libxl.api-for-check: CFLAGS += $(CFLAGS_libxentoollog)
-CFLAGS_XL += $(CFLAGS_libxenlight)
-CFLAGS_XL += -Wshadow
-
-XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o
-$(XL_OBJS) $(TEST_PROG_OBJS) _libxl.api-for-check: \
- CFLAGS += $(CFLAGS_libxentoollog)
-$(XL_OBJS): CFLAGS += $(CFLAGS_XL)
-$(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs it.
+CLIENTS = testidl libxl-save-helper
libxl_dom.o: CFLAGS += -I$(XEN_ROOT)/tools # include libacpi/x86.h
libxl_x86_acpi.o: CFLAGS += -I$(XEN_ROOT)/tools
@@ -207,7 +200,7 @@ all: $(CLIENTS) $(TEST_PROGS) $(PKG_CONFIG) \
libxenlight.so libxenlight.a libxlutil.so libxlutil.a \
$(AUTOSRCS) $(AUTOINCS)
-$(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS) $(SAVE_HELPER_OBJS) \
+$(LIBXL_OBJS) $(LIBXLU_OBJS) $(SAVE_HELPER_OBJS) \
$(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS): \
$(AUTOINCS) libxl.api-ok
@@ -249,7 +242,7 @@ libxl_internal_json.h: _libxl_types_internal_json.h
xl.h: _paths.h
$(LIBXL_OBJS) $(LIBXL_TEST_OBJS) $(LIBXLU_OBJS) \
- $(XL_OBJS) $(TEST_PROG_OBJS) $(SAVE_HELPER_OBJS): libxl.h
+ $(TEST_PROG_OBJS) $(SAVE_HELPER_OBJS): libxl.h
$(LIBXL_OBJS) $(LIBXL_TEST_OBJS): libxl_internal.h
_libxl_type%.h _libxl_type%_json.h _libxl_type%_private.h _libxl_type%.c: libxl_type%.idl gentypes.py idl.py
@@ -288,9 +281,6 @@ libxlutil.so.$(XLUMAJOR).$(XLUMINOR): $(LIBXLU_OBJS) libxenlight.so
libxlutil.a: $(LIBXLU_OBJS)
$(AR) rcs libxlutil.a $^
-xl: $(XL_OBJS) libxlutil.so libxenlight.so
- $(CC) $(LDFLAGS) -o $@ $(XL_OBJS) $(LDLIBS_libxlutil) $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
-
test_%: test_%.o test_common.o libxlutil.so libxenlight_test.so
$(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenlight)) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
@@ -306,13 +296,10 @@ $(PKG_CONFIG): % : %.in Makefile
.PHONY: install
install: all
- $(INSTALL_DIR) $(DESTDIR)$(sbindir)
$(INSTALL_DIR) $(DESTDIR)$(libdir)
$(INSTALL_DIR) $(DESTDIR)$(includedir)
- $(INSTALL_DIR) $(DESTDIR)$(BASH_COMPLETION_DIR)
$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
$(INSTALL_DIR) $(DESTDIR)$(PKG_INSTALLDIR)
- $(INSTALL_PROG) xl $(DESTDIR)$(sbindir)
$(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(LIBEXEC_BIN)
$(INSTALL_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
$(SYMLINK_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenlight.so.$(MAJOR)
@@ -323,7 +310,6 @@ install: all
$(SYMLINK_SHLIB) libxlutil.so.$(XLUMAJOR) $(DESTDIR)$(libdir)/libxlutil.so
$(INSTALL_DATA) libxlutil.a $(DESTDIR)$(libdir)
$(INSTALL_DATA) libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_types_json.h _libxl_list.h libxl_utils.h libxl_uuid.h libxlutil.h $(DESTDIR)$(includedir)
- $(INSTALL_DATA) bash-completion $(DESTDIR)$(BASH_COMPLETION_DIR)/xl.sh
$(INSTALL_DATA) xenlight.pc $(DESTDIR)$(PKG_INSTALLDIR)
$(INSTALL_DATA) xlutil.pc $(DESTDIR)$(PKG_INSTALLDIR)
diff --git a/tools/xl/Makefile b/tools/xl/Makefile
new file mode 100644
index 0000000000..32dff40584
--- /dev/null
+++ b/tools/xl/Makefile
@@ -0,0 +1,43 @@
+#
+# tools/xl/Makefile
+#
+
+XEN_ROOT = $(CURDIR)/../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
+ -Wno-declaration-after-statement -Wformat-nonliteral
+CFLAGS += -I. -fPIC
+
+CFLAGS += $(PTHREAD_CFLAGS)
+LDFLAGS += $(PTHREAD_LDFLAGS)
+
+CFLAGS_XL += $(CFLAGS_libxenlight)
+CFLAGS_XL += -Wshadow
+
+XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o
+$(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog)
+$(XL_OBJS): CFLAGS += $(CFLAGS_XL)
+$(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs it.
+
+.PHONY: all
+all: xl
+
+xl: $(XL_OBJS)
+ $(CC) $(LDFLAGS) -o $@ $(XL_OBJS) $(LDLIBS_libxlutil) $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
+
+.PHONY: install
+install: all
+ $(INSTALL_DIR) $(DESTDIR)$(sbindir)
+ $(INSTALL_DIR) $(DESTDIR)$(BASH_COMPLETION_DIR)
+ $(INSTALL_PROG) xl $(DESTDIR)$(sbindir)
+ $(INSTALL_DATA) bash-completion $(DESTDIR)$(BASH_COMPLETION_DIR)/xl.sh
+
+.PHONY: clean
+clean:
+ $(RM) -f *.o xl $(DEPS)
+
+distclean: clean
+
+
+-include $(DEPS)
diff --git a/tools/libxl/bash-completion b/tools/xl/bash-completion
similarity index 100%
rename from tools/libxl/bash-completion
rename to tools/xl/bash-completion
diff --git a/tools/libxl/xl.c b/tools/xl/xl.c
similarity index 100%
rename from tools/libxl/xl.c
rename to tools/xl/xl.c
diff --git a/tools/libxl/xl.h b/tools/xl/xl.h
similarity index 100%
rename from tools/libxl/xl.h
rename to tools/xl/xl.h
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/xl/xl_cmdimpl.c
similarity index 100%
rename from tools/libxl/xl_cmdimpl.c
rename to tools/xl/xl_cmdimpl.c
diff --git a/tools/libxl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c
similarity index 100%
rename from tools/libxl/xl_cmdtable.c
rename to tools/xl/xl_cmdtable.c
diff --git a/tools/libxl/xl_sxp.c b/tools/xl/xl_sxp.c
similarity index 100%
rename from tools/libxl/xl_sxp.c
rename to tools/xl/xl_sxp.c
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-02-21 15:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-21 15:51 [PATCH 0/2] tools: split xl into a separate directory Wei Liu
2017-02-21 15:51 ` [PATCH 1/2] tools: provide libxlutil compiling and linking options Wei Liu
2017-02-21 15:51 ` Wei Liu [this message]
2017-02-23 12:17 ` [PATCH 0/2] tools: split xl into a separate directory Ian Jackson
2017-02-23 13:20 ` Wei Liu
2017-02-23 14:55 ` Wei Liu
2017-02-23 15:54 ` Ian Jackson
2017-02-23 15:57 ` Wei Liu
2017-02-23 16:29 ` Ian Jackson
2017-02-23 16:59 ` Wei Liu
2017-02-23 17:01 ` Wei Liu
2017-02-23 17:25 ` Ian Jackson
2017-02-23 17:27 ` Wei Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170221155142.17288-3-wei.liu2@citrix.com \
--to=wei.liu2@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=haozhong.zhang@intel.com \
--cc=xen-devel@lists.xenproject.org \
--cc=yi.y.sun@linux.intel.com \
--cc=zhangchen.fnst@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).