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
16CFLAGS += -DGCC_PRINTF $(CFLAGS_libxenstat)
17LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(TINFO_LIBS) $(SOCKET_LIBS) -lm
18CFLAGS += -DHOST_$(XEN_OS)
19
20# Include configure output (config.h)
21CFLAGS += -include $(XEN_ROOT)/tools/config.h
22
23TARGETS := xentop
24
25.PHONY: all
26all: $(TARGETS)
27
28xentop: xentop.o
29	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS) $(APPEND_LDFLAGS)
30
31.PHONY: install
32install: all
33	$(INSTALL_DIR) $(DESTDIR)$(sbindir)
34	$(INSTALL_PROG) $(TARGETS) $(DESTDIR)$(sbindir)
35
36.PHONY: uninstall
37uninstall:
38	rm -f $(DESTDIR)$(sbindir)/xentop
39
40.PHONY: clean
41clean:
42	$(RM) *.o $(TARGETS) $(DEPS_RM)
43
44.PHONY: distclean
45distclean: clean
46
47-include $(DEPS_INCLUDE)
48