1# Copyright (C) HP Labs, Palo Alto and Fort Collins, 2005
2# Author: Diwaker Gupta <diwaker.gupta@hp.com>
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  += $(CFLAGS_libxenevtchn)
17CFLAGS  += $(CFLAGS_libxenctrl)
18LDLIBS  += $(LDLIBS_libxenctrl)
19LDLIBS  += $(LDLIBS_libxenevtchn)
20
21SCRIPTS = xenmon.py
22
23.PHONY: all
24all: build
25
26.PHONY: build
27build: xentrace_setmask xenbaked
28
29.PHONY: install
30install: build
31	$(INSTALL_DIR) $(DESTDIR)$(sbindir)
32	$(INSTALL_PROG) xenbaked $(DESTDIR)$(sbindir)/xenbaked
33	$(INSTALL_PROG) xentrace_setmask  $(DESTDIR)$(sbindir)/xentrace_setmask
34	$(INSTALL_PYTHON_PROG) xenmon.py  $(DESTDIR)$(sbindir)/xenmon
35
36.PHONY: uninstall
37uninstall:
38	rm -f $(DESTDIR)$(sbindir)/xenbaked
39	rm -f $(DESTDIR)$(sbindir)/xentrace_setmask
40	rm -f $(DESTDIR)$(sbindir)/xenmon
41
42.PHONY: clean
43clean:
44	$(RM) -f $(DEPS_RM)
45	$(RM) -f xenbaked xenbaked.o
46	$(RM) -f xentrace_setmask setmask.o
47
48.PHONY: distclean
49distclean: clean
50
51xenbaked: xenbaked.o Makefile
52	$(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
53
54xentrace_setmask: setmask.o Makefile
55	$(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
56
57-include $(DEPS_INCLUDE)
58