1 | # -*- mode: Makefile; -*- |
---|
2 | |
---|
3 | # `all' is the default target |
---|
4 | all: |
---|
5 | |
---|
6 | include $(XEN_ROOT)/Config.mk |
---|
7 | |
---|
8 | XEN_XC = $(XEN_ROOT)/tools/python/xen/lowlevel/xc |
---|
9 | XEN_LIBXC = $(XEN_ROOT)/tools/libxc |
---|
10 | XEN_XENSTORE = $(XEN_ROOT)/tools/xenstore |
---|
11 | XEN_LIBXENSTAT = $(XEN_ROOT)/tools/xenstat/libxenstat/src |
---|
12 | |
---|
13 | X11_LDPATH = -L/usr/X11R6/$(LIBDIR) |
---|
14 | |
---|
15 | CFLAGS += -D__XEN_TOOLS__ |
---|
16 | |
---|
17 | # Enable implicit LFS support *and* explicit LFS names. |
---|
18 | CFLAGS += $(shell getconf LFS_CFLAGS) |
---|
19 | CFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE |
---|
20 | LDFLAGS += $(shell getconf LFS_LDFLAGS) |
---|
21 | |
---|
22 | # 32-bit x86 does not perform well with -ve segment accesses on Xen. |
---|
23 | CFLAGS-$(CONFIG_X86_32) += $(call cc-option,$(CC),-mno-tls-direct-seg-refs) |
---|
24 | CFLAGS += $(CFLAGS-y) |
---|
25 | |
---|
26 | # Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers) |
---|
27 | check-$(CONFIG_X86) = $(call cc-ver-check,CC,0x030400,\ |
---|
28 | "Xen requires at least gcc-3.4") |
---|
29 | $(eval $(check-y)) |
---|
30 | |
---|
31 | %.opic: %.c |
---|
32 | $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $< |
---|
33 | |
---|
34 | %.o: %.c |
---|
35 | $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< |
---|
36 | |
---|
37 | %.o: %.cc |
---|
38 | $(CC) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< |
---|
39 | |
---|
40 | .PHONY: mk-symlinks mk-symlinks-xen mk-symlinks-$(XEN_OS) |
---|
41 | |
---|
42 | mk-symlinks-SunOS: |
---|
43 | |
---|
44 | mk-symlinks-Linux: LINUX_ROOT=$(XEN_ROOT)/linux-2.6-xen-sparse |
---|
45 | mk-symlinks-Linux: |
---|
46 | mkdir -p xen/linux |
---|
47 | ( cd xen/linux && \ |
---|
48 | ln -sf ../../$(LINUX_ROOT)/include/xen/public/*.h . ) |
---|
49 | ( cd xen && rm -f sys && ln -sf linux sys ) |
---|
50 | |
---|
51 | mk-symlinks-xen: |
---|
52 | mkdir -p xen |
---|
53 | ( cd xen && ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . ) |
---|
54 | mkdir -p xen/hvm |
---|
55 | ( cd xen/hvm && ln -sf ../../$(XEN_ROOT)/xen/include/public/hvm/*.h . ) |
---|
56 | mkdir -p xen/io |
---|
57 | ( cd xen/io && ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . ) |
---|
58 | mkdir -p xen/arch-x86 |
---|
59 | ( cd xen/arch-x86 && ln -sf ../../$(XEN_ROOT)/xen/include/public/arch-x86/*.h . ) |
---|
60 | mkdir -p xen/foreign |
---|
61 | ( cd xen/foreign && ln -sf ../../$(XEN_ROOT)/xen/include/public/foreign/Makefile . ) |
---|
62 | ( cd xen/foreign && ln -sf ../../$(XEN_ROOT)/xen/include/public/foreign/reference.size . ) |
---|
63 | ( cd xen/foreign && ln -sf ../../$(XEN_ROOT)/xen/include/public/foreign/*.py . ) |
---|
64 | $(MAKE) -C xen/foreign |
---|
65 | |
---|
66 | mk-symlinks: mk-symlinks-xen mk-symlinks-$(XEN_OS) |
---|