1obj-y += switch.o 2 3obj-$(CONFIG_SPU_FS) += spufs.o 4spufs-y += inode.o file.o context.o syscalls.o 5spufs-y += sched.o backing_ops.o hw_ops.o run.o 6 7# Rules to build switch.o with the help of SPU tool chain 8SPU_CROSS := spu- 9SPU_CC := $(SPU_CROSS)gcc 10SPU_AS := $(SPU_CROSS)gcc 11SPU_LD := $(SPU_CROSS)ld 12SPU_OBJCOPY := $(SPU_CROSS)objcopy 13SPU_CFLAGS := -O2 -Wall -I$(srctree)/include -I$(objtree)/include2 14SPU_AFLAGS := -c -D__ASSEMBLY__ -I$(srctree)/include -I$(objtree)/include2 15SPU_LDFLAGS := -N -Ttext=0x0 16 17$(obj)/switch.o: $(obj)/spu_save_dump.h $(obj)/spu_restore_dump.h 18 19# Compile SPU files 20 cmd_spu_cc = $(SPU_CC) $(SPU_CFLAGS) -c -o $@ $< 21quiet_cmd_spu_cc = SPU_CC $@ 22$(obj)/spu_%.o: $(src)/spu_%.c 23 $(call if_changed,spu_cc) 24 25# Assemble SPU files 26 cmd_spu_as = $(SPU_AS) $(SPU_AFLAGS) -o $@ $< 27quiet_cmd_spu_as = SPU_AS $@ 28$(obj)/spu_%.o: $(src)/spu_%.S 29 $(call if_changed,spu_as) 30 31# Link SPU Executables 32 cmd_spu_ld = $(SPU_LD) $(SPU_LDFLAGS) -o $@ $^ 33quiet_cmd_spu_ld = SPU_LD $@ 34$(obj)/spu_%: $(obj)/spu_%_crt0.o $(obj)/spu_%.o 35 $(call if_changed,spu_ld) 36 37# Copy into binary format 38 cmd_spu_objcopy = $(SPU_OBJCOPY) -O binary $< $@ 39quiet_cmd_spu_objcopy = OBJCOPY $@ 40$(obj)/spu_%.bin: $(src)/spu_% 41 $(call if_changed,spu_objcopy) 42 43# create C code from ELF executable 44cmd_hexdump = ( \ 45 echo "/*" ; \ 46 echo " * $*_dump.h: Copyright (C) 2005 IBM." ; \ 47 echo " * Hex-dump auto generated from $*.c." ; \ 48 echo " * Do not edit!" ; \ 49 echo " */" ; \ 50 echo "static unsigned int $*_code[] __page_aligned = {" ; \ 51 hexdump -v -e '"0x" 4/1 "%02x" "," "\n"' $< ; \ 52 echo "};" ; \ 53 ) > $@ 54quiet_cmd_hexdump = HEXDUMP $@ 55$(obj)/%_dump.h: $(obj)/%.bin 56 $(call if_changed,hexdump) 57