direct-io.hg

view tools/libxc/Makefile @ 11774:5d2ce349f9f4

[SOLARIS] Don't build ptrace code on Solaris.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Tue Oct 17 17:59:32 2006 +0100 (2006-10-17)
parents a5ef8e491da7
children 398ab18ffed1
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_X86_Linux) += xc_ptrace.c xc_ptrace_core.c
22 GUEST_SRCS-y :=
23 GUEST_SRCS-y += xc_load_bin.c
24 GUEST_SRCS-y += xc_load_elf.c
25 GUEST_SRCS-y += xg_private.c
26 GUEST_SRCS-$(CONFIG_X86) += xc_linux_build.c
27 GUEST_SRCS-$(CONFIG_IA64) += xc_linux_build.c
28 GUEST_SRCS-$(CONFIG_MIGRATE) += xc_linux_restore.c xc_linux_save.c
29 GUEST_SRCS-$(CONFIG_HVM) += xc_hvm_build.c
31 -include $(XEN_TARGET_ARCH)/Makefile
33 CFLAGS += -Werror
34 CFLAGS += -fno-strict-aliasing
35 CFLAGS += $(INCLUDES) -I.
37 # Define this to make it possible to run valgrind on code linked with these
38 # libraries.
39 #CFLAGS += -DVALGRIND -O0 -ggdb3
41 # Get gcc to generate the dependencies for us.
42 CFLAGS += -Wp,-MD,.$(@F).d
43 LDFLAGS += -L.
44 DEPS = .*.d
46 CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y))
47 CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
49 GUEST_LIB_OBJS := $(patsubst %.c,%.o,$(GUEST_SRCS-y))
50 GUEST_PIC_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y))
52 LIB := libxenctrl.a
53 LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
55 LIB += libxenguest.a
56 LIB += libxenguest.so libxenguest.so.$(MAJOR) libxenguest.so.$(MAJOR).$(MINOR)
58 .PHONY: all
59 all: build
61 .PHONY: build
62 build: check-for-zlib mk-symlinks
63 $(MAKE) $(LIB)
65 .PHONY: check-for-zlib
66 check-for-zlib:
67 @if [ ! -e /usr/include/zlib.h ]; then \
68 echo "***********************************************************"; \
69 echo "ERROR: install zlib header files (http://www.gzip.org/zlib)"; \
70 echo "***********************************************************"; \
71 false; \
72 fi
74 .PHONY: install
75 install: build
76 [ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
77 [ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
78 $(INSTALL_PROG) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
79 $(INSTALL_DATA) libxenctrl.a $(DESTDIR)/usr/$(LIBDIR)
80 ln -sf libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenctrl.so.$(MAJOR)
81 ln -sf libxenctrl.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenctrl.so
82 $(INSTALL_DATA) xenctrl.h $(DESTDIR)/usr/include
84 $(INSTALL_PROG) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
85 $(INSTALL_DATA) libxenguest.a $(DESTDIR)/usr/$(LIBDIR)
86 ln -sf libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenguest.so.$(MAJOR)
87 ln -sf libxenguest.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenguest.so
88 $(INSTALL_DATA) xenguest.h $(DESTDIR)/usr/include
90 .PHONY: TAGS
91 TAGS:
92 etags -t *.c *.h
94 .PHONY: clean
95 clean:
96 rm -rf *.rpm $(LIB) *~ $(DEPS) xen \
97 $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS) \
98 $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS)
100 .PHONY: rpm
101 rpm: build
102 rm -rf staging
103 mkdir staging
104 mkdir staging/i386
105 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
106 --define "_rpmdir$$PWD/staging" -bb rpm.spec
107 mv staging/i386/*.rpm .
108 rm -rf staging
110 # libxenctrl
112 libxenctrl.a: $(CTRL_LIB_OBJS)
113 $(AR) rc $@ $^
115 libxenctrl.so: libxenctrl.so.$(MAJOR)
116 ln -sf $< $@
117 libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
118 ln -sf $< $@
120 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
121 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^
123 # libxenguest
125 libxenguest.a: $(GUEST_LIB_OBJS)
126 $(AR) rc $@ $^
128 libxenguest.so: libxenguest.so.$(MAJOR)
129 ln -sf $< $@
130 libxenguest.so.$(MAJOR): libxenguest.so.$(MAJOR).$(MINOR)
131 ln -sf $< $@
133 libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
134 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^ -lz -lxenctrl
136 -include $(DEPS)