direct-io.hg

view xen/arch/powerpc/Makefile @ 11376:0caf1a74fecd

[POWERPC] detect how to call nm for xen-syms.S
Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Jimi Xenidis <jimix@watson.ibm.com>
date Thu Aug 24 21:07:46 2006 -0400 (2006-08-24)
parents 3a195d95c615
children bc349d862a5d
line source
1 ifneq ($(DOM0_IMAGE),)
2 builtin_dom0 := y
3 endif
5 subdir-$(HAS_PPC64) += powerpc64
6 subdir-y += papr
8 obj-y += audit.o
9 obj-y += backtrace.o
10 obj-y += bitops.o
11 obj-y += boot_of.o
12 obj-y += dart.o
13 obj-y += dart_u3.o
14 obj-y += dart_u4.o
15 obj-y += delay.o
16 obj-y += dom0_ops.o
17 obj-y += domain_build.o
18 obj-y += domain.o
19 obj-y += exceptions.o
20 obj-y += external.o
21 obj-y += float.o
22 obj-y += hcalls.o
23 obj-y += htab.o
24 obj-y += iommu.o
25 obj-y += irq.o
26 obj-y += mambo.o
27 obj-y += memory.o
28 obj-y += mm.o
29 obj-y += mpic.o
30 obj-y += mpic_init.o
31 obj-y += of-devtree.o
32 obj-y += of-devwalk.o
33 obj-y += ofd_fixup.o
34 obj-y += physdev.o
35 obj-y += rtas.o
36 obj-y += setup.o
37 obj-y += shadow.o
38 obj-y += smp.o
39 obj-y += time.o
40 obj-y += usercopy.o
42 obj-$(debug) += 0opt.o
43 obj-$(crash_debug) += gdbstub.o
44 obj-$(builtin_dom0) += dom0.o
46 obj-y += firmware_image.o
48 obj-y += elf32.o
50 # These are extra warnings like for the arch/ppc directory but may not
51 # allow the rest of the tree to build.
52 PPC_C_WARNINGS += -Wundef -Wmissing-prototypes -Wmissing-declarations
53 PPC_C_WARNINGS += -Wshadow
54 CFLAGS += $(PPC_C_WARNINGS)
56 LINK=0x400000
57 boot32_link_base = $(LINK)
58 xen_link_offset = 100
59 xen_link_base = $(patsubst %000,%$(xen_link_offset),$(LINK))
61 #
62 # The following flags are fed to gcc in order to link several
63 # objects into a single ELF segment and to not link in any additional
64 # objects that gcc would normally like to
65 #
66 OMAGIC = -N -nodefaultlibs -nostartfiles
68 firmware: of_handler/built_in.o $(TARGET_SUBARCH)/memcpy.o of-devtree.o
69 $(CC) $(CFLAGS) $(OMAGIC) -e __ofh_start -Wl,-Ttext,0x0 $^ -o $@
71 firmware_image: firmware
72 $(CROSS_COMPILE)objcopy --output-target=binary $< $@
74 firmware_image.o: firmware_image
75 $(CROSS_COMPILE)objcopy --input-target=binary \
76 --output-target=elf64-powerpc \
77 --binary-architecture=powerpc \
78 --redefine-sym _binary_$<_start=$(@:%.o=%)_start \
79 --redefine-sym _binary_$<_end=$(@:%.o=%)_end \
80 --redefine-sym _binary_$<_size=$(@:%.o=%)_size $< $@
82 #
83 # Hacks for included C files
84 #
85 irq.o: ../x86/irq.c
86 physdev.o: ../x86/physdev.c
88 HDRS += $(wildcard *.h)
90 # The first token in the arguments will be silently dropped.
91 IMAGENAME = xen
92 CMDLINE = ""
93 boot_of.o: CFLAGS += -DCMDLINE="\"$(IMAGENAME) $(CMDLINE)\""
95 start.o: boot/start.S
96 $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $@
98 TARGET_OPTS = $(OMAGIC) -Wl,-Ttext,$(xen_link_base),-T,xen.lds
99 TARGET_OPTS += start.o $(ALL_OBJS)
101 .xen-syms: start.o $(ALL_OBJS) xen.lds
102 $(CC) $(CFLAGS) $(TARGET_OPTS) -o $@
104 NM=$(CROSS_COMPILE)nm
105 new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)
107 ifeq ($(new_nm),y)
108 NM := $(NM) --synthetic
109 endif
111 xen-syms.S: .xen-syms
112 $(NM) -n $^ | $(BASEDIR)/tools/symbols > $@
114 xen-syms.o: xen-syms.S
115 $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $@
117 $(TARGET)-syms: start.o $(ALL_OBJS) xen-syms.o xen.lds
118 $(CC) $(CFLAGS) $(TARGET_OPTS) xen-syms.o -o $@
120 $(TARGET).bin: $(TARGET)-syms
121 $(CROSS_COMPILE)objcopy --output-target=binary $< $@
123 $(TARGET).bin.o: $(TARGET).bin
124 $(CROSS_COMPILE)objcopy --input-target=binary \
125 --output-target=elf32-powerpc \
126 --binary-architecture=powerpc $< $@
128 boot32.o: boot/boot32.S
129 $(CC) -m32 -Wa,-a32,-mppc64bridge \
130 -D__ASSEMBLY__ -D__BRIDGE64__ $(CFLAGS) -c $< -o $@
132 $(TARGET): boot32.o $(TARGET).bin.o
133 $(CC) -m32 -N -Wl,-melf32ppclinux -static -nostdlib \
134 -Wl,-Ttext,$(boot32_link_base) -Wl,-Tdata,$(xen_link_base) \
135 $(CFLAGS) $^ -o $@
137 asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c $(HDRS)
138 $(CC) $(CFLAGS) -S -o $@ $<
140 xen.lds: xen.lds.S $(HDRS)
141 $(CC) $(CFLAGS) -P -E $(AFLAGS) -o $@ $<
143 dom0.bin: $(DOM0_IMAGE)
144 cp $< $@
146 clean::
147 $(MAKE) -f $(BASEDIR)/Rules.mk -C of_handler clean
148 rm -f firmware firmware_image dom0.bin .xen-syms