xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>,
	Wei Liu <wei.liu2@citrix.com>, David Scot <dave@recoil.org>
Subject: [PATCH 1/2] oxenstored: generate a paths module
Date: Fri, 10 Jun 2016 15:25:45 +0100	[thread overview]
Message-ID: <1465568746-27916-2-git-send-email-wei.liu2@citrix.com> (raw)
In-Reply-To: <1465568746-27916-1-git-send-email-wei.liu2@citrix.com>

That file includes all paths generated by configure. It will be used to
get rid of hard-coded paths in code.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: David Scot <dave@recoil.org>

The paths module is the first one in object list so that it gets built
first. This seems to be the practice for managing dependency in
oxenstored?
---
 .gitignore                     |  1 +
 tools/ocaml/Makefile.rules     | 11 +++++++++++
 tools/ocaml/xenstored/Makefile |  6 ++++++
 3 files changed, 18 insertions(+)

diff --git a/.gitignore b/.gitignore
index 1494c58..8e0a177 100644
--- a/.gitignore
+++ b/.gitignore
@@ -350,6 +350,7 @@ tools/ocaml/libs/xentoollog/xentoollog.ml
 tools/ocaml/libs/xentoollog/xentoollog.mli
 tools/ocaml/xenstored/oxenstored
 tools/ocaml/xenstored/oxenstored.conf
+tools/ocaml/xenstored/paths.ml
 tools/ocaml/test/xtl
 tools/ocaml/test/send_debug_keys
 tools/ocaml/test/list_domains
diff --git a/tools/ocaml/Makefile.rules b/tools/ocaml/Makefile.rules
index 1796060..a893c42 100644
--- a/tools/ocaml/Makefile.rules
+++ b/tools/ocaml/Makefile.rules
@@ -95,3 +95,14 @@ $(foreach lib,$(OCAML_LIBRARY),$(eval $(call OCAML_LIBRARY_template,$(lib))))
 $(foreach lib,$(OCAML_NOC_LIBRARY),$(eval $(call OCAML_NOC_LIBRARY_template,$(lib))))
 $(foreach p,$(OCAML_PROGRAM),$(eval $(call OCAML_PROGRAM_template,$(p))))
 $(foreach p,$(C_PROGRAM),$(eval $(call C_PROGRAM_template,$(p))))
+
+buildmakevars2module = $(eval $(call buildmakevars2module-closure,$(1)))
+define buildmakevars2module-closure
+    $(1): .phony
+	rm -f $(1).tmp; \
+	$(foreach var, $(BUILD_MAKE_VARS), \
+	          printf "let %s = \"%s\";;\n" \
+                      $(shell echo $(var) | tr '[:upper:]' '[:lower:]') \
+                      $($(var)) >>$(1).tmp;) \
+	$(call move-if-changed,$(1).tmp,$(1))
+endef
diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index dce9e70..40aa288 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -33,6 +33,7 @@ OCAML_LIBRARY += systemd
 LIBS_systemd += $(LDFLAGS-y)
 
 OBJS = define \
+	paths \
 	stdext \
 	trie \
 	config \
@@ -87,3 +88,8 @@ install: all
 	$(INSTALL_DATA) oxenstored.conf $(DESTDIR)$(XEN_CONFIG_DIR)
 
 include $(OCAML_TOPLEVEL)/Makefile.rules
+
+genpath-target = $(call buildmakevars2module,paths.ml)
+$(eval $(genpath-target))
+
+GENERATED_FILES += paths.ml
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-06-10 14:25 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-09 12:57 [PATCH 00/11] Honour XEN_{LOG, RUN}_DIR in various places Wei Liu
2016-06-09 12:57 ` [PATCH 01/11] Config.mk: add XEN_LOG_DIR to BUILD_MAKE_VARS Wei Liu
2016-06-09 15:46   ` Ian Jackson
2016-06-09 12:57 ` [PATCH 02/11] docs: use XEN_LOG_DIR in log file location Wei Liu
2016-06-09 15:47   ` Ian Jackson
2016-06-09 15:51     ` Wei Liu
2016-06-09 12:57 ` [PATCH 03/11] tools: install XEN_{LOG,RUN}_DIR Wei Liu
2016-06-09 13:13   ` Andrew Cooper
2016-06-09 14:04     ` Wei Liu
2016-06-09 15:47   ` Ian Jackson
2016-06-09 12:57 ` [PATCH 04/11] xenconsoled: honour XEN_LOG_DIR and remove hard-coded path Wei Liu
2016-06-09 15:47   ` Ian Jackson
2016-06-09 12:57 ` [PATCH 05/11] xenbackendd: honour XEN_{RUN,LOG}_DIR Wei Liu
2016-06-09 15:48   ` [PATCH 05/11] xenbackendd: honour XEN_{RUN, LOG}_DIR Ian Jackson
2016-06-09 12:57 ` [PATCH 06/11] libxc: honour XEN_LOG_DIR in xc_dom_core.c Wei Liu
2016-06-09 15:48   ` Ian Jackson
2016-06-09 12:57 ` [PATCH 07/11] hotplug/FreeBSD: honour XEN_{LOG, RUN}_DIR Wei Liu
2016-06-09 15:19   ` Roger Pau Monné
2016-06-09 15:49   ` Ian Jackson
2016-06-09 12:57 ` [PATCH 08/11] hotplug/Linux: honour XEN_LOG_DIR Wei Liu
2016-06-09 15:19   ` Roger Pau Monné
2016-06-09 15:49   ` Ian Jackson
2016-06-09 12:57 ` [PATCH 09/11] hotplug/NetBSD: honour XEN_{LOG, RUN}_DIR Wei Liu
2016-06-09 15:20   ` Roger Pau Monné
2016-06-09 15:49   ` Ian Jackson
2016-06-09 12:57 ` [PATCH 10/11] libxl: honour XEN_LOG_DIR Wei Liu
2016-06-09 15:45   ` Ian Jackson
2016-06-09 12:57 ` [PATCH 11/11] oxenstored: honour XEN_{LOG, RUN}_DIR in oxenstored.conf Wei Liu
2016-06-09 15:51   ` Ian Jackson
2016-06-09 20:38     ` David Scott
2016-06-10  9:45       ` Wei Liu
2016-06-10  9:49       ` Wei Liu
2016-06-10 14:25       ` [PATCH 0/2] Ocaml: get rid of hard-coded paths in source code Wei Liu
2016-06-10 14:25         ` Wei Liu [this message]
2016-06-10 20:27           ` [PATCH 1/2] oxenstored: generate a paths module David Scott
2016-06-10 14:25         ` [PATCH 2/2] oxenstored: honour XEN_LOG_DIR defined by configure Wei Liu
2016-06-10 18:44           ` Wei Liu
2016-06-10 20:26             ` David Scott
2016-06-13  6:52               ` Wei Liu
2016-06-09 13:16 ` [PATCH 00/11] Honour XEN_{LOG, RUN}_DIR in various places Andrew Cooper
2016-06-09 16:53 ` Anthony PERARD
2016-06-09 16:56   ` 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=1465568746-27916-2-git-send-email-wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=dave@recoil.org \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    --subject='Re: [PATCH 1/2] oxenstored: generate a paths module' \
    /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

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).