comparison src/video/ps3/spulibs/Makefile @ 3154:95e48f7a3a93 gsoc2009_ps3

Added Makefile rule for spu programs. Added Readme.
author Martin Lowinski <martin@goldtopf.org>
date Mon, 10 Aug 2009 18:05:33 +0000
parents 104786a909a2
children abc49915ccb2
comparison
equal deleted inserted replaced
3153:a16c4ec43631 3154:95e48f7a3a93
1 # This Makefile is for building the CELL BE SPU libs 1 # This Makefile is for building the CELL BE SPU libs
2 # libfb_writer_spu.so, libyuv2rgb_spu.so, libbilin_scaler_spu.so 2 # libfb_writer_spu.so, libyuv2rgb_spu.so, libbilin_scaler_spu.so
3 3
4 # Toolchain 4 # Toolchain
5 SPU_GCC=/usr/bin/spu-gcc 5 SPU_GCC=/usr/bin/spu-gcc
6 PPU_GCC=/usr/bin/gcc
7 PPU_EMBEDSPU=/usr/bin/embedspu 6 PPU_EMBEDSPU=/usr/bin/embedspu
8 PPU_AR=/usr/bin/ar 7 PPU_AR=/usr/bin/ar
9 PPU_LD=/usr/bin/ld 8 PPU_LD=/usr/bin/ld
10 INSTALL=/usr/bin/install 9 SPU_SRCDIR=$(srcdir)/src/video/ps3/spulibs
11 10 SPU_LIBDIR=$(srcdir)/src/video/ps3/spulibs/libs
12 SPU_CFLAGS=-g -W -Wall -Winline -Wno-main -I. -I /usr/spu/include -I /opt/cell/sdk/usr/spu/include -finline-limit=10000 -Winline -ftree-vectorize -funroll-loops -fmodulo-sched -ffast-math -fPIC -O2 11 SPU_CFLAGS=-g -W -Wall -Winline -Wno-main -I. -I /usr/spu/include -I /opt/cell/sdk/usr/spu/include -finline-limit=10000 -Winline -ftree-vectorize -funroll-loops -fmodulo-sched -ffast-math -fPIC -O2
13 12
14 # Usually /usr/lib, depending on your distribution 13
15 PREFIX=/usr/lib 14 ps3libs: $(SPU_LIBDIR)/libfb_writer_spu.a $(SPU_LIBDIR)/libfb_writer_spu.so \
15 $(SPU_LIBDIR)/libyuv2rgb_spu.so $(SPU_LIBDIR)/libyuv2rgb_spu.a \
16 $(SPU_LIBDIR)/libbilin_scaler_spu.so $(SPU_LIBDIR)/libbilin_scaler_spu.a
17
18 $(SPU_LIBDIR):
19 $(SHELL) $(auxdir)/mkinstalldirs $(SPU_LIBDIR)
20
21 # fb_writer (basically copying from a to b)
22 $(SPU_LIBDIR)/fb_writer_spu-embed.o: $(SPU_LIBDIR) $(SPU_SRCDIR)/fb_writer.c $(SPU_SRCDIR)/spu_common.h
23 $(SPU_GCC) $(SPU_CFLAGS) -o $(SPU_LIBDIR)/fb_writer_spu $(SPU_SRCDIR)/fb_writer.c -lm
24 $(PPU_EMBEDSPU) -m32 fb_writer_spu $(SPU_LIBDIR)/fb_writer_spu $(SPU_LIBDIR)/fb_writer_spu-embed.o
25
26 $(SPU_LIBDIR)/libfb_writer_spu.a: $(SPU_LIBDIR)/fb_writer_spu-embed.o
27 $(PPU_AR) -qcs $(SPU_LIBDIR)/libfb_writer_spu.a $(SPU_LIBDIR)/fb_writer_spu-embed.o
28
29 $(SPU_LIBDIR)/libfb_writer_spu.so: $(SPU_LIBDIR)/fb_writer_spu-embed.o
30 $(PPU_LD) -o $(SPU_LIBDIR)/libfb_writer_spu.so -shared -soname=libfb_writer_spu.so $(SPU_LIBDIR)/fb_writer_spu-embed.o
16 31
17 32
18 all: libfb_writer_spu.a libfb_writer_spu.so \ 33 # yuv2rgb_converter (converting YV12/IYUV to RGB)
19 libyuv2rgb_spu.so libyuv2rgb_spu.a \ 34 $(SPU_LIBDIR)/yuv2rgb_spu-embed.o: $(SPU_LIBDIR) $(SPU_SRCDIR)/yuv2rgb_converter.c $(SPU_SRCDIR)/spu_common.h
20 libbilin_scaler_spu.so libbilin_scaler_spu.a 35 $(SPU_GCC) $(SPU_CFLAGS) -o $(SPU_LIBDIR)/yuv2rgb_spu $(SPU_SRCDIR)/yuv2rgb_converter.c -lm
36 $(PPU_EMBEDSPU) -m32 yuv2rgb_spu $(SPU_LIBDIR)/yuv2rgb_spu $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
37
38 $(SPU_LIBDIR)/libyuv2rgb_spu.a: $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
39 $(PPU_AR) -qcs $(SPU_LIBDIR)/libyuv2rgb_spu.a $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
40
41 $(SPU_LIBDIR)/libyuv2rgb_spu.so: $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
42 $(PPU_LD) -o $(SPU_LIBDIR)/libyuv2rgb_spu.so -shared -soname=libyuv2rgb_spu.so $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
21 43
22 44
23 # fb_writer 45 # bilin_scaler (scaling bilinear YV12/IYUV pictures with resolutions /16)
24 fb_writer_spu-embed.o: fb_writer.c spu_common.h 46 $(SPU_LIBDIR)/bilin_scaler_spu-embed.o: $(SPU_LIBDIR) $(SPU_SRCDIR)/bilin_scaler.c $(SPU_SRCDIR)/spu_common.h
25 $(SPU_GCC) $(SPU_CFLAGS) -o fb_writer_spu fb_writer.c -lm 47 $(SPU_GCC) $(SPU_CFLAGS) -o $(SPU_LIBDIR)/bilin_scaler_spu $(SPU_SRCDIR)/bilin_scaler.c -lm
26 $(PPU_EMBEDSPU) -m32 fb_writer_spu fb_writer_spu fb_writer_spu-embed.o 48 $(PPU_EMBEDSPU) -m32 bilin_scaler_spu $(SPU_LIBDIR)/bilin_scaler_spu $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
27 49
28 libfb_writer_spu.so: fb_writer_spu-embed.o 50 $(SPU_LIBDIR)/libbilin_scaler_spu.a: $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
29 $(PPU_LD) -o libfb_writer_spu.so -shared -soname=libfb_writer_spu.so fb_writer_spu-embed.o 51 $(PPU_AR) -qcs $(SPU_LIBDIR)/libbilin_scaler_spu.a $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
30 52
31 libfb_writer_spu.a: fb_writer_spu-embed.o 53 $(SPU_LIBDIR)/libbilin_scaler_spu.so: $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
32 $(PPU_AR) -qcs libfb_writer_spu.a fb_writer_spu-embed.o 54 $(PPU_LD) -o $(SPU_LIBDIR)/libbilin_scaler_spu.so -shared -soname=libbilin_scaler_spu.so $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
33 55
34 56
35 # yuv2rgb_converter 57 ps3libs-install: $(SPU_LIBDIR)/libfb_writer_spu.a $(SPU_LIBDIR)/libfb_writer_spu.so \
36 yuv2rgb_spu-embed.o: yuv2rgb_converter.c spu_common.h 58 $(SPU_LIBDIR)/libyuv2rgb_spu.so $(SPU_LIBDIR)/libyuv2rgb_spu.a \
37 $(SPU_GCC) $(SPU_CFLAGS) -o yuv2rgb_spu yuv2rgb_converter.c -lm 59 $(SPU_LIBDIR)/libbilin_scaler_spu.so $(SPU_LIBDIR)/libbilin_scaler_spu.a
38 $(PPU_EMBEDSPU) -m32 yuv2rgb_spu yuv2rgb_spu yuv2rgb_spu-embed.o 60 $(INSTALL) -c -m 0755 $(SPU_LIBDIR)/libfb_writer_spu.so $(DESTDIR)$(libdir)/.
61 $(INSTALL) -c -m 0655 $(SPU_LIBDIR)/libfb_writer_spu.a $(DESTDIR)$(libdir)/.
62 $(INSTALL) -c -m 0755 $(SPU_LIBDIR)/libyuv2rgb_spu.so $(DESTDIR)$(libdir)/.
63 $(INSTALL) -c -m 0655 $(SPU_LIBDIR)/libyuv2rgb_spu.a $(DESTDIR)$(libdir)/.
64 $(INSTALL) -c -m 0755 $(SPU_LIBDIR)/libbilin_scaler_spu.so $(DESTDIR)$(libdir)/.
65 $(INSTALL) -c -m 0655 $(SPU_LIBDIR)/libbilin_scaler_spu.a $(DESTDIR)$(libdir)/.
39 66
40 libyuv2rgb_spu.a: yuv2rgb_spu-embed.o 67 ps3libs-uninstall:
41 $(PPU_AR) -qcs libyuv2rgb_spu.a yuv2rgb_spu-embed.o 68 rm -f $(DESTDIR)$(libdir)/libfb_writer_spu.a
69 rm -f $(DESTDIR)$(libdir)/libfb_writer_spu.so
70 rm -f $(DESTDIR)$(libdir)/libyuv2rgb_spu.so
71 rm -f $(DESTDIR)$(libdir)/libyuv2rgb_spu.a
72 rm -f $(DESTDIR)$(libdir)/libbilin_scaler_spu.so
73 rm -f $(DESTDIR)$(libdir)/libbilin_scaler_spu.a
42 74
43 libyuv2rgb_spu.so: yuv2rgb_spu-embed.o 75 ps3libs-clean:
44 $(PPU_LD) -o libyuv2rgb_spu.so -shared -soname=libyuv2rgb_spu.so yuv2rgb_spu-embed.o 76 rm -f $(SPU_LIBDIR)/*
45
46
47 # bilin_scaler
48 bilin_scaler_spu-embed.o: bilin_scaler.c spu_common.h
49 $(SPU_GCC) $(SPU_CFLAGS) -o bilin_scaler_spu bilin_scaler.c -lm
50 $(PPU_EMBEDSPU) -m32 bilin_scaler_spu bilin_scaler_spu bilin_scaler_spu-embed.o
51
52 libbilin_scaler_spu.a: bilin_scaler_spu-embed.o
53 $(PPU_AR) -qcs libbilin_scaler_spu.a bilin_scaler_spu-embed.o
54
55 libbilin_scaler_spu.so: bilin_scaler_spu-embed.o
56 $(PPU_LD) -o libbilin_scaler_spu.so -shared -soname=libbilin_scaler_spu.so bilin_scaler_spu-embed.o
57
58 install: libfb_writer_spu.a libfb_writer_spu.so \
59 libyuv2rgb_spu.so libyuv2rgb_spu.a \
60 libbilin_scaler_spu.so libbilin_scaler_spu.a
61 $(INSTALL) -c -m 0755 libfb_writer_spu.so $(PREFIX)/.
62 $(INSTALL) -c -m 0655 libfb_writer_spu.a $(PREFIX)/.
63 $(INSTALL) -c -m 0755 libyuv2rgb_spu.so $(PREFIX)/.
64 $(INSTALL) -c -m 0655 libyuv2rgb_spu.a $(PREFIX)/.
65 $(INSTALL) -c -m 0755 libbilin_scaler_spu.so $(PREFIX)/.
66 $(INSTALL) -c -m 0655 libbilin_scaler_spu.a $(PREFIX)/.
67
68
69 uninstall: $(PREFIX)/libfb_writer_spu.so $(PREFIX)/libfb_writer_spu.a \
70 $(PREFIX)/libyuv2rgb_spu.so $(PREFIX)/libyuv2rgb_spu.a \
71 $(PREFIX)/libbilin_scaler_spu.so $(PREFIX)/libbilin_scaler_spu.a
72 rm -f $(PREFIX)/libfb_writer_spu.a
73 rm -f $(PREFIX)/libfb_writer_spu.so
74 rm -f $(PREFIX)/libyuv2rgb_spu.so
75 rm -f $(PREFIX)/libyuv2rgb_spu.a
76 rm -f $(PREFIX)/libbilin_scaler_spu.so
77 rm -f $(PREFIX)/libbilin_scaler_spu.a
78
79
80 clean:
81 rm -f bilin_scaler_spu-embed.o libbilin_scaler_spu.so libbilin_scaler_spu.a bilin_scaler_spu
82 rm -f yuv2rgb_spu-embed.o libyuv2rgb_spu.so libyuv2rgb_spu.a yuv2rgb_spu
83 rm -f fb_writer_spu-embed.o libfb_writer_spu.so libfb_writer_spu.a fb_writer_spu