> On 24 Jun 2022, at 17:04, Anthony PERARD <anthony.per...@citrix.com> wrote:
> 
> Remove "build" targets.
> 
> Use "$(TARGETS)" to list binary to be built.
> 
> Cleanup "clean" rule.
> 
> Also drop conditional install of $(BIN) and $(LIBBIN) as those two
> variables are now always populated.
> 
> Signed-off-by: Anthony PERARD <anthony.per...@citrix.com>

Hi Antony,

Would it make sense to use := instead of =, for BIN, SBIN, LIBBIN, SCRIPTS?

> ---
> 
> Notes:
>    v2:
>    - fix typo in title
>    - drop conditional install of $(BIN) and $(LIBBIN)
> 
> tools/xentrace/Makefile | 19 +++++++------------
> 1 file changed, 7 insertions(+), 12 deletions(-)
> 
> diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile
> index 9fb7fc96e7..0995fa9203 100644
> --- a/tools/xentrace/Makefile
> +++ b/tools/xentrace/Makefile
> @@ -14,36 +14,31 @@ SBIN     = xentrace xentrace_setsize
> LIBBIN   = xenctx
> SCRIPTS  = xentrace_format
> 
> -.PHONY: all
> -all: build
> +TARGETS := $(BIN) $(SBIN) $(LIBBIN)
> 
> -.PHONY: build
> -build: $(BIN) $(SBIN) $(LIBBIN)
> +.PHONY: all
> +all: $(TARGETS)
> 
> .PHONY: install
> -install: build
> +install: all
>       $(INSTALL_DIR) $(DESTDIR)$(bindir)
>       $(INSTALL_DIR) $(DESTDIR)$(sbindir)
> -     [ -z "$(LIBBIN)" ] || $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
> -ifneq ($(BIN),)
> +     $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
>       $(INSTALL_PROG) $(BIN) $(DESTDIR)$(bindir)
> -endif
>       $(INSTALL_PROG) $(SBIN) $(DESTDIR)$(sbindir)
>       $(INSTALL_PYTHON_PROG) $(SCRIPTS) $(DESTDIR)$(bindir)
> -     [ -z "$(LIBBIN)" ] || $(INSTALL_PROG) $(LIBBIN) $(DESTDIR)$(LIBEXEC_BIN)
> +     $(INSTALL_PROG) $(LIBBIN) $(DESTDIR)$(LIBEXEC_BIN)
> 
> .PHONY: uninstall
> uninstall:
>       rm -f $(addprefix $(DESTDIR)$(LIBEXEC_BIN)/, $(LIBBIN))
>       rm -f $(addprefix $(DESTDIR)$(bindir)/, $(SCRIPTS))
>       rm -f $(addprefix $(DESTDIR)$(sbindir)/, $(SBIN))
> -ifneq ($(BIN),)
>       rm -f $(addprefix $(DESTDIR)$(bindir)/, $(BIN))
> -endif

Why here don’t we use $(RM) ?



Reply via email to