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 18clean-files := spu_save_dump.h spu_restore_dump.h 19 20# Compile SPU files 21 cmd_spu_cc = $(SPU_CC) $(SPU_CFLAGS) -c -o $@ $< 22quiet_cmd_spu_cc = SPU_CC $@ 23$(obj)/spu_%.o: $(src)/spu_%.c 24 $(call if_changed,spu_cc) 25 26# Assemble SPU files 27 cmd_spu_as = $(SPU_AS) $(SPU_AFLAGS) -o $@ $< 28quiet_cmd_spu_as = SPU_AS $@ 29$(obj)/spu_%.o: $(src)/spu_%.S 30 $(call if_changed,spu_as) 31 32# Link SPU Executables 33 cmd_spu_ld = $(SPU_LD) $(SPU_LDFLAGS) -o $@ $^ 34quiet_cmd_spu_ld = SPU_LD $@ 35$(obj)/spu_%: $(obj)/spu_%_crt0.o $(obj)/spu_%.o 36 $(call if_changed,spu_ld) 37 38# Copy into binary format 39 cmd_spu_objcopy = $(SPU_OBJCOPY) -O binary $< $@ 40quiet_cmd_spu_objcopy = OBJCOPY $@ 41$(obj)/spu_%.bin: $(src)/spu_% 42 $(call if_changed,spu_objcopy) 43 44# create C code from ELF executable 45cmd_hexdump = ( \ 46 echo "/*" ; \ 47 echo " * $*_dump.h: Copyright (C) 2005 IBM." ; \ 48 echo " * Hex-dump auto generated from $*.c." ; \ 49 echo " * Do not edit!" ; \ 50 echo " */" ; \ 51 echo "static unsigned int $*_code[] __page_aligned = {" ; \ 52 hexdump -v -e '"0x" 4/1 "%02x" "," "\n"' $< ; \ 53 echo "};" ; \ 54 ) > $@ 55quiet_cmd_hexdump = HEXDUMP $@ 56$(obj)/%_dump.h: $(obj)/%.bin 57 $(call if_changed,hexdump) 58