ia64/xen-unstable

view xen/arch/x86/Makefile @ 5847:34fe1d9f0ced

Fix cross-compile builds by using NM macro instead of nm
binary directly.
author kaf24@firebug.cl.cam.ac.uk
date Mon Jul 25 20:33:41 2005 +0000 (2005-07-25)
parents dc7c14e533c2
children 691cd6f65739
line source
2 include $(BASEDIR)/Rules.mk
4 OBJS += $(patsubst %.S,%.o,$(wildcard $(TARGET_SUBARCH)/*.S))
5 OBJS += $(patsubst %.c,%.o,$(wildcard $(TARGET_SUBARCH)/*.c))
6 OBJS += $(patsubst %.c,%.o,$(wildcard acpi/*.c))
7 OBJS += $(patsubst %.c,%.o,$(wildcard mtrr/*.c))
8 OBJS += $(patsubst %.c,%.o,$(wildcard genapic/*.c))
9 OBJS += $(patsubst %.c,%.o,$(wildcard cpu/*.c))
11 ifeq ($(TARGET_SUBARCH),x86_64)
12 OBJS := $(subst cpu/centaur.o,,$(OBJS))
13 OBJS := $(subst cpu/cyrix.o,,$(OBJS))
14 OBJS := $(subst cpu/rise.o,,$(OBJS))
15 OBJS := $(subst cpu/transmeta.o,,$(OBJS))
16 OBJS := $(subst shadow32.o,,$(OBJS))
17 else
18 OBJS := $(subst shadow.o,,$(OBJS))
19 OBJS := $(subst shadow_public.o,,$(OBJS))
20 OBJS := $(subst shadow_xxx.o,,$(OBJS))
21 endif
23 OBJS := $(subst $(TARGET_SUBARCH)/asm-offsets.o,,$(OBJS))
25 ifneq ($(crash_debug),y)
26 OBJS := $(patsubst cdb%.o,,$(OBJS))
27 endif
29 default: $(TARGET)
31 $(TARGET): $(TARGET)-syms boot/mkelf32
32 ./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000
34 $(CURDIR)/arch.o: $(OBJS)
35 $(LD) $(LDFLAGS) -r -o $@ $(OBJS)
37 $(TARGET)-syms: boot/$(TARGET_SUBARCH).o $(ALL_OBJS) $(TARGET_SUBARCH)/xen.lds
38 $(LD) $(LDFLAGS) -T $(TARGET_SUBARCH)/xen.lds -N \
39 boot/$(TARGET_SUBARCH).o $(ALL_OBJS) -o $@
40 $(NM) -n $@ | $(BASEDIR)/tools/symbols >$(BASEDIR)/xen-syms.S
41 $(MAKE) $(BASEDIR)/xen-syms.o
42 $(LD) $(LDFLAGS) -T $(TARGET_SUBARCH)/xen.lds -N \
43 boot/$(TARGET_SUBARCH).o $(ALL_OBJS) $(BASEDIR)/xen-syms.o -o $@
44 $(NM) -n $@ | $(BASEDIR)/tools/symbols >$(BASEDIR)/xen-syms.S
45 $(MAKE) $(BASEDIR)/xen-syms.o
46 $(LD) $(LDFLAGS) -T $(TARGET_SUBARCH)/xen.lds -N \
47 boot/$(TARGET_SUBARCH).o $(ALL_OBJS) $(BASEDIR)/xen-syms.o -o $@
48 rm -f $(BASEDIR)/xen-syms.S $(BASEDIR)/xen-syms.o
50 asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c $(HDRS)
51 $(CC) $(CFLAGS) -S -o $@ $<
53 boot/mkelf32: boot/mkelf32.c
54 $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
56 clean:
57 rm -f *.o *.s *~ core boot/*.o boot/*~ boot/core boot/mkelf32
58 rm -f x86_32/*.o x86_32/*~ x86_32/core
59 rm -f x86_64/*.o x86_64/*~ x86_64/core
60 rm -f mtrr/*.o mtrr/*~ mtrr/core
61 rm -f acpi/*.o acpi/*~ acpi/core
62 rm -f genapic/*.o genapic/*~ genapic/core
63 rm -f cpu/*.o cpu/*~ cpu/core
65 .PHONY: default clean