Statistics
| Branch: | Tag: | Revision:

streamers-build / THIRDPARTY-LIBS / Makefile @ 15cd13c3

History | View | Annotate | Download (4.29 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

    
8
#configure FFMPEG
9
CONFIG_FFMPEG += --disable-sse #required because of an error in recent ffmpeg version in case of -bf > 0
10
CONFIG_FFMPEG += --enable-gpl
11
ifeq ($(HOSTARCH),mingw32)
12
CONFIG_FFMPEG += --arch=i586 --enable-cross-compile --cross-prefix=i586-mingw32msvc- --target-os=mingw32 --enable-memalign-hack --disable-pthreads
13
else
14
CONFIG_FFMPEG += --enable-pthreads
15
CONFIG_FFMPEG += --enable-libx264
16
CONFIG_FFMPEG_CFLAGS += -I$(THIRDPARTYLIBS)/x264-install/include
17
CONFIG_FFMPEG_LDFLAGS += -L$(THIRDPARTYLIBS)/x264-install/lib
18
CONFIG_FFMPEG += --enable-libvorbis
19
CONFIG_FFMPEG_CFLAGS += -I$(THIRDPARTYLIBS)/libvorbis-install/include
20
CONFIG_FFMPEG_LDFLAGS += -L$(THIRDPARTYLIBS)/libvorbis-install/lib
21
CONFIG_FFMPEG_CFLAGS += -I$(THIRDPARTYLIBS)/libogg-install/include
22
CONFIG_FFMPEG_LDFLAGS += -L$(THIRDPARTYLIBS)/libogg-install/lib
23
CONFIG_FFMPEG += --enable-libmp3lame
24
CONFIG_FFMPEG_CFLAGS += -I$(THIRDPARTYLIBS)/mp3lame-install/include
25
CONFIG_FFMPEG_LDFLAGS += -L$(THIRDPARTYLIBS)/mp3lame-install/lib
26
endif
27
CONFIG_FFMPEG += --extra-cflags='$(CONFIG_FFMPEG_CFLAGS)'
28
CONFIG_FFMPEG += --extra-ldflags='$(CONFIG_FFMPEG_LDFLAGS)'
29

    
30
ifeq ($(HOSTARCH),mingw32)
31
FLAGS_GRAPES += ARCH=win32
32
ALTO_OPTION = ALTO=0
33
endif
34

    
35
WGET_OR_CURL = $(shell which wget || echo "curl -O -L")
36

    
37
.PHONY: GRAPES-build NAPA-build all
38

    
39
all: GRAPES-build NAPA-build
40

    
41
ifndef NOGIT
42
x264/.git:
43
	cd .. && git submodule update --init $(shell dirname $(THIRDPARTYLIBS)/$@)
44

    
45
x264/config.mak: x264/.git
46

    
47
ffmpeg/.git:
48
	cd .. && git submodule update --init $(shell dirname $(THIRDPARTYLIBS)/$@)
49

    
50
ffmpeg/config.mak: ffmpeg/.git
51

    
52
GRAPES/.git:
53
	cd .. && git submodule update --init $(shell dirname $(THIRDPARTYLIBS)/$@)
54

    
55
GRAPES-build: GRAPES/.git
56

    
57
NAPA-BASELIBS/.git:
58
	cd .. && git submodule update --init $(shell dirname $(THIRDPARTYLIBS)/$@)
59

    
60
NAPA-build: NAPA-BASELIBS/.git
61
endif
62

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

    
66
x264-install: x264/config.mak
67
	$(MAKE) -C x264 || { echo "Error compiling x264" && exit 1; }
68
	$(MAKE) -C x264 install-lib-static  || { echo "Error installing x264" && exit 1; }
69
	touch x264-install
70

    
71
libogg:
72
	$(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
73

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

    
77
libvorbis:
78
	$(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
79

    
80
libvorbis-install: libvorbis libogg-install
81
	cd libvorbis && ./configure --disable-oggtest --disable-shared --prefix=$(THIRDPARTYLIBS)/libvorbis-install/ --with-ogg=$(THIRDPARTYLIBS)/libogg-install/ && make && make install
82

    
83
mp3lame:
84
	$(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;
85

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

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

    
96
ffmpeg-install: ffmpeg/config.mak
97
	$(MAKE) -C ffmpeg || { echo "Error compiling ffmpeg" && exit 1; }
98
	$(MAKE) -C ffmpeg install || { echo "Error installing ffmpeg" && exit 1; }
99
	touch ffmpeg-install
100

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

    
104
NAPA-build:
105
	cd NAPA-BASELIBS && $(ALTO_OPTION) ./build_all.sh -q
106

    
107
clean:
108
	$(MAKE) -C GRAPES clean
109
	$(MAKE) -C NAPA-BASELIBS clean