diff options
Diffstat (limited to 'arch/xtensa/boot/ramdisk/Makefile')
-rw-r--r-- | arch/xtensa/boot/ramdisk/Makefile | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/xtensa/boot/ramdisk/Makefile b/arch/xtensa/boot/ramdisk/Makefile new file mode 100644 index 000000000000..b12f76352438 --- /dev/null +++ b/arch/xtensa/boot/ramdisk/Makefile | |||
@@ -0,0 +1,23 @@ | |||
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 | |||