ia64/xen-unstable

view tools/xfrd/Makefile @ 3562:308203ddc173

bitkeeper revision 1.1159.223.48 (41f9204fFDaBv7jCdF63bwx5zXNlNA)

Merge arcadians.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-2.0-testing.bk
into arcadians.cl.cam.ac.uk:/local/scratch-2/cl349/xen-2.0-testing.bk
author cl349@arcadians.cl.cam.ac.uk
date Thu Jan 27 17:09:35 2005 +0000 (2005-01-27)
parents dca8a77a487d 0a8bc30a7c4b
children 2e60786262c4 3ee85723a341 a0be5e5a1f37
line source
1 # -*- mode: Makefile; -*-
2 #============================================================================
3 #
4 # Mike Wray <mike.wray@hp.com>
5 #============================================================================
7 INSTALL = install
8 INSTALL_PROG = $(INSTALL) -m0755
9 INSTALL_DIR = $(INSTALL) -d -m0755
11 XEN_ROOT = ../..
12 include $(XEN_ROOT)/tools/Rules.mk
14 XFRD_INSTALL_DIR = /usr/sbin
16 vpath %.h $(XEN_LIBXC)
17 INCLUDES += -I $(XEN_LIBXC)
19 vpath %c $(XEN_LIBXUTIL)
20 INCLUDES += -I $(XEN_LIBXUTIL)
22 include Make.xfrd
24 UTIL_LIB_OBJ = $(UTIL_LIB_SRC:.c=.o)
26 XFRD_PROG_OBJ = $(XFRD_PROG_SRC:.c=.o)
27 XFRD_PROG_OBJ += $(UTIL_LIB)
29 # Flag controlling whether to use stubs.
30 # Define to use stubs, undefine to use the real Xen functions.
31 #CPPFLAGS += -D _XEN_XFR_STUB_
33 ifeq ($(SXPR_DEBUG),1)
34 CPPFLAGS += -D _XEN_XFR_STUB_ -D SXPR_PARSER_MAIN
35 endif
37 CC := gcc
39 CFLAGS += -Wall -Werror -O3 -fno-strict-aliasing
40 CFLAGS += $(INCLUDES)
41 # Make gcc generate dependencies.
42 CFLAGS += -Wp,-MD,.$(@F).d
43 PROG_DEP = .*.d
45 #$(warning XFRD_PROG_OBJ= $(XFRD_PROG_OBJ))
46 #$(warning UTIL_LIB= $(UTIL_LIB))
47 #$(warning UTIL_LIB_OBJ= $(UTIL_LIB_OBJ))
49 # Libraries for xfrd.
50 XFRD_LIBS :=
52 XFRD_LIBS += -L $(XEN_LIBXC) -lxc
53 XFRD_LIBS += -L $(XEN_LIBXUTIL) -lxutil
55 # zlib library.
56 XFRD_LIBS += -lz
58 CURL_FLAGS = $(shell curl-config --cflags)
59 CURL_LIBS = $(shell curl-config --libs)
60 CFLAGS += $(CURL_FLAGS)
61 # libcurl libraries.
62 XFRD_LIBS += $(CURL_LIBS)
64 #$(warning XFRD_LIBS = $(XFRD_LIBS))
66 all: xfrd
68 xfrd: $(XFRD_PROG_OBJ)
69 $(CC) -o $@ $^ $(XFRD_LIBS)
71 .PHONY: install
72 install: xfrd
73 [ -d $(DESTDIR)$(XFRD_INSTALL_DIR) ] || \
74 $(INSTALL_DIR) $(DESTDIR)$(XFRD_INSTALL_DIR)
75 $(INSTALL_PROG) xfrd $(DESTDIR)$(XFRD_INSTALL_DIR)
77 .PHONY: libutil
78 libutil: $(UTIL_LIB)
80 $(UTIL_LIB): $(UTIL_LIB_OBJ)
81 $(AR) rc $@ $^
83 .PHONY: clean
84 clean:
85 $(RM) *.o *.a *.so *~ xfrd
86 $(RM) $(PROG_DEP)
88 $(XFRD_PROG_OBJ): Makefile
89 -include $(PROG_DEP)