ia64/xen-unstable

view tools/libxc/Makefile @ 16916:d5dd9a457337

libxc: Push parallel build of libraries down to a new phony target, as
'build' is already loaded with library dependencies on ia64.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Sun Jan 27 17:03:35 2008 +0000 (2008-01-27)
parents 7e5bae3586ee
children a905c582a406
line source
1 XEN_ROOT = ../..
2 include $(XEN_ROOT)/tools/Rules.mk
4 MAJOR = 3.2
5 MINOR = 0
7 CTRL_SRCS-y :=
8 CTRL_SRCS-y += xc_core.c
9 CTRL_SRCS-$(CONFIG_X86) += xc_core_x86.c
10 CTRL_SRCS-$(CONFIG_IA64) += xc_core_ia64.c
11 CTRL_SRCS-$(CONFIG_POWERPC) += xc_core_powerpc.c
12 CTRL_SRCS-y += xc_domain.c
13 CTRL_SRCS-y += xc_evtchn.c
14 CTRL_SRCS-y += xc_misc.c
15 CTRL_SRCS-y += xc_acm.c
16 CTRL_SRCS-y += xc_flask.c
17 CTRL_SRCS-y += xc_physdev.c
18 CTRL_SRCS-y += xc_private.c
19 CTRL_SRCS-y += xc_sedf.c
20 CTRL_SRCS-y += xc_csched.c
21 CTRL_SRCS-y += xc_tbuf.c
22 CTRL_SRCS-y += xc_resume.c
23 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
24 CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c
25 CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c
26 CTRL_SRCS-$(CONFIG_X86_Linux) += xc_ptrace.c xc_ptrace_core.c
27 CTRL_SRCS-$(CONFIG_NetBSD) += xc_netbsd.c
29 GUEST_SRCS-y :=
30 GUEST_SRCS-y += xg_private.c
31 GUEST_SRCS-$(CONFIG_MIGRATE) += xc_domain_restore.c xc_domain_save.c
32 GUEST_SRCS-$(CONFIG_HVM) += xc_hvm_build.c
34 VPATH = ../../xen/common/libelf
35 CFLAGS += -I../../xen/common/libelf
37 GUEST_SRCS-y += libelf-tools.c libelf-loader.c
38 GUEST_SRCS-y += libelf-dominfo.c libelf-relocate.c
40 # new domain builder
41 GUEST_SRCS-y += xc_dom_core.c xc_dom_boot.c
42 GUEST_SRCS-y += xc_dom_elfloader.c
43 GUEST_SRCS-y += xc_dom_binloader.c
44 GUEST_SRCS-y += xc_dom_compat_linux.c
46 GUEST_SRCS-$(CONFIG_X86) += xc_dom_x86.c
47 GUEST_SRCS-$(CONFIG_IA64) += xc_dom_ia64.c
48 GUEST_SRCS-$(CONFIG_POWERPC) += xc_dom_powerpc.c
50 -include $(XEN_TARGET_ARCH)/Makefile
52 CFLAGS += -Werror -Wmissing-prototypes
53 CFLAGS += $(INCLUDES) -I. -I../xenstore -I../include
55 # Needed for posix_fadvise64() in xc_linux.c
56 CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
58 # Define this to make it possible to run valgrind on code linked with these
59 # libraries.
60 #CFLAGS += -DVALGRIND -O0 -ggdb3
62 # Get gcc to generate the dependencies for us.
63 CFLAGS += -Wp,-MD,.$(@F).d
64 LDFLAGS += -L.
65 DEPS = .*.d
67 CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y))
68 CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
70 GUEST_LIB_OBJS := $(patsubst %.c,%.o,$(GUEST_SRCS-y))
71 GUEST_PIC_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y))
73 LIB := libxenctrl.a
74 LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
76 LIB += libxenguest.a
77 LIB += libxenguest.so libxenguest.so.$(MAJOR) libxenguest.so.$(MAJOR).$(MINOR)
79 .PHONY: all
80 all: build
82 .PHONY: build
83 build:
84 $(MAKE) libs
86 .PHONY: libs
87 libs: $(LIB)
89 .PHONY: install
90 install: build
91 $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
92 $(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
93 $(INSTALL_PROG) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
94 $(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(LIBDIR)
95 ln -sf libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so.$(MAJOR)
96 ln -sf libxenctrl.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so
97 $(INSTALL_DATA) xenctrl.h $(DESTDIR)$(INCLUDEDIR)
99 $(INSTALL_PROG) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
100 $(INSTALL_DATA) libxenguest.a $(DESTDIR)$(LIBDIR)
101 ln -sf libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenguest.so.$(MAJOR)
102 ln -sf libxenguest.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenguest.so
103 $(INSTALL_DATA) xenguest.h $(DESTDIR)$(INCLUDEDIR)
105 .PHONY: TAGS
106 TAGS:
107 etags -t *.c *.h
109 .PHONY: clean
110 clean:
111 rm -rf *.rpm $(LIB) *~ $(DEPS) \
112 $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS) \
113 $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS)
115 .PHONY: rpm
116 rpm: build
117 rm -rf staging
118 mkdir staging
119 mkdir staging/i386
120 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
121 --define "_rpmdir$$PWD/staging" -bb rpm.spec
122 mv staging/i386/*.rpm .
123 rm -rf staging
125 # libxenctrl
127 libxenctrl.a: $(CTRL_LIB_OBJS)
128 $(AR) rc $@ $^
130 libxenctrl.so: libxenctrl.so.$(MAJOR)
131 ln -sf $< $@
132 libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
133 ln -sf $< $@
135 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
136 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^ -lpthread
138 # libxenguest
140 libxenguest.a: $(GUEST_LIB_OBJS)
141 $(AR) rc $@ $^
143 libxenguest.so: libxenguest.so.$(MAJOR)
144 ln -sf $< $@
145 libxenguest.so.$(MAJOR): libxenguest.so.$(MAJOR).$(MINOR)
146 ln -sf $< $@
148 libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
149 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $(GUEST_PIC_OBJS) -lz -lxenctrl -lpthread
151 -include $(DEPS)