Project

General

Profile

Bug #400 ยป Makefile

Corrected Makefile for omxplayer - Hammel, 02 Dec 2014 10:37

 
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 -lWFC -lGLESv2 -lEGL -lbcm_host -lopenmaxil -lfreetype -lz
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
		utils/log.cpp \
13
		DynamicDll.cpp \
14
		utils/PCMRemap.cpp \
15
		utils/RegExp.cpp \
16
		OMXSubtitleTagSami.cpp \
17
		OMXOverlayCodecText.cpp \
18
		BitstreamConverter.cpp \
19
		linux/RBP.cpp \
20
		OMXThread.cpp \
21
		OMXReader.cpp \
22
		OMXStreamInfo.cpp \
23
		OMXAudioCodecOMX.cpp \
24
		OMXCore.cpp \
25
		OMXVideo.cpp \
26
		OMXAudio.cpp \
27
		OMXClock.cpp \
28
		File.cpp \
29
		OMXPlayerVideo.cpp \
30
		OMXPlayerAudio.cpp \
31
		OMXPlayerSubtitles.cpp \
32
		SubtitleRenderer.cpp \
33
		Unicode.cpp \
34
		Srt.cpp \
35
		KeyConfig.cpp \
36
		OMXControl.cpp \
37
		Keyboard.cpp \
38
		omxplayer.cpp \
39

    
40
OBJS+=$(filter %.o,$(SRC:.cpp=.o))
41

    
42
all: omxplayer.bin
43

    
44
%.o: %.cpp
45
	@rm -f $@ 
46
	$(CXX) $(CFLAGS) $(INCLUDES) -c $< -o $@ -Wno-deprecated-declarations
47

    
48
omxplayer.o: help.h keys.h
49

    
50
version:
51
	bash gen_version.sh > version.h 
52

    
53
omxplayer.bin: version $(OBJS)
54
	$(CXX) $(LDFLAGS) -o omxplayer.bin $(OBJS) -lvchiq_arm -lvcos -ldbus-1 -lrt -lpthread -lavutil -lavcodec -lavformat -lswscale -lswresample -lpcre
55
	$(STRIP) omxplayer.bin
56

    
57
help.h: README.md Makefile
58
	awk '/^Using /{p=1;print;next} p&&/^Key Bindings/{p=0};p' $< \
59
	| sed -e '1,3 d' -e 's/^/"/' -e 's/$$/\\n"/' \
60
	> $@
61
keys.h: README.md Makefile
62
	awk '/^Key Bindings/{p=1;print;next} p&&/^Key Config/{p=0};p' $< \
63
	| sed -e '1,3 d' -e 's/^/"/' -e 's/$$/\\n"/' \
64
	> $@
65

    
66
clean:
67
	for i in $(OBJS); do (if test -e "$$i"; then ( rm $$i ); fi ); done
68
	@rm -f omxplayer.old.log omxplayer.log
69
	@rm -f omxplayer.bin
70
	@rm -rf $(DIST)
71
	@rm -f omxplayer-dist.tar.gz
72

    
73
ffmpeg:
74
	@rm -rf ffmpeg
75
	make -f Makefile.ffmpeg
76
	make -f Makefile.ffmpeg install
77

    
78
dist: omxplayer.bin
79
	mkdir -p $(DIST)/usr/lib/omxplayer
80
	mkdir -p $(DIST)/usr/bin
81
	mkdir -p $(DIST)/usr/share/doc/omxplayer
82
	cp omxplayer omxplayer.bin $(DIST)/usr/bin
83
	cp COPYING $(DIST)/usr/share/doc/omxplayer
84
	cp README.md $(DIST)/usr/share/doc/omxplayer/README
85
	cp -a ffmpeg_compiled/usr/local/lib/*.so* $(DIST)/usr/lib/omxplayer/
86
	cd $(DIST); tar -czf ../$(DIST).tgz *
    (1-1/1)