Merge master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb
[linux-2.6] / arch / powerpc / platforms / cell / spufs / Makefile
1 obj-$(CONFIG_SPU_FS) += spufs.o
2 spufs-y += inode.o file.o context.o switch.o syscalls.o
3 spufs-y += sched.o backing_ops.o hw_ops.o run.o
4
5 # Rules to build switch.o with the help of SPU tool chain
6 SPU_CROSS       := spu-
7 SPU_CC          := $(SPU_CROSS)gcc
8 SPU_AS          := $(SPU_CROSS)gcc
9 SPU_LD          := $(SPU_CROSS)ld
10 SPU_OBJCOPY     := $(SPU_CROSS)objcopy
11 SPU_CFLAGS      := -O2 -Wall -I$(srctree)/include -I$(objtree)/include2
12 SPU_AFLAGS      := -c -D__ASSEMBLY__ -I$(srctree)/include -I$(objtree)/include2
13 SPU_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 $@ $<
19 quiet_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 $@ $<
25 quiet_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 $@ $^
31 quiet_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 $< $@
37 quiet_cmd_spu_objcopy = OBJCOPY $@
38 $(obj)/spu_%.bin: $(src)/spu_%
39         $(call if_changed,spu_objcopy)
40
41 # create C code from ELF executable
42 cmd_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 '"0x" 4/1 "%02x" "," "\n"' $< ; \
50                 echo "};" ; \
51                 ) > $@
52 quiet_cmd_hexdump = HEXDUMP $@
53 $(obj)/%_dump.h: $(obj)/%.bin
54         $(call if_changed,hexdump)