1# Copyright (C) International Business Machines Corp., 2005
2# Author: Josh Triplett <josh@kernel.org>
3#
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; under version 2 of the License.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11# GNU General Public License for more details.
12
13XEN_ROOT=$(CURDIR)/../../..
14include $(XEN_ROOT)/tools/Rules.mk
15
16ifneq ($(XENSTAT_XENTOP),y)
17.PHONY: all install xentop uninstall
18all install xentop uninstall:
19else
20
21CFLAGS += -DGCC_PRINTF -Werror $(CFLAGS_libxenstat)
22LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(TINFO_LIBS) $(SOCKET_LIBS) -lm
23CFLAGS += -DHOST_$(XEN_OS)
24
25# Include configure output (config.h)
26CFLAGS += -include $(XEN_ROOT)/tools/config.h
27LDFLAGS += $(APPEND_LDFLAGS)
28
29.PHONY: all
30all: xentop
31
32.PHONY: install
33install: xentop
34	$(INSTALL_DIR) $(DESTDIR)$(sbindir)
35	$(INSTALL_PROG) xentop $(DESTDIR)$(sbindir)/xentop
36
37.PHONY: uninstall
38uninstall:
39	rm -f $(DESTDIR)$(sbindir)/xentop
40
41endif
42
43.PHONY: clean
44clean:
45	rm -f xentop xentop.o $(DEPS_RM)
46
47.PHONY: distclean
48distclean: clean
49
50-include $(DEPS_INCLUDE)
51