mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
tools/xentop: rework makefile
Add "xentop" to "TARGETS" because this variable will be useful later. Always define all the targets, even when configured with --disable-monitor, instead don't visit the subdirectory. This mean xentop/ isn't visited anymore during "make clean" that's how most other subdirs in the tools/ works. Also add missing "xentop" rules. It only works without it because we still have make's built-ins rules and variables, but fix this to not have to rely on them. Use $(TARGETS) with $(INSTALL_PROG), and thus install into the directory rather than spelling the program name. In the "clean" rule, use $(RM) and remove all "*.o" instead of just one object. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
This commit is contained in:
1 parent
becde88538
commit
73447cddf6
2 files changed
+10
-13
No files matched your search
+1
-1
@@ -17,7 +17,7 @@ SUBDIRS-$(CONFIG_XCUTILS) += xcutils
|
|||||||
SUBDIRS-$(CONFIG_X86) += firmware
|
SUBDIRS-$(CONFIG_X86) += firmware
|
||||||
SUBDIRS-y += console
|
SUBDIRS-y += console
|
||||||
SUBDIRS-y += xenmon
|
SUBDIRS-y += xenmon
|
||||||
SUBDIRS-y += xentop
|
SUBDIRS-$(XENSTAT_XENTOP) += xentop
|
||||||
SUBDIRS-y += libfsimage
|
SUBDIRS-y += libfsimage
|
||||||
SUBDIRS-$(CONFIG_Linux) += vchan
|
SUBDIRS-$(CONFIG_Linux) += vchan
|
||||||
|
|
||||||
|
|||||||
+9
-12
@@ -13,36 +13,33 @@
|
|||||||
XEN_ROOT=$(CURDIR)/../..
|
XEN_ROOT=$(CURDIR)/../..
|
||||||
include $(XEN_ROOT)/tools/Rules.mk
|
include $(XEN_ROOT)/tools/Rules.mk
|
||||||
|
|
||||||
ifneq ($(XENSTAT_XENTOP),y)
|
|
||||||
.PHONY: all install xentop uninstall
|
|
||||||
all install xentop uninstall:
|
|
||||||
else
|
|
||||||
|
|
||||||
CFLAGS += -DGCC_PRINTF -Werror $(CFLAGS_libxenstat)
|
CFLAGS += -DGCC_PRINTF -Werror $(CFLAGS_libxenstat)
|
||||||
LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(TINFO_LIBS) $(SOCKET_LIBS) -lm
|
LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(TINFO_LIBS) $(SOCKET_LIBS) -lm
|
||||||
CFLAGS += -DHOST_$(XEN_OS)
|
CFLAGS += -DHOST_$(XEN_OS)
|
||||||
|
|
||||||
# Include configure output (config.h)
|
# Include configure output (config.h)
|
||||||
CFLAGS += -include $(XEN_ROOT)/tools/config.h
|
CFLAGS += -include $(XEN_ROOT)/tools/config.h
|
||||||
LDFLAGS += $(APPEND_LDFLAGS)
|
|
||||||
|
TARGETS := xentop
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: xentop
|
all: $(TARGETS)
|
||||||
|
|
||||||
|
xentop: xentop.o
|
||||||
|
$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS) $(APPEND_LDFLAGS)
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install: xentop
|
install: all
|
||||||
$(INSTALL_DIR) $(DESTDIR)$(sbindir)
|
$(INSTALL_DIR) $(DESTDIR)$(sbindir)
|
||||||
$(INSTALL_PROG) xentop $(DESTDIR)$(sbindir)/xentop
|
$(INSTALL_PROG) $(TARGETS) $(DESTDIR)$(sbindir)
|
||||||
|
|
||||||
.PHONY: uninstall
|
.PHONY: uninstall
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f $(DESTDIR)$(sbindir)/xentop
|
rm -f $(DESTDIR)$(sbindir)/xentop
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -f xentop xentop.o $(DEPS_RM)
|
$(RM) *.o $(TARGETS) $(DEPS_RM)
|
||||||
|
|
||||||
.PHONY: distclean
|
.PHONY: distclean
|
||||||
distclean: clean
|
distclean: clean
|
||||||
|
|||||||