1
|
include Makefile.include
|
2
|
|
3
|
CFLAGS+=-std=c++0x -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DTARGET_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CMAKE_CONFIG -D__VIDEOCORE4__ -U_FORTIFY_SOURCE -Wall -DHAVE_OMXLIB -DUSE_EXTERNAL_FFMPEG -DHAVE_LIBAVCODEC_AVCODEC_H -DHAVE_LIBAVUTIL_OPT_H -DHAVE_LIBAVUTIL_MEM_H -DHAVE_LIBAVUTIL_AVUTIL_H -DHAVE_LIBAVFORMAT_AVFORMAT_H -DHAVE_LIBAVFILTER_AVFILTER_H -DHAVE_LIBSWRESAMPLE_SWRESAMPLE_H -DOMX -DOMX_SKIP64BIT -ftree-vectorize -DUSE_EXTERNAL_OMX -DTARGET_RASPBERRY_PI -DUSE_EXTERNAL_LIBBCM_HOST
|
4
|
|
5
|
LDFLAGS+=-L./ -Lffmpeg_compiled/usr/local/lib/ -lc -lbrcmGLESv2 -lbrcmEGL -lbcm_host -lopenmaxil -lfreetype -lz -lasound -lpng -lbz2
|
6
|
|
7
|
INCLUDES+=-I./ -Ilinux -Iffmpeg_compiled/usr/local/include/ -I /usr/include/dbus-1.0 -I /usr/lib/arm-linux-gnueabihf/dbus-1.0/include
|
8
|
|
9
|
DIST ?= omxplayer-dist
|
10
|
|
11
|
SRC= linux/XMemUtils.cpp \
|
12
|
linux/OMXAlsa.cpp \
|
13
|
utils/log.cpp \
|
14
|
DynamicDll.cpp \
|
15
|
utils/PCMRemap.cpp \
|
16
|
utils/RegExp.cpp \
|
17
|
OMXSubtitleTagSami.cpp \
|
18
|
OMXOverlayCodecText.cpp \
|
19
|
BitstreamConverter.cpp \
|
20
|
linux/RBP.cpp \
|
21
|
OMXThread.cpp \
|
22
|
OMXReader.cpp \
|
23
|
OMXStreamInfo.cpp \
|
24
|
OMXAudioCodecOMX.cpp \
|
25
|
OMXCore.cpp \
|
26
|
OMXVideo.cpp \
|
27
|
OMXAudio.cpp \
|
28
|
OMXClock.cpp \
|
29
|
File.cpp \
|
30
|
OMXPlayerVideo.cpp \
|
31
|
OMXPlayerAudio.cpp \
|
32
|
OMXPlayerSubtitles.cpp \
|
33
|
SubtitleRenderer.cpp \
|
34
|
Unicode.cpp \
|
35
|
Srt.cpp \
|
36
|
KeyConfig.cpp \
|
37
|
OMXControl.cpp \
|
38
|
Keyboard.cpp \
|
39
|
omxplayer.cpp \
|
40
|
|
41
|
OBJS+=$(filter %.o,$(SRC:.cpp=.o))
|
42
|
|
43
|
all: omxplayer.bin
|
44
|
|
45
|
%.o: %.cpp
|
46
|
@rm -f $@
|
47
|
$(CXX) $(CFLAGS) $(INCLUDES) -c $< -o $@ -Wno-deprecated-declarations
|
48
|
|
49
|
omxplayer.o: help.h keys.h
|
50
|
|
51
|
version:
|
52
|
bash gen_version.sh > version.h
|
53
|
|
54
|
omxplayer.bin: version $(OBJS)
|
55
|
$(CXX) $(LDFLAGS) -o omxplayer.bin $(OBJS) -lvchiq_arm -lvchostif -lvcos -ldbus-1 -lrt -lpthread -lavutil -lavcodec -lavformat -lswscale -lswresample -lpcre
|
56
|
$(STRIP) omxplayer.bin
|
57
|
|
58
|
help.h: README.md Makefile
|
59
|
awk '/SYNOPSIS/{p=1;print;next} p&&/KEY BINDINGS/{p=0};p' $< \
|
60
|
| sed -e '1,3 d' -e 's/^/"/' -e 's/$$/\\n"/' \
|
61
|
> $@
|
62
|
|
63
|
keys.h: README.md Makefile
|
64
|
awk '/KEY BINDINGS/{p=1;print;next} p&&/KEY CONFIG/{p=0};p' $< \
|
65
|
| sed -e '1,3 d' -e 's/^/"/' -e 's/$$/\\n"/' \
|
66
|
> $@
|
67
|
|
68
|
xomxplayer.1: README.md
|
69
|
sed -e '/DOWNLOADING/,/omxplayer-dist/ d; /DBUS/,$$ d' $< >MAN
|
70
|
curl -F page=@MAN http://mantastic.herokuapp.com 2>/dev/null >$@
|
71
|
|
72
|
clean:
|
73
|
for i in $(OBJS); do (if test -e "$$i"; then ( rm $$i ); fi ); done
|
74
|
@rm -f omxplayer.old.log omxplayer.log
|
75
|
@rm -f omxplayer.bin
|
76
|
@rm -rf $(DIST)
|
77
|
@rm -f omxplayer-dist.tar.gz
|
78
|
|
79
|
ffmpeg:
|
80
|
make -f Makefile.ffmpeg
|
81
|
make -f Makefile.ffmpeg install
|
82
|
|
83
|
dist: omxplayer.bin
|
84
|
mkdir -p $(DIST)/usr/lib/omxplayer
|
85
|
mkdir -p $(DIST)/usr/bin
|
86
|
mkdir -p $(DIST)/usr/share/doc/omxplayer
|
87
|
mkdir -p $(DIST)/usr/share/man/man1
|
88
|
cp omxplayer omxplayer.bin $(DIST)/usr/bin
|
89
|
cp COPYING $(DIST)/usr/share/doc/omxplayer
|
90
|
cp README.md $(DIST)/usr/share/doc/omxplayer/README
|
91
|
cp -a ffmpeg_compiled/usr/local/lib/*.so* $(DIST)/usr/lib/omxplayer/
|
92
|
|
93
|
clobber:
|
94
|
@make -f Makefile.ffmpeg clobber
|
95
|
@make --no-print-directory clean
|