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