[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 5/5] tests/xenstore: Rework Makefile


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 15 Jun 2021 17:19:05 +0100
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Tue, 15 Jun 2021 16:20:17 +0000
  • Ironport-hdrordr: A9a23:0lTbQq31AEh6IFNLlqwSTAqjBIokLtp133Aq2lEZdPRUGvb3qy nIpoVj6faUskd2ZJhOo7C90cW7LU80sKQFhLX5Xo3SOzUO2lHYT72KhLGKq1aLdhEWtNQtsZ uIG5IOcOEYZmIasS+V2maF+q4bsbu6zJw=
  • Ironport-sdr: q5xrZZJri4rT2UW6TqANu9YkT7bgIzgR/i3TaOP9zZjx4NWlRnzChVlUfTvKm18qpmxKXuooe9 +COybCnVGTXoJL/QcxIOY7AN6QPxVjw5iFOAXei2Cqg7M6h0HRQ79oaHDGmrAv9jPLcDsEGYSS w/X3PjGkvaSWGCZQLhg84drRu7NWNfsQ+NHy/xP5gcpORzEFS1t4+yMq12azvg8kaB5DIiwIqd zLguIR0wfOUZuxoxLPdE36gHfAgJ0z5IJ64BJ8+633Kr3OzGoW6J561QIeU6DpuTx3bpK5FE75 K0Y=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

In particular, fill in the install/uninstall rules so this test can be
packaged to be automated sensibly.

Rename xs-test to test-xenstore to be consistent with other tests.  Honour
APPEND_FLAGS too.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Ian Jackson <iwj@xxxxxxxxxxxxxx>
CC: Wei Liu <wl@xxxxxxx>
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Juergen Gross <jgross@xxxxxxxx>
---
 .gitignore                                         |  1 -
 tools/tests/xenstore/.gitignore                    |  1 +
 tools/tests/xenstore/Makefile                      | 31 +++++++++++++++-------
 .../tests/xenstore/{xs-test.c => test-xenstore.c}  |  0
 4 files changed, 23 insertions(+), 10 deletions(-)
 create mode 100644 tools/tests/xenstore/.gitignore
 rename tools/tests/xenstore/{xs-test.c => test-xenstore.c} (100%)

diff --git a/.gitignore b/.gitignore
index d4b90303b2..8ebb51b6c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -275,7 +275,6 @@ tools/tests/x86_emulator/*sse*.[ch]
 tools/tests/x86_emulator/test_x86_emulator
 tools/tests/x86_emulator/x86_emulate
 tools/tests/x86_emulator/xop*.[ch]
-tools/tests/xenstore/xs-test
 tools/tests/vpci/list.h
 tools/tests/vpci/vpci.[hc]
 tools/tests/vpci/test_vpci
diff --git a/tools/tests/xenstore/.gitignore b/tools/tests/xenstore/.gitignore
new file mode 100644
index 0000000000..4b44f5dd60
--- /dev/null
+++ b/tools/tests/xenstore/.gitignore
@@ -0,0 +1 @@
+test-xenstore
diff --git a/tools/tests/xenstore/Makefile b/tools/tests/xenstore/Makefile
index a367d88803..3c7b7073fd 100644
--- a/tools/tests/xenstore/Makefile
+++ b/tools/tests/xenstore/Makefile
@@ -1,11 +1,7 @@
 XEN_ROOT=$(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += -Werror
-
-CFLAGS += $(CFLAGS_libxenstore)
-
-TARGETS-y := xs-test
+TARGETS-y := test-xenstore
 TARGETS := $(TARGETS-y)
 
 .PHONY: all
@@ -16,14 +12,31 @@ build: $(TARGETS)
 
 .PHONY: clean
 clean:
-       $(RM) *.o $(TARGETS) *~ $(DEPS_RM)
+       $(RM) -f -- *.o $(TARGETS) $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean
+       $(RM) -f -- *~
+
+.PHONY: install
+install: all
+       $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+       $(if $(TARGETS),$(INSTALL_PROG) $(TARGETS) $(DESTDIR)$(LIBEXEC_BIN))
+
+.PHONY: uninstall
+uninstall:
+       $(RM) -f -- $(addprefix $(DESTDIR)$(LIBEXEC_BIN)/,$(TARGETS))
+
+CFLAGS += -Werror
+CFLAGS += $(CFLAGS_libxenstore)
+CFLAGS += $(APPEND_CFLAGS)
+
+LDFLAGS += $(LDLIBS_libxenstore)
+LDFLAGS += $(APPEND_LDFLAGS)
 
-xs-test: xs-test.o Makefile
-       $(CC) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenstore)
+%.o: Makefile
 
-install uninstall:
+test-xenstore: test-xenstore.o
+       $(CC) -o $@ $< $(LDFLAGS)
 
 -include $(DEPS_INCLUDE)
diff --git a/tools/tests/xenstore/xs-test.c 
b/tools/tests/xenstore/test-xenstore.c
similarity index 100%
rename from tools/tests/xenstore/xs-test.c
rename to tools/tests/xenstore/test-xenstore.c
-- 
2.11.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.