direct-io.hg

view tools/libxc/Makefile @ 12988:e080700efa56

[TOOLS] Fix the build. Clearly demarcate PPC-specific stuff.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Wed Dec 13 10:23:53 2006 +0000 (2006-12-13)
parents c519ab0f70f3
children 1e590ddb1277
line source
1 XEN_ROOT = ../..
2 include $(XEN_ROOT)/tools/Rules.mk
4 MAJOR = 3.0
5 MINOR = 0
7 CTRL_SRCS-y :=
8 CTRL_SRCS-y += xc_core.c
9 CTRL_SRCS-y += xc_domain.c
10 CTRL_SRCS-y += xc_evtchn.c
11 CTRL_SRCS-y += xc_misc.c
12 CTRL_SRCS-y += xc_acm.c
13 CTRL_SRCS-y += xc_physdev.c
14 CTRL_SRCS-y += xc_private.c
15 CTRL_SRCS-y += xc_sedf.c
16 CTRL_SRCS-y += xc_csched.c
17 CTRL_SRCS-y += xc_tbuf.c
18 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
19 CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c
20 CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c
21 CTRL_SRCS-$(CONFIG_X86_Linux) += xc_ptrace.c xc_ptrace_core.c
23 GUEST_SRCS-y :=
24 GUEST_SRCS-y += xc_load_bin.c
25 GUEST_SRCS-y += xc_load_elf.c
26 GUEST_SRCS-y += xg_private.c
27 GUEST_SRCS-$(CONFIG_X86) += xc_linux_build.c
28 GUEST_SRCS-$(CONFIG_IA64) += xc_linux_build.c
29 GUEST_SRCS-$(CONFIG_MIGRATE) += xc_linux_restore.c xc_linux_save.c
30 GUEST_SRCS-$(CONFIG_HVM) += xc_hvm_build.c
32 -include $(XEN_TARGET_ARCH)/Makefile
34 CFLAGS += -Werror -Wmissing-prototypes
35 CFLAGS += -fno-strict-aliasing
36 CFLAGS += $(INCLUDES) -I.
38 # Define this to make it possible to run valgrind on code linked with these
39 # libraries.
40 #CFLAGS += -DVALGRIND -O0 -ggdb3
42 # Get gcc to generate the dependencies for us.
43 CFLAGS += -Wp,-MD,.$(@F).d
44 LDFLAGS += -L.
45 DEPS = .*.d
47 CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y))
48 CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
50 GUEST_LIB_OBJS := $(patsubst %.c,%.o,$(GUEST_SRCS-y))
51 GUEST_PIC_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y))
53 LIB := libxenctrl.a
54 LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
56 LIB += libxenguest.a
57 LIB += libxenguest.so libxenguest.so.$(MAJOR) libxenguest.so.$(MAJOR).$(MINOR)
59 .PHONY: all
60 all: build
62 .PHONY: build
63 build: check-for-zlib mk-symlinks
64 $(MAKE) $(LIB)
66 .PHONY: check-for-zlib
67 check-for-zlib:
68 @if [ ! -e /usr/include/zlib.h ]; then \
69 echo "***********************************************************"; \
70 echo "ERROR: install zlib header files (http://www.gzip.org/zlib)"; \
71 echo "***********************************************************"; \
72 false; \
73 fi
75 .PHONY: install
76 install: build
77 [ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
78 [ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
79 $(INSTALL_PROG) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
80 $(INSTALL_DATA) libxenctrl.a $(DESTDIR)/usr/$(LIBDIR)
81 ln -sf libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenctrl.so.$(MAJOR)
82 ln -sf libxenctrl.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenctrl.so
83 $(INSTALL_DATA) xenctrl.h $(DESTDIR)/usr/include
85 $(INSTALL_PROG) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
86 $(INSTALL_DATA) libxenguest.a $(DESTDIR)/usr/$(LIBDIR)
87 ln -sf libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenguest.so.$(MAJOR)
88 ln -sf libxenguest.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenguest.so
89 $(INSTALL_DATA) xenguest.h $(DESTDIR)/usr/include
91 .PHONY: TAGS
92 TAGS:
93 etags -t *.c *.h
95 .PHONY: clean
96 clean:
97 rm -rf *.rpm $(LIB) *~ $(DEPS) xen \
98 $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS) \
99 $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS)
101 .PHONY: rpm
102 rpm: build
103 rm -rf staging
104 mkdir staging
105 mkdir staging/i386
106 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
107 --define "_rpmdir$$PWD/staging" -bb rpm.spec
108 mv staging/i386/*.rpm .
109 rm -rf staging
111 # libxenctrl
113 libxenctrl.a: $(CTRL_LIB_OBJS)
114 $(AR) rc $@ $^
116 libxenctrl.so: libxenctrl.so.$(MAJOR)
117 ln -sf $< $@
118 libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
119 ln -sf $< $@
121 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
122 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^ -lpthread
124 # libxenguest
126 libxenguest.a: $(GUEST_LIB_OBJS)
127 $(AR) rc $@ $^
129 libxenguest.so: libxenguest.so.$(MAJOR)
130 ln -sf $< $@
131 libxenguest.so.$(MAJOR): libxenguest.so.$(MAJOR).$(MINOR)
132 ln -sf $< $@
134 libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
135 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $(GUEST_PIC_OBJS) -lz -lxenctrl -lpthread
137 -include $(DEPS)