tools/xentrace: rework Makefile

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>
This commit is contained in:
Anthony PERARD authored and Andrew Cooper committed 2022-10-14 16:16:54 +01:00
1 parent 3a206abcd7
commit a2e8156ba4
1 file changed
+11 -16
+11 -16
View 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
TARGETS := $(BIN) $(SBIN) $(LIBBIN)
.PHONY: all
all: build
.PHONY: build
build: $(BIN) $(SBIN) $(LIBBIN)
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
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.