forked from JeffCost/pwomxplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
93 lines (74 loc) · 3.14 KB
/
Makefile
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
include Makefile.include
GLIB_FLAGS := $(shell pkg-config --cflags glib-2.0)
GLIB_LIBS := $(shell pkg-config --libs glib-2.0)
OT_FLAGS =
OT_LIBS = -lpwtilemap -lpwutil
CFLAGS+=-std=c++0x -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_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
LDFLAGS+=-L./ -lc -lEGL -lGLESv2 -lbrcmEGL -lbrcmGLESv2 -lvcos -lvchiq_arm -lbcm_host -lopenmaxil -lfreetype -lz -Lffmpeg_compiled/usr/local/lib/ $(OT_LIBS) -L$(SDKSTAGE)/usr/local/lib
ifeq ($(NATIVE_BUILD),1)
INCLUDES+=-I./ -Ilinux -Iffmpeg_compiled/usr/local/include/ $(OT_FLAGS) $(GLIB_FLAGS)
else
INCLUDES=-I./ -Ilinux -Iffmpeg_compiled/usr/local/include/ $(OT_FLAGS) $(GLIB_FLAGS) -isystem$(SDKSTAGE)/usr/include -isystem$(SDKSTAGE)/opt/vc/include -isystem/home/hp/raspberrypi/rootfs/usr/include/arm-linux-gnueabihf -isystem$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads -isystem$(SDKSTAGE)/usr/include/freetype2 -isystem$(SDKSTAGE)/usr/include/glib-2.0 -isystem$(SDKSTAGE)/usr/local/include
endif
DIST ?= pwomxplayer-dist
SRC=linux/XMemUtils.cpp \
utils/log.cpp \
DynamicDll.cpp \
utils/PCMRemap.cpp \
utils/RegExp.cpp \
OMXSubtitleTagSami.cpp \
OMXOverlayCodecText.cpp \
BitstreamConverter.cpp \
linux/RBP.cpp \
OMXThread.cpp \
OMXReader.cpp \
OMXStreamInfo.cpp \
OMXAudioCodecOMX.cpp \
OMXCore.cpp \
OMXVideo.cpp \
OMXAudio.cpp \
OMXClock.cpp \
File.cpp \
OMXPlayerVideo.cpp \
OMXPlayerAudio.cpp \
OMXPlayerSubtitles.cpp \
SubtitleRenderer.cpp \
Unicode.cpp \
Srt.cpp \
omxplayer.cpp \
OBJS+=$(filter %.o,$(SRC:.cpp=.o))
all: pwomxplayer.bin
%.o: %.cpp
@rm -f $@
$(CXX) -MMD $(CFLAGS) $(INCLUDES) -c $< -o $@ -Wno-deprecated-declarations
list_test:
$(CXX) -O3 -o list_test list_test.cpp
pwomxplayer.bin: $(OBJS)
$(CXX) $(LDFLAGS) -o $@ $(OBJS) -lrt -lpthread -lavutil -lavcodec -lavformat -lswscale -lswresample -lpcre
#$(TOOLCHAIN)/bin/$(HOST)-strip pwomxplayer.bin
#arm-unknown-linux-gnueabi omxplayer.bin
-include $(OBJS:.o=.d)
clean:
for i in $(OBJS); do (if test -e "$$i"; then ( rm $$i ); fi ); done
@rm -f omxplayer.old.log omxplayer.log
@rm -f pwomxplayer.bin
@rm -rf $(DIST)
@rm -f omxplayer-dist.tar.gz
make -f Makefile.ffmpeg clean
ffmpeg:
@rm -rf ffmpeg
make -f Makefile.ffmpeg
make -f Makefile.ffmpeg install
ffmpeg_compile:
make -f Makefile.ffmpeg compile
ffmpeg_install:
make -f Makefile.ffmpeg install
dist: pwomxplayer.bin
mkdir -p $(DIST)/usr/lib/pwomxplayer
mkdir -p $(DIST)/usr/bin
mkdir -p $(DIST)/usr/share/doc
cp pwomxplayer pwomxplayer.bin $(DIST)/usr/bin
cp COPYING $(DIST)/usr/share/doc/
cp README.md $(DIST)/usr/share/doc/README
cp -a ffmpeg_compiled/usr/local/lib/*.so* $(DIST)/usr/lib/pwomxplayer/
tar -czf pwomxplayer-dist.tar.gz $(DIST)