diff mbox series

[XEN,34/57] tools/xcutils: rework Makefile

Message ID 20211206170241.13165-35-anthony.perard@citrix.com (mailing list archive)
State New, archived
Headers show
Series Toolstack build system improvement, toward non-recursive makefiles | expand

Commit Message

Anthony PERARD Dec. 6, 2021, 5:02 p.m. UTC
Use TARGETS to collect targets to build

Remove "build" target.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/xcutils/Makefile | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

Comments

Andrew Cooper Dec. 16, 2021, 6:20 p.m. UTC | #1
On 06/12/2021 17:02, Anthony PERARD wrote:
> Use TARGETS to collect targets to build
>
> Remove "build" target.
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
>  tools/xcutils/Makefile | 15 ++++++---------
>  1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/tools/xcutils/Makefile b/tools/xcutils/Makefile
> index 82d42624c8..198be22a5a 100644
> --- a/tools/xcutils/Makefile
> +++ b/tools/xcutils/Makefile
> @@ -11,7 +11,7 @@
>  XEN_ROOT	= $(CURDIR)/../..
>  include $(XEN_ROOT)/tools/Rules.mk
>  
> -PROGRAMS = readnotes lsevtchn
> +TARGETS := readnotes lsevtchn

(For the future, because I'll commit this patch nowish)

We have at least

tools/xcutils
tools/misc
tools/helpers

of "misc random crap".  We ought to consolidate, and rethink which
binaries get installed where, because there is no coherent logic for
which end up on $PATH by default, and which don't.

~Andrew
diff mbox series

Patch

diff --git a/tools/xcutils/Makefile b/tools/xcutils/Makefile
index 82d42624c8..198be22a5a 100644
--- a/tools/xcutils/Makefile
+++ b/tools/xcutils/Makefile
@@ -11,7 +11,7 @@ 
 XEN_ROOT	= $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-PROGRAMS = readnotes lsevtchn
+TARGETS := readnotes lsevtchn
 
 CFLAGS += -Werror
 
@@ -19,10 +19,7 @@  CFLAGS_readnotes.o  := $(CFLAGS_libxenevtchn) $(CFLAGS_libxenctrl) $(CFLAGS_libx
 CFLAGS_lsevtchn.o   := $(CFLAGS_libxenevtchn) $(CFLAGS_libxenctrl)
 
 .PHONY: all
-all: build
-
-.PHONY: build
-build: $(PROGRAMS)
+all: $(TARGETS)
 
 readnotes: readnotes.o
 	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(APPEND_LDFLAGS)
@@ -31,17 +28,17 @@  lsevtchn: lsevtchn.o
 	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
 .PHONY: install
-install: build
+install: all
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
-	$(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_PROG) $(TARGETS) $(DESTDIR)$(LIBEXEC_BIN)
 
 .PHONY: uninstall
 uninstall:
-	rm -f $(addprefix $(DESTDIR)$(LIBEXECDIR)/, $(PROGRAMS))
+	rm -f $(addprefix $(DESTDIR)$(LIBEXECDIR)/, $(TARGETS))
 
 .PHONY: clean
 clean:
-	$(RM) *.o $(PROGRAMS)
+	$(RM) *.o $(TARGETS)
 	$(RM) $(DEPS_RM)
 
 .PHONY: distclean