Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[linux/fpc-iii.git] / arch / powerpc / platforms / cell / spufs / Makefile
blobb9d5d678aa44ccf2481cef76586c8dbb1f3c0ab3
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 -D__KERNEL__
17 SPU_AFLAGS := -c -D__ASSEMBLY__ -I$(srctree)/include -D__KERNEL__
18 SPU_LDFLAGS := -N -Ttext=0x0
20 $(obj)/switch.o: $(obj)/spu_save_dump.h $(obj)/spu_restore_dump.h
21 clean-files := spu_save_dump.h spu_restore_dump.h
23 # Compile SPU files
24 cmd_spu_cc = $(SPU_CC) $(SPU_CFLAGS) -c -o $@ $<
25 quiet_cmd_spu_cc = SPU_CC $@
26 $(obj)/spu_%.o: $(src)/spu_%.c
27 $(call if_changed,spu_cc)
29 # Assemble SPU files
30 cmd_spu_as = $(SPU_AS) $(SPU_AFLAGS) -o $@ $<
31 quiet_cmd_spu_as = SPU_AS $@
32 $(obj)/spu_%.o: $(src)/spu_%.S
33 $(call if_changed,spu_as)
35 # Link SPU Executables
36 cmd_spu_ld = $(SPU_LD) $(SPU_LDFLAGS) -o $@ $^
37 quiet_cmd_spu_ld = SPU_LD $@
38 $(obj)/spu_%: $(obj)/spu_%_crt0.o $(obj)/spu_%.o
39 $(call if_changed,spu_ld)
41 # Copy into binary format
42 cmd_spu_objcopy = $(SPU_OBJCOPY) -O binary $< $@
43 quiet_cmd_spu_objcopy = OBJCOPY $@
44 $(obj)/spu_%.bin: $(src)/spu_%
45 $(call if_changed,spu_objcopy)
47 # create C code from ELF executable
48 cmd_hexdump = ( \
49 echo "/*" ; \
50 echo " * $*_dump.h: Copyright (C) 2005 IBM." ; \
51 echo " * Hex-dump auto generated from $*.c." ; \
52 echo " * Do not edit!" ; \
53 echo " */" ; \
54 echo "static unsigned int $*_code[] " \
55 "__attribute__((__aligned__(128))) = {" ; \
56 hexdump -v -e '"0x" 4/1 "%02x" "," "\n"' $< ; \
57 echo "};" ; \
58 ) > $@
59 quiet_cmd_hexdump = HEXDUMP $@
60 $(obj)/%_dump.h: $(obj)/%.bin
61 $(call if_changed,hexdump)