Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[linux-2.6] / arch / powerpc / platforms / cell / spufs / Makefile
1 obj-y += switch.o
2
3 obj-$(CONFIG_SPU_FS) += spufs.o
4 spufs-y += inode.o file.o context.o syscalls.o
5 spufs-y += sched.o backing_ops.o hw_ops.o run.o
6
7 # Rules to build switch.o with the help of SPU tool chain
8 SPU_CROSS       := spu-
9 SPU_CC          := $(SPU_CROSS)gcc
10 SPU_AS          := $(SPU_CROSS)gcc
11 SPU_LD          := $(SPU_CROSS)ld
12 SPU_OBJCOPY     := $(SPU_CROSS)objcopy
13 SPU_CFLAGS      := -O2 -Wall -I$(srctree)/include \
14                    -I$(objtree)/include2 -D__KERNEL__
15 SPU_AFLAGS      := -c -D__ASSEMBLY__ -I$(srctree)/include \
16                    -I$(objtree)/include2 -D__KERNEL__
17 SPU_LDFLAGS     := -N -Ttext=0x0
18
19 $(obj)/switch.o: $(obj)/spu_save_dump.h $(obj)/spu_restore_dump.h
20 clean-files := spu_save_dump.h spu_restore_dump.h
21
22 # Compile SPU files
23       cmd_spu_cc = $(SPU_CC) $(SPU_CFLAGS) -c -o $@ $<
24 quiet_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 $@ $<
30 quiet_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 $@ $^
36 quiet_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 $< $@
42 quiet_cmd_spu_objcopy = OBJCOPY $@
43 $(obj)/spu_%.bin: $(src)/spu_%
44         $(call if_changed,spu_objcopy)
45
46 # create C code from ELF executable
47 cmd_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                 ) > $@
58 quiet_cmd_hexdump = HEXDUMP $@
59 $(obj)/%_dump.h: $(obj)/%.bin
60         $(call if_changed,hexdump)