1obj-$(CONFIG_SPU_FS) += spufs.o
2
3spufs-y += inode.o file.o context.o switch.o syscalls.o
4
5# Rules to build switch.o with the help of SPU tool chain
6SPU_CROSS	:= spu-
7SPU_CC		:= $(SPU_CROSS)gcc
8SPU_AS		:= $(SPU_CROSS)gcc
9SPU_LD		:= $(SPU_CROSS)ld
10SPU_OBJCOPY	:= $(SPU_CROSS)objcopy
11SPU_CFLAGS	:= -O2 -Wall -I$(srctree)/include -I$(objtree)/include2
12SPU_AFLAGS	:= -c -D__ASSEMBLY__ -I$(srctree)/include -I$(objtree)/include2
13SPU_LDFLAGS	:= -N -Ttext=0x0
14
15$(obj)/switch.o: $(obj)/spu_save_dump.h $(obj)/spu_restore_dump.h
16
17# Compile SPU files
18      cmd_spu_cc = $(SPU_CC) $(SPU_CFLAGS) -c -o $@ $<
19quiet_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 $@ $<
25quiet_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 $@ $^
31quiet_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 $< $@
37quiet_cmd_spu_objcopy = OBJCOPY $@
38$(obj)/spu_%.bin: $(src)/spu_%
39	$(call if_changed,spu_objcopy)
40
41# create C code from ELF executable
42cmd_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 = {" ; \
49		hexdump -v -e '4/4 "0x%08x, " "\n"' $< ; \
50		echo "};" ; \
51		) > $@
52quiet_cmd_hexdump = HEXDUMP $@
53$(obj)/%_dump.h: $(obj)/%.bin
54	$(call if_changed,hexdump)
55