aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xcutils/Makefile
blob: 9907dfa0c5dc2db9063e88c6640f50af991bac40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#
# tools/xcutils/Makefile
#
# This file is subject to the terms and conditions of the GNU General
# Public License.  See the file "COPYING" in the main directory of
# this archive for more details.
#
# Copyright (C) 2005 by Christian Limpach
#

INSTALL		= install
INSTALL_PROG	= $(INSTALL) -m0755
INSTALL_DIR	= $(INSTALL) -d -m0755

XEN_ROOT	= ../..
include $(XEN_ROOT)/tools/Rules.mk

PROGRAMS_INSTALL_DIR = /usr/$(LIBDIR)/xen/bin

INCLUDES += -I $(XEN_LIBXC)

CFLAGS += -Werror -fno-strict-aliasing
CFLAGS += $(INCLUDES)

# Make gcc generate dependencies.
CFLAGS += -Wp,-MD,.$(@F).d
PROG_DEP = .*.d

PROGRAMS		= xc_restore xc_save

LDLIBS			= -L$(XEN_LIBXC) -lxenguest -lxenctrl

.PHONY: all
all: build
build: $(PROGRAMS)

$(PROGRAMS): %: %.o
	$(LINK.o) $^ $(LDLIBS) -o $@

.PHONY: install
install: build
	[ -d $(DESTDIR)$(PROGRAMS_INSTALL_DIR) ] || \
		$(INSTALL_DIR) $(DESTDIR)$(PROGRAMS_INSTALL_DIR)
	$(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(PROGRAMS_INSTALL_DIR)


clean:
	$(RM) *.o $(PROGRAMS)
	$(RM) $(PROG_DEP)

-include $(PROG_DEP)