1 | subdir-y += xen |
---|
2 | subdir-y += vmx |
---|
3 | subdir-y += linux |
---|
4 | subdir-y += linux-xen |
---|
5 | |
---|
6 | $(TARGET)-syms: linux-xen/head.o $(ALL_OBJS) xen.lds.s |
---|
7 | $(MAKE) -f $(BASEDIR)/Rules.mk $(BASEDIR)/common/symbols-dummy.o |
---|
8 | $(LD) $(LDFLAGS) -T xen.lds.s -N \ |
---|
9 | -Map map.out linux-xen/head.o $(ALL_OBJS) \ |
---|
10 | $(BASEDIR)/common/symbols-dummy.o -o $@ |
---|
11 | $(NM) -n $@ | $(BASEDIR)/tools/symbols > $(BASEDIR)/xen-syms.S |
---|
12 | $(MAKE) -f $(BASEDIR)/Rules.mk $(BASEDIR)/xen-syms.o |
---|
13 | $(LD) $(LDFLAGS) -T xen.lds.s -N \ |
---|
14 | -Map map.out linux-xen/head.o $(ALL_OBJS) \ |
---|
15 | $(BASEDIR)/xen-syms.o -o $@ |
---|
16 | $(NM) -n $@ | $(BASEDIR)/tools/symbols >$(BASEDIR)/xen-syms.S |
---|
17 | $(MAKE) -f $(BASEDIR)/Rules.mk $(BASEDIR)/xen-syms.o |
---|
18 | $(LD) $(LDFLAGS) -T xen.lds.s -N \ |
---|
19 | -Map map.out linux-xen/head.o $(ALL_OBJS) \ |
---|
20 | $(BASEDIR)/xen-syms.o -o $@ |
---|
21 | rm -f $(BASEDIR)/xen-syms.S $(BASEDIR)/xen-syms.o |
---|
22 | |
---|
23 | $(TARGET): $(TARGET)-syms |
---|
24 | $(OBJCOPY) -R .note -R .comment -S $(TARGET)-syms $@ |
---|
25 | $(NM) -n $(TARGET)-syms | \ |
---|
26 | grep -v '\( [aUw] \)\|\(__crc_\)\|\( \$[adt]\)' \ |
---|
27 | > $(BASEDIR)/System.map |
---|
28 | |
---|
29 | # Headers do not depend on auto-generated header, but object files do. |
---|
30 | HDRS := $(subst $(BASEDIR)/include/asm-ia64/asm-xsi-offsets.h,,$(HDRS)) |
---|
31 | $(ALL_OBJS): $(BASEDIR)/include/asm-ia64/asm-xsi-offsets.h |
---|
32 | |
---|
33 | asm-offsets.s: asm-offsets.c $(BASEDIR)/include/asm-ia64/.offsets.h.stamp |
---|
34 | $(CC) $(CFLAGS) -DGENERATE_ASM_OFFSETS -DIA64_TASK_SIZE=0 -S -o $@ $< |
---|
35 | |
---|
36 | asm-xsi-offsets.s: asm-xsi-offsets.c $(HDRS) |
---|
37 | $(CC) $(CFLAGS) -S -o $@ $< |
---|
38 | |
---|
39 | $(BASEDIR)/include/asm-ia64/asm-xsi-offsets.h: asm-xsi-offsets.s |
---|
40 | @(set -e; \ |
---|
41 | echo "/*"; \ |
---|
42 | echo " * DO NOT MODIFY."; \ |
---|
43 | echo " *"; \ |
---|
44 | echo " * This file was auto-generated from $<"; \ |
---|
45 | echo " *"; \ |
---|
46 | echo " */"; \ |
---|
47 | echo ""; \ |
---|
48 | echo "#ifndef __ASM_XSI_OFFSETS_H__"; \ |
---|
49 | echo "#define __ASM_XSI_OFFSETS_H__"; \ |
---|
50 | echo ""; \ |
---|
51 | sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \ |
---|
52 | echo ""; \ |
---|
53 | echo "#endif") <$< >$@ |
---|
54 | |
---|
55 | $(BASEDIR)/include/asm-ia64/.offsets.h.stamp: |
---|
56 | # Need such symbol link to make linux headers available |
---|
57 | [ -e $(BASEDIR)/include/linux ] \ |
---|
58 | || ln -sf $(BASEDIR)/include/xen $(BASEDIR)/include/linux |
---|
59 | [ -e $(BASEDIR)/include/asm-ia64/xen ] \ |
---|
60 | || ln -sf $(BASEDIR)/include/asm-ia64/linux $(BASEDIR)/include/asm-ia64/xen |
---|
61 | |
---|
62 | # I'm sure a Makefile wizard would know a better way to do this |
---|
63 | xen.lds.s: xen/xen.lds.S |
---|
64 | $(CC) -E $(CPPFLAGS) -P -DXEN $(AFLAGS) \ |
---|
65 | -o xen.lds.s xen/xen.lds.S |
---|
66 | |
---|
67 | .PHONY: clean |
---|
68 | clean:: |
---|
69 | rm -f *.o *~ core xen.lds.s $(BASEDIR)/include/asm-ia64/.offsets.h.stamp asm-offsets.s map.out |
---|
70 | rm -f asm-xsi-offsets.s $(BASEDIR)/include/asm-ia64/asm-xsi-offsets.h |
---|
71 | rm -f $(BASEDIR)/System.map |
---|