arnd@arndb.de | 91edfa4 | 2006-06-19 20:33:20 +0200 | [diff] [blame] | 1 | |
Arnd Bergmann | 67207b9 | 2005-11-15 15:53:48 -0500 | [diff] [blame] | 2 | obj-$(CONFIG_SPU_FS) += spufs.o |
Dwayne Grant McConnell | bf1ab97 | 2006-11-23 00:46:37 +0100 | [diff] [blame] | 3 | spufs-y += inode.o file.o context.o syscalls.o coredump.o |
Arnd Bergmann | 6263203 | 2006-10-04 17:26:15 +0200 | [diff] [blame] | 4 | spufs-y += sched.o backing_ops.o hw_ops.o run.o gang.o |
Jeremy Kerr | 7cd58e4 | 2007-12-20 16:39:59 +0900 | [diff] [blame] | 5 | spufs-y += switch.o fault.o lscsa_alloc.o |
Mark Nutter | 5473af0 | 2005-11-15 15:53:49 -0500 | [diff] [blame] | 6 | |
Christoph Hellwig | 038200c | 2008-01-11 15:03:26 +1100 | [diff] [blame] | 7 | obj-$(CONFIG_SPU_TRACE) += sputrace.o |
| 8 | |
Mark Nutter | 05b8411 | 2005-11-15 15:53:51 -0500 | [diff] [blame] | 9 | # Rules to build switch.o with the help of SPU tool chain |
| 10 | SPU_CROSS := spu- |
| 11 | SPU_CC := $(SPU_CROSS)gcc |
| 12 | SPU_AS := $(SPU_CROSS)gcc |
| 13 | SPU_LD := $(SPU_CROSS)ld |
| 14 | SPU_OBJCOPY := $(SPU_CROSS)objcopy |
arnd@arndb.de | 3795071 | 2006-06-19 20:33:35 +0200 | [diff] [blame] | 15 | SPU_CFLAGS := -O2 -Wall -I$(srctree)/include \ |
| 16 | -I$(objtree)/include2 -D__KERNEL__ |
| 17 | SPU_AFLAGS := -c -D__ASSEMBLY__ -I$(srctree)/include \ |
| 18 | -I$(objtree)/include2 -D__KERNEL__ |
Mark Nutter | 05b8411 | 2005-11-15 15:53:51 -0500 | [diff] [blame] | 19 | SPU_LDFLAGS := -N -Ttext=0x0 |
| 20 | |
Mark Nutter | 5473af0 | 2005-11-15 15:53:49 -0500 | [diff] [blame] | 21 | $(obj)/switch.o: $(obj)/spu_save_dump.h $(obj)/spu_restore_dump.h |
Masato Noguchi | 6e18b27 | 2006-06-19 20:33:32 +0200 | [diff] [blame] | 22 | clean-files := spu_save_dump.h spu_restore_dump.h |
Mark Nutter | 05b8411 | 2005-11-15 15:53:51 -0500 | [diff] [blame] | 23 | |
| 24 | # Compile SPU files |
| 25 | cmd_spu_cc = $(SPU_CC) $(SPU_CFLAGS) -c -o $@ $< |
| 26 | quiet_cmd_spu_cc = SPU_CC $@ |
| 27 | $(obj)/spu_%.o: $(src)/spu_%.c |
| 28 | $(call if_changed,spu_cc) |
| 29 | |
| 30 | # Assemble SPU files |
| 31 | cmd_spu_as = $(SPU_AS) $(SPU_AFLAGS) -o $@ $< |
| 32 | quiet_cmd_spu_as = SPU_AS $@ |
| 33 | $(obj)/spu_%.o: $(src)/spu_%.S |
| 34 | $(call if_changed,spu_as) |
| 35 | |
| 36 | # Link SPU Executables |
| 37 | cmd_spu_ld = $(SPU_LD) $(SPU_LDFLAGS) -o $@ $^ |
| 38 | quiet_cmd_spu_ld = SPU_LD $@ |
| 39 | $(obj)/spu_%: $(obj)/spu_%_crt0.o $(obj)/spu_%.o |
| 40 | $(call if_changed,spu_ld) |
| 41 | |
| 42 | # Copy into binary format |
| 43 | cmd_spu_objcopy = $(SPU_OBJCOPY) -O binary $< $@ |
| 44 | quiet_cmd_spu_objcopy = OBJCOPY $@ |
| 45 | $(obj)/spu_%.bin: $(src)/spu_% |
| 46 | $(call if_changed,spu_objcopy) |
| 47 | |
| 48 | # create C code from ELF executable |
| 49 | cmd_hexdump = ( \ |
| 50 | echo "/*" ; \ |
| 51 | echo " * $*_dump.h: Copyright (C) 2005 IBM." ; \ |
| 52 | echo " * Hex-dump auto generated from $*.c." ; \ |
| 53 | echo " * Do not edit!" ; \ |
| 54 | echo " */" ; \ |
arnd@arndb.de | 3795071 | 2006-06-19 20:33:35 +0200 | [diff] [blame] | 55 | echo "static unsigned int $*_code[] " \ |
| 56 | "__attribute__((__aligned__(128))) = {" ; \ |
Arnd Bergmann | 462c853 | 2005-12-09 19:04:17 +0100 | [diff] [blame] | 57 | hexdump -v -e '"0x" 4/1 "%02x" "," "\n"' $< ; \ |
Mark Nutter | 05b8411 | 2005-11-15 15:53:51 -0500 | [diff] [blame] | 58 | echo "};" ; \ |
| 59 | ) > $@ |
| 60 | quiet_cmd_hexdump = HEXDUMP $@ |
| 61 | $(obj)/%_dump.h: $(obj)/%.bin |
| 62 | $(call if_changed,hexdump) |