tools/xentrace: rework Makefile
authorAnthony PERARD <anthony.perard@citrix.com>
Thu, 13 Oct 2022 13:04:58 +0000 (14:04 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 14 Oct 2022 15:16:54 +0000 (16:16 +0100)
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.perard@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-acked-by: Henry Wang <Henry.Wang@arm.com>
tools/xentrace/Makefile

index 9fb7fc96e72a697ed2fa770d49ff976fcd6a5f97..63f2f6532dc6e189e64b8b5ea0312f08be33b854 100644 (file)
@@ -9,41 +9,36 @@ LDLIBS += $(LDLIBS_libxenevtchn)
 LDLIBS += $(LDLIBS_libxenctrl)
 LDLIBS += $(ARGP_LDFLAGS)
 
-BIN      = xenalyze
-SBIN     = xentrace xentrace_setsize
-LIBBIN   = xenctx
-SCRIPTS  = xentrace_format
+BIN     := xenalyze
+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
 
 .PHONY: clean
 clean:
-       $(RM) *.a *.so *.o *.rpm $(BIN) $(SBIN) $(LIBBIN) $(DEPS_RM)
+       $(RM) *.o $(TARGETS) $(DEPS_RM)
 
 .PHONY: distclean
 distclean: clean