aboutsummaryrefslogtreecommitdiff
path: root/lib/Makefile.in
blob: 778f525aeb1ca0d68135f77fb428d11b39a3bf1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
ARCH=@ARCH@

LD=@LD@
CC=@CC@
CXX=@CXX@
SHELL=@SHELL@
ifeq ($(findstring osx,$(ARCH)),osx)
ifeq ($(findstring arm,$(ARCH)),arm)
LDFLAGS=-arch armv7 -iphoneos_version_min 4.1 -bundle -undefined dynamic_lookup -read_only_relocs suppress
else
LDFLAGS=-bundle -undefined dynamic_lookup -read_only_relocs suppress
endif
else
LDFLAGS=-shared -fPIC -rdynamic
endif
SYSDIR=@abs_top_srcdir@/system/players/dvdplayer
WRAPPER=@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o
WRAPPER_MACH_ALIAS=@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper_mach_alias

DIRS=
ifneq (@USE_EXTERNAL_FFMPEG@,1)
  DIRS+=ffmpeg
endif

LIBS=
ifneq (@USE_EXTERNAL_FFMPEG@,1)
  LIBS+=avutil-50-$(ARCH).so \
	avcodec-52-$(ARCH).so \
	avcore-0-$(ARCH).so \
	avformat-52-$(ARCH).so \
	postproc-51-$(ARCH).so \
	avfilter-1-$(ARCH).so \
	swscale-0-$(ARCH).so
endif

ifneq (,$(findstring powerpc,$(ARCH)))
  ARCH_DIR=ppc
else
ifeq ($(findstring arm,$(ARCH)),arm)
  ARCH_DIR=arm
else
  ARCH_DIR=x86
endif
endif

.PHONY: $(DIRS) codecs

codecs: $(addprefix $(SYSDIR)/, $(LIBS));


ifeq ($(findstring osx,$(ARCH)), osx)
# Add -lbundle1.o for powerpc-osx
ifeq ($(ARCH), powerpc-osx)
BUNDLE1_O = -lbundle1.o
endif

$(SYSDIR)/avutil-50-$(ARCH).so: $(WRAPPER) ffmpeg/libavutil/libavutil.dylib
	$(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS) -o $@ \
		$(WRAPPER) ffmpeg/libavutil/*.o \
		ffmpeg/libavutil/$(ARCH_DIR)/*.o $(BUNDLE1_O)

$(SYSDIR)/avcodec-52-$(ARCH).so: $(WRAPPER) ffmpeg/libavcodec/libavcodec.dylib
	$(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS) -o $@ \
		$(WRAPPER) ffmpeg/libavcodec/*.o \
		ffmpeg/libavcodec/$(ARCH_DIR)/*.o $(BUNDLE1_O)

$(SYSDIR)/avcore-0-$(ARCH).so: $(WRAPPER) ffmpeg/libavcore/libavcore.dylib
	$(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS)  -o $@ \
		$(WRAPPER) ffmpeg/libavcore/*.o $(BUNDLE1_O)

$(SYSDIR)/avformat-52-$(ARCH).so: $(WRAPPER) ffmpeg/libavformat/libavformat.dylib
	$(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS)  -o $@ \
		$(WRAPPER) ffmpeg/libavformat/*.o $(BUNDLE1_O)

ifeq ($(findstring x86,$(ARCH_DIR)), x86)
$(SYSDIR)/avfilter-1-$(ARCH).so: $(WRAPPER) ffmpeg/libavfilter/libavfilter.dylib
	$(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS)  -o $@ \
		$(WRAPPER) ffmpeg/libavfilter/$(ARCH_DIR)/*.o \
		ffmpeg/libavfilter/*.o $(BUNDLE1_O)
else # No libavfilter/ppc or libavfilter/arm
$(SYSDIR)/avfilter-1-$(ARCH).so: $(WRAPPER) ffmpeg/libavfilter/libavfilter.dylib
	$(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS)  -o $@ \
		$(WRAPPER) ffmpeg/libavfilter/*.o $(BUNDLE1_O)
endif

ifneq ($(findstring arm,$(ARCH)), arm)
$(SYSDIR)/swscale-0-$(ARCH).so: $(WRAPPER) ffmpeg/libswscale/libswscale.dylib
	$(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS)  -o $@ \
		$(WRAPPER) ffmpeg/libswscale/*.o \
		ffmpeg/libswscale/$(ARCH_DIR)/*.o $(BUNDLE1_O)
else # No ARM version of swscale available yet.
$(SYSDIR)/swscale-0-$(ARCH).so: $(WRAPPER) ffmpeg/libswscale/libswscale.dylib
	$(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS)  -o $@ \
		$(WRAPPER) ffmpeg/libswscale/*.o
endif

$(SYSDIR)/postproc-51-$(ARCH).so: $(WRAPPER) ffmpeg/libpostproc/libpostproc.dylib
	$(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS)  -o $@ \
		$(WRAPPER) ffmpeg/libpostproc/*.o $(BUNDLE1_O)

ffmpeg/libavutil/libavutil.dylib     : ffmpeg;
ffmpeg/libavcodec/libavcodec.dylib   : ffmpeg;
ffmpeg/libavcore/libavcore.dylib     : ffmpeg;
ffmpeg/libavformat/libavformat.dylib : ffmpeg;
ffmpeg/libavformat/libavfilter.dylib : ffmpeg;
ffmpeg/libswscale/libswscale.dylib   : ffmpeg;
ffmpeg/libpostproc/libpostproc.dylib : ffmpeg;
ffmpeg:
	$(MAKE) -C $@

else

$(SYSDIR)/avutil-50-$(ARCH).so: ffmpeg/libavutil/libavutil.so
	cp ffmpeg/libavutil/libavutil.so $@

$(SYSDIR)/avcodec-52-$(ARCH).so: $(WRAPPER) ffmpeg/libavcodec/libavcodec.so
	cp ffmpeg/libavcodec/libavcodec.so $@

$(SYSDIR)/avcore-0-$(ARCH).so: $(WRAPPER) ffmpeg/libavcore/libavcore.so
	cp ffmpeg/libavcore/libavcore.so $@

$(SYSDIR)/avformat-52-$(ARCH).so: $(WRAPPER) ffmpeg/libavformat/libavformat.so
	cp ffmpeg/libavformat/libavformat.so $@

$(SYSDIR)/avfilter-1-$(ARCH).so: $(WRAPPER) ffmpeg/libavfilter/libavfilter.so
	cp ffmpeg/libavfilter/libavfilter.so $@

ifneq ($(ARCH), arm)
$(SYSDIR)/swscale-0-$(ARCH).so: $(WRAPPER) ffmpeg/libswscale/libswscale.so
	cp ffmpeg/libswscale/libswscale.so $@
else # No ARM version of swscale available yet.
$(SYSDIR)/swscale-0-$(ARCH).so: $(WRAPPER) ffmpeg/libswscale/libswscale.so
	$(CC) -o $@ $(LDFLAGS) -Wl,--soname,$@ -Wl,-Bsymbolic \
		ffmpeg/libswscale/*.o \
		`cat $(WRAPPER:.o=.def)` $(WRAPPER)
endif

$(SYSDIR)/postproc-51-$(ARCH).so: $(WRAPPER) ffmpeg/libpostproc/libpostproc.so
	cp ffmpeg/libpostproc/libpostproc.so $@

ffmpeg/libavutil/libavutil.so     : ffmpeg;
ffmpeg/libavcodec/libavcodec.so   : ffmpeg;
ffmpeg/libavcore/libavcore.so     : ffmpeg;
ffmpeg/libavformat/libavformat.so : ffmpeg;
ffmpeg/libavfilter/libavfilter.so : ffmpeg;
ffmpeg/libswscale/libswscale.so   : ffmpeg;
ffmpeg/libpostproc/libpostproc.so : ffmpeg;
ffmpeg:
	$(MAKE) -C $@

endif

clean:
	rm -f $(addprefix $(SYSDIR)/, $(LIBS))
	for d in $(DIRS); do (if test -f "$$d/Makefile"; then ($(MAKE) -C "$$d" clean); fi ); done

distclean:
	rm -f $(addprefix $(SYSDIR)/, $(LIBS))
	for d in $(DIRS); do (if test -f "$$d/Makefile"; then ($(MAKE) -C "$$d" distclean || $(MAKE) -C "$$d" clean); fi ); done