1#
2# tools/xcutils/Makefile
3#
4# This file is subject to the terms and conditions of the GNU General
5# Public License.  See the file "COPYING" in the main directory of
6# this archive for more details.
7#
8# Copyright (C) 2005 by Christian Limpach
9#
10
11XEN_ROOT	= $(CURDIR)/../..
12include $(XEN_ROOT)/tools/Rules.mk
13
14PROGRAMS = readnotes lsevtchn
15
16CFLAGS += -Werror
17
18# incorrectly uses libxc internals
19CFLAGS_readnotes.o  := $(CFLAGS_libxenevtchn) $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) -I$(XEN_ROOT)/tools/libxc $(CFLAGS_libxencall)
20CFLAGS_lsevtchn.o   := $(CFLAGS_libxenevtchn) $(CFLAGS_libxenctrl)
21
22.PHONY: all
23all: build
24
25.PHONY: build
26build: $(PROGRAMS)
27
28readnotes: readnotes.o
29	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(APPEND_LDFLAGS)
30
31lsevtchn: lsevtchn.o
32	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
33
34.PHONY: install
35install: build
36	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
37	$(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(LIBEXEC_BIN)
38
39.PHONY: uninstall
40uninstall:
41	rm -f $(addprefix $(DESTDIR)$(LIBEXECDIR)/, $(PROGRAMS))
42
43.PHONY: clean
44clean:
45	$(RM) *.o $(PROGRAMS)
46	$(RM) $(DEPS_RM)
47
48.PHONY: distclean
49distclean: clean
50
51-include $(DEPS_INCLUDE)
52