Full support for Ginger Console
[linux-ginger.git] / arch / powerpc / platforms / cell / spufs / Makefile
blobb93f877ba5046bded97844766dee257534194b1b
2 obj-$(CONFIG_SPU_FS) += spufs.o
3 spufs-y += inode.o file.o context.o syscalls.o coredump.o
4 spufs-y += sched.o backing_ops.o hw_ops.o run.o gang.o
5 spufs-y += switch.o fault.o lscsa_alloc.o
7 # magic for the trace events
8 CFLAGS_sched.o := -I$(src)
10 # Rules to build switch.o with the help of SPU tool chain
11 SPU_CROSS := spu-
12 SPU_CC := $(SPU_CROSS)gcc
13 SPU_AS := $(SPU_CROSS)gcc
14 SPU_LD := $(SPU_CROSS)ld
15 SPU_OBJCOPY := $(SPU_CROSS)objcopy
16 SPU_CFLAGS := -O2 -Wall -I$(srctree)/include \
17 -I$(objtree)/include2 -D__KERNEL__
18 SPU_AFLAGS := -c -D__ASSEMBLY__ -I$(srctree)/include \
19 -I$(objtree)/include2 -D__KERNEL__
20 SPU_LDFLAGS := -N -Ttext=0x0
22 $(obj)/switch.o: $(obj)/spu_save_dump.h $(obj)/spu_restore_dump.h
23 clean-files := spu_save_dump.h spu_restore_dump.h
25 # Compile SPU files
26 cmd_spu_cc = $(SPU_CC) $(SPU_CFLAGS) -c -o $@ $<
27 quiet_cmd_spu_cc = SPU_CC $@
28 $(obj)/spu_%.o: $(src)/spu_%.c
29 $(call if_changed,spu_cc)
31 # Assemble SPU files
32 cmd_spu_as = $(SPU_AS) $(SPU_AFLAGS) -o $@ $<
33 quiet_cmd_spu_as = SPU_AS $@
34 $(obj)/spu_%.o: $(src)/spu_%.S
35 $(call if_changed,spu_as)
37 # Link SPU Executables
38 cmd_spu_ld = $(SPU_LD) $(SPU_LDFLAGS) -o $@ $^
39 quiet_cmd_spu_ld = SPU_LD $@
40 $(obj)/spu_%: $(obj)/spu_%_crt0.o $(obj)/spu_%.o
41 $(call if_changed,spu_ld)
43 # Copy into binary format
44 cmd_spu_objcopy = $(SPU_OBJCOPY) -O binary $< $@
45 quiet_cmd_spu_objcopy = OBJCOPY $@
46 $(obj)/spu_%.bin: $(src)/spu_%
47 $(call if_changed,spu_objcopy)
49 # create C code from ELF executable
50 cmd_hexdump = ( \
51 echo "/*" ; \
52 echo " * $*_dump.h: Copyright (C) 2005 IBM." ; \
53 echo " * Hex-dump auto generated from $*.c." ; \
54 echo " * Do not edit!" ; \
55 echo " */" ; \
56 echo "static unsigned int $*_code[] " \
57 "__attribute__((__aligned__(128))) = {" ; \
58 hexdump -v -e '"0x" 4/1 "%02x" "," "\n"' $< ; \
59 echo "};" ; \
60 ) > $@
61 quiet_cmd_hexdump = HEXDUMP $@
62 $(obj)/%_dump.h: $(obj)/%.bin
63 $(call if_changed,hexdump)