Statistics
| Branch: | Tag: | Revision:

streamers-build / THIRDPARTY-LIBS / Makefile @ 80a25ec3

History | View | Annotate | Download (4.95 KB)

1
THIRDPARTYLIBS = $(shell pwd)
2
#NAPA-LIBS = NAPA-BASELIBS/monl/libmon.a NAPA-BASELIBS/ml/libml.a
3
#GRAPES-LIBS = GRAPES/src/libgrapes.a
4
#LIBS = $(GRAPES-LIBS) $(NAPA-LIBS)
5

    
6
NOGIT := $(shell [ -d ../.git ] || echo 1)
7
GITREPOCHECK = .git/HEAD
8

    
9
#configure FFMPEG
10
CONFIG_FFMPEG += --disable-sse #required because of an error in recent ffmpeg version in case of -bf > 0
11
CONFIG_FFMPEG += --disable-vaapi #there seems to be no static version of vaapi, so it creates problems in distributed binaries
12
CONFIG_FFMPEG += --enable-gpl
13
CONFIG_FFMPEG += --disable-doc #for less build dependecies and faster build
14
ifeq ($(HOSTARCH),mingw32)
15
CONFIG_FFMPEG += --arch=i586 --enable-cross-compile --cross-prefix=i586-mingw32msvc- --target-os=mingw32 --enable-memalign-hack --disable-pthreads
16
else
17
CONFIG_FFMPEG += --enable-pthreads
18
CONFIG_FFMPEG += --enable-libx264
19
CONFIG_FFMPEG_CFLAGS += -I$(THIRDPARTYLIBS)/x264-install/include
20
CONFIG_FFMPEG_LDFLAGS += -L$(THIRDPARTYLIBS)/x264-install/lib
21
CONFIG_FFMPEG += --enable-libvorbis
22
CONFIG_FFMPEG_CFLAGS += -I$(THIRDPARTYLIBS)/libvorbis-install/include
23
CONFIG_FFMPEG_LDFLAGS += -L$(THIRDPARTYLIBS)/libvorbis-install/lib
24
CONFIG_FFMPEG_CFLAGS += -I$(THIRDPARTYLIBS)/libogg-install/include
25
CONFIG_FFMPEG_LDFLAGS += -L$(THIRDPARTYLIBS)/libogg-install/lib
26
CONFIG_FFMPEG += --enable-libmp3lame
27
CONFIG_FFMPEG_CFLAGS += -I$(THIRDPARTYLIBS)/mp3lame-install/include
28
CONFIG_FFMPEG_LDFLAGS += -L$(THIRDPARTYLIBS)/mp3lame-install/lib
29
endif
30
CONFIG_FFMPEG += --extra-cflags='$(CONFIG_FFMPEG_CFLAGS)'
31
CONFIG_FFMPEG += --extra-ldflags='$(CONFIG_FFMPEG_LDFLAGS)'
32

    
33
ifeq ($(HOSTARCH),mingw32)
34
FLAGS_GRAPES += ARCH=win32
35
ALTO_OPTION = ALTO=0
36
endif
37

    
38
WGET_OR_CURL = $(shell which wget || echo "curl -O -L")
39

    
40
.PHONY: GRAPES-build NAPA-build all
41

    
42
all: GRAPES-build NAPA-build
43

    
44
ifndef NOGIT
45
x264/$(GITREPOCHECK) ffmpeg/$(GITREPOCHECK) GRAPES/$(GITREPOCHECK) NAPA-BASELIBS/$(GITREPOCHECK):
46
	cd .. && git submodule init $(THIRDPARTYLIBS)/$(@:/$(GITREPOCHECK)=)
47
	cd .. && git submodule update $(THIRDPARTYLIBS)/$(@:/$(GITREPOCHECK)=)
48

    
49
x264/config.mak: x264/$(GITREPOCHECK)
50

    
51
ffmpeg/config.mak: ffmpeg/$(GITREPOCHECK)
52

    
53
GRAPES-build: GRAPES/$(GITREPOCHECK)
54

    
55
NAPA-build: NAPA-BASELIBS/$(GITREPOCHECK)
56
endif
57

    
58
x264/config.mak:
59
	cd x264 && ./configure --disable-lavf --prefix=$(THIRDPARTYLIBS)/x264-install/ || { echo "Error configuring x264" && exit 1; }
60

    
61
x264-install: x264/config.mak
62
	$(MAKE) -C x264 || { echo "Error compiling x264" && exit 1; }
63
	$(MAKE) -C x264 install-lib-static  || { echo "Error installing x264" && exit 1; }
64
	touch x264-install
65

    
66
libogg:
67
	$(WGET_OR_CURL) http://downloads.xiph.org/releases/ogg/libogg-1.2.2.tar.gz && tar xzf libogg-1.2.2.tar.gz && mv libogg-1.2.2 libogg && rm libogg-1.2.2.tar.gz
68

    
69
libogg-install: libogg
70
	cd libogg && ./configure --disable-oggtest --disable-shared --prefix=$(THIRDPARTYLIBS)/libogg-install/ && make && make install
71

    
72
libvorbis:
73
	$(WGET_OR_CURL) http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.2.tar.gz && tar xzf libvorbis-1.3.2.tar.gz && mv libvorbis-1.3.2 libvorbis && rm libvorbis-1.3.2.tar.gz
74

    
75
libvorbis-install: libvorbis libogg-install
76
	cd libvorbis && ./configure --disable-oggtest --disable-shared --prefix=$(THIRDPARTYLIBS)/libvorbis-install/ --with-ogg=$(THIRDPARTYLIBS)/libogg-install/ && make && make install
77

    
78
mp3lame:
79
	$(WGET_OR_CURL) http://sourceforge.net/projects/lame/files/lame/3.98.4/lame-3.98.4.tar.gz && tar xzf lame-3.98.4.tar.gz && rm -f lame-3.98.4.tar.gz && mv lame-3.98.4 mp3lame;
80

    
81
mp3lame-install: mp3lame
82
	cd mp3lame && ./configure --disable-gtktest --disable-frontend --disable-shared --prefix=$(THIRDPARTYLIBS)/mp3lame-install/ ${HOSTARCH:+--host=$HOSTARCH} && make && make install
83

    
84
ifneq ($(HOSTARCH),mingw32)
85
ffmpeg/config.mak: x264-install libvorbis-install libogg-install mp3lame-install
86
endif
87
ffmpeg/config.mak:
88
	cd ffmpeg && ./configure --prefix=$(THIRDPARTYLIBS)/ffmpeg-install $(CONFIG_FFMPEG) || { echo "Error configuring ffmpeg" && exit 1; }
89
	#in case x264 is not reqired (do we need the encoding?): ./configure --enable-gpl --enable-pthreads --prefix=$BASEDIR/ffmpeg-install
90

    
91
ffmpeg-install: ffmpeg/config.mak
92
	$(MAKE) -C ffmpeg || { echo "Error compiling ffmpeg" && exit 1; }
93
	$(MAKE) -C ffmpeg install || { echo "Error installing ffmpeg" && exit 1; }
94
	touch ffmpeg-install
95

    
96
GRAPES-build: ffmpeg-install
97
	$(FLAGS_GRAPES) FFDIR=$(THIRDPARTYLIBS)/ffmpeg $(MAKE) -C GRAPES || { echo "Error compiling GRAPES" && exit 1; }
98

    
99
NAPA-build:
100
	cd NAPA-BASELIBS && $(ALTO_OPTION) ./build_all.sh -q
101

    
102
clean:
103
	$(MAKE) -C GRAPES clean
104
	$(MAKE) -C NAPA-BASELIBS clean
105

    
106
distclean:
107
	[ ! -d GRAPES ] || $(MAKE) -C GRAPES clean
108
	[ ! -d NAPA-BASELIBS ] || $(MAKE) -C NAPA-BASELIBS clean
109
	rm -rf libx264-install
110
	[ ! -d x264 ] || $(MAKE) -C x264 distclean || true
111
	rm -rf ffmpeg-install
112
	[ ! -d ffmpeg ] || $(MAKE) -C ffmpeg distclean || true
113
	rm -rf mp3lame-install
114
	[ ! -d mp3lame ] || $(MAKE) -C mp3lame distclean || true
115
	rm -rf libvorbis-install
116
	[ ! -d libvorbis ] || $(MAKE) -C libvorbis distclean || true
117
	rm -rf libogg-install
118
	[ ! -d libogg ] || $(MAKE) -C libogg distclean || true