1# Copyright (c) 2009 Advanced Micro Devices, Inc.
2#
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; under version 2 of the License.
6#
7# This program is distributed in the hope that it will be useful,
8# but WITHOUT ANY WARRANTY; without even the implied warranty of
9# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10# GNU General Public License for more details.
11
12XEN_ROOT=$(CURDIR)/../..
13include $(XEN_ROOT)/tools/Rules.mk
14
15CFLAGS  += -Werror
16CFLAGS  += $(CFLAGS_libxenstore)
17CPPFLAGS += -DXEN_SCRIPT_DIR="\"$(XEN_SCRIPT_DIR)\""
18LDLIBS  += $(LDLIBS_libxenstore)
19
20.PHONY: all
21all: build
22
23.PHONY: build
24build: xenbackendd
25
26.PHONY: install
27install: build
28	$(INSTALL_DIR) $(DESTDIR)$(sbindir)
29	$(INSTALL_PROG) xenbackendd $(DESTDIR)$(sbindir)
30
31.PHONY: clean
32clean:
33	$(RM) *.a *.so *.o $(DEPS_RM) xenbackendd _paths.h
34
35.PHONY: distclean
36distclean: clean
37
38xenbackendd.o: _paths.h
39xenbackendd: xenbackendd.o
40	$(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
41
42genpath-target = $(call buildmakevars2header,_paths.h)
43$(eval $(genpath-target))
44
45-include $(DEPS_INCLUDE)
46