Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
[linux-2.6] / arch / xtensa / boot / ramdisk / Makefile
1 #
2 # Makefile for a ramdisk image
3 #
4
5 BIG_ENDIAN      := $(shell echo -e "\#ifdef __XTENSA_EL__\nint little;\n\#else\nint big;\n\#endif" | $(CC) -E -|grep -c big)
6
7 ifeq ($(BIG_ENDIAN),1)
8 OBJCOPY_ARGS    := -O elf32-xtensa-be
9 else
10 OBJCOPY_ARGS    := -O elf32-xtensa-le
11 endif
12
13 obj-y = ramdisk.o
14
15 RAMDISK_IMAGE = arch/$(ARCH)/boot/ramdisk/$(CONFIG_EMBEDDED_RAMDISK_IMAGE)
16
17 arch/$(ARCH)/boot/ramdisk/ramdisk.o:
18         $(Q)echo -e "dummy:" | $(AS) -o $@;
19         $(Q)$(OBJCOPY) $(OBJCOPY_ARGS)                                      \
20                 --add-section .initrd=$(RAMDISK_IMAGE)                      \
21                 --set-section-flags .initrd=contents,alloc,load,load,data   \
22                 arch/$(ARCH)/boot/ramdisk/ramdisk.o $@
23