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