Statistics
| Branch: | Revision:

ffmpeg / Makefile @ 146ea952

History | View | Annotate | Download (4.32 KB)

1 a1b63811 Fabrice Bellard
#
2 85f07f22 Fabrice Bellard
# Main ffmpeg Makefile
3 38100e8c Mike Melanson
# (c) 2000-2004 Fabrice Bellard
4 85f07f22 Fabrice Bellard
#
5 980fc7b8 Fabrice Bellard
include config.mak
6 85f07f22 Fabrice Bellard
7 dd9ca370 Fabrice Bellard
VPATH=$(SRC_PATH)
8
9 cf9d24ad Dan Christiansen
CFLAGS=$(OPTFLAGS) -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
10 4baca069 Philip Gladstone
LDFLAGS+= -g 
11 37736979 Fabrice Bellard
12 980fc7b8 Fabrice Bellard
ifeq ($(TARGET_GPROF),yes)
13 85f07f22 Fabrice Bellard
CFLAGS+=-p
14
LDFLAGS+=-p
15
endif
16
17 bbec50d7 Nicolas Boos
MANPAGE=$(SRC_PATH)/doc/ffmpeg.1
18 951bf3e6 Fabrice Bellard
PROG=ffmpeg$(EXESUF)
19
PROGTEST=output_example$(EXESUF)
20 38100e8c Mike Melanson
QTFASTSTART=qt-faststart$(EXESUF)
21 01310af2 Fabrice Bellard
22
ifeq ($(CONFIG_FFSERVER),yes)
23 bbec50d7 Nicolas Boos
MANPAGE+=$(SRC_PATH)/doc/ffserver.1
24 951bf3e6 Fabrice Bellard
PROG+=ffserver$(EXESUF)
25 01310af2 Fabrice Bellard
endif
26
27
ifeq ($(CONFIG_FFPLAY),yes)
28 bbec50d7 Nicolas Boos
MANPAGE+=$(SRC_PATH)/doc/ffplay.1
29 951bf3e6 Fabrice Bellard
PROG+=ffplay$(EXESUF)
30 f3ec2d46 Slavik Gnatenko
endif
31 85f07f22 Fabrice Bellard
32 dfdfa47c François Revol
ifeq ($(CONFIG_AUDIO_BEOS),yes)
33
EXTRALIBS+=-lmedia -lbe
34
endif
35 a1b63811 Fabrice Bellard
36 0fd94442 Nick Kurshev
ifeq ($(BUILD_SHARED),yes)
37 6bc114b2 Tim Allen
DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF)
38 0fd94442 Nick Kurshev
else
39 f3ec2d46 Slavik Gnatenko
DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
40 a6741398 Juanjo
ifeq ($(CONFIG_MP3LAME),yes)
41
EXTRALIBS+=-lmp3lame
42
endif
43 d1db8623 François Revol
endif
44
45 81e0d0b4 Mark Hills
ifeq ($(CONFIG_VORBIS),yes)
46
EXTRALIBS+=-logg -lvorbis -lvorbisenc
47
endif
48 0fd94442 Nick Kurshev
49 445ad18d Zdenek Kabelac
ifeq ($(CONFIG_FAAD),yes)
50
ifeq ($(CONFIG_FAADBIN),yes)
51
# no libs needed
52
else
53
EXTRALIBS += -lfaad
54
endif
55
endif
56
57 29d48296 Michael Niedermayer
ifeq ($(CONFIG_FAAC),yes)
58
EXTRALIBS+=-lfaac
59
endif
60
61 142fc6b9 Philip Gladstone
ifeq ($(BUILD_VHOOK),yes)
62
VHOOK=videohook
63
INSTALLVHOOK=install-vhook
64
CLEANVHOOK=clean-vhook
65 47930f09 Philip Gladstone
endif
66 142fc6b9 Philip Gladstone
67 6e023978 Roman Shaposhnik
ifeq ($(TARGET_OS), SunOS)
68
TEST=/usr/bin/test
69
else
70
TEST=test
71
endif
72
73 146ea952 Nicolas Boos
ifeq ($(BUILD_DOC),yes)
74
DOC=documentation
75
endif
76
77 01310af2 Fabrice Bellard
OBJS = ffmpeg.o ffserver.o cmdutils.o ffplay.o
78 57514323 Zdenek Kabelac
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
79 cf2818b0 Zdenek Kabelac
FFLIBS = -L./libavformat -lavformat -L./libavcodec -lavcodec
80 57514323 Zdenek Kabelac
81 146ea952 Nicolas Boos
all: lib $(PROG) $(PROGTEST) $(VHOOK) $(QTFASTSTART) $(DOC)
82 85f07f22 Fabrice Bellard
83 951bf3e6 Fabrice Bellard
lib:
84 2cc8ae96 Fabrice Bellard
	$(MAKE) -C libavcodec all
85 abac6175 Fabrice Bellard
	$(MAKE) -C libavformat all
86 85f07f22 Fabrice Bellard
87 951bf3e6 Fabrice Bellard
ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
88 01310af2 Fabrice Bellard
	$(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(FFLIBS) $(EXTRALIBS)
89 85f07f22 Fabrice Bellard
90 951bf3e6 Fabrice Bellard
ffmpeg$(EXESUF): ffmpeg_g$(EXESUF)
91 f3ec2d46 Slavik Gnatenko
	cp -p $< $@
92
	$(STRIP) $@
93 37736979 Fabrice Bellard
94 951bf3e6 Fabrice Bellard
ffserver$(EXESUF): ffserver.o .libs
95 cf2818b0 Zdenek Kabelac
	$(CC) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS) 
96 85f07f22 Fabrice Bellard
97 951bf3e6 Fabrice Bellard
ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
98 01310af2 Fabrice Bellard
	$(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(FFLIBS) $(EXTRALIBS) $(SDL_LIBS)
99
100 951bf3e6 Fabrice Bellard
ffplay$(EXESUF): ffplay_g$(EXESUF)
101 01310af2 Fabrice Bellard
	cp -p $< $@
102
	$(STRIP) $@
103
104 951bf3e6 Fabrice Bellard
output_example$(EXESUF): output_example.o .libs
105 8de65d4f Fabrice Bellard
	$(CC) $(LDFLAGS) -o $@ output_example.o $(FFLIBS) $(EXTRALIBS)
106
107 38100e8c Mike Melanson
qt-faststart$(EXESUF): qt-faststart.c
108
	$(CC) qt-faststart.c -o qt-faststart$(EXESUF)
109
110 01310af2 Fabrice Bellard
ffplay.o: ffplay.c
111
	$(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $< 
112 2744a37f Fabrice Bellard
113 85f07f22 Fabrice Bellard
%.o: %.c
114 daf8e955 Fabrice Bellard
	$(CC) $(CFLAGS) -c -o $@ $< 
115 85f07f22 Fabrice Bellard
116 be12b2a4 François Revol
videohook: .libs
117 142fc6b9 Philip Gladstone
	$(MAKE) -C vhook all
118
119 146ea952 Nicolas Boos
documentation:
120
	$(MAKE) -C doc all
121
122 d35ff76b Fabrice Bellard
.PHONY: install
123
124 23a65308 Fabrice Bellard
install: all install-man $(INSTALLVHOOK)
125 0fd94442 Nick Kurshev
	$(MAKE) -C libavcodec install
126 6bc114b2 Tim Allen
	$(MAKE) -C libavformat install
127 951bf3e6 Fabrice Bellard
	install -d "$(bindir)"
128
	install -c -s -m 755 $(PROG) "$(bindir)"
129 85f07f22 Fabrice Bellard
130 d35ff76b Fabrice Bellard
# create the window installer
131
wininstaller: all install
132
	makensis ffinstall.nsi
133
134 23a65308 Fabrice Bellard
# install man from source dir if available
135
install-man:
136 951bf3e6 Fabrice Bellard
ifneq ($(CONFIG_WIN32),yes)
137 23a65308 Fabrice Bellard
	if [ -f $(SRC_PATH)/doc/ffmpeg.1 ] ; then \
138
	    install -d $(mandir)/man1 ; \
139 bbec50d7 Nicolas Boos
	    install -m 644 $(MANPAGE) $(mandir)/man1 ; \
140 23a65308 Fabrice Bellard
	fi
141 951bf3e6 Fabrice Bellard
endif
142 23a65308 Fabrice Bellard
143 142fc6b9 Philip Gladstone
install-vhook: $(prefix)/lib/vhook
144
	$(MAKE) -C vhook install INSTDIR=$(prefix)/lib/vhook
145
146
$(prefix)/lib/vhook:
147 4baca069 Philip Gladstone
	install -d $@
148 142fc6b9 Philip Gladstone
149 37736979 Fabrice Bellard
installlib:
150
	$(MAKE) -C libavcodec installlib
151 abac6175 Fabrice Bellard
	$(MAKE) -C libavformat installlib
152 37736979 Fabrice Bellard
153 57514323 Zdenek Kabelac
dep:	depend
154
155 4b8b2edb Fabrice Bellard
depend: .depend
156 811b32ed Fabrice Bellard
	make -C libavcodec depend
157
	make -C libavformat depend
158
ifeq ($(BUILD_VHOOK),yes)
159
	make -C vhook depend
160
endif
161 4b8b2edb Fabrice Bellard
162
.depend: $(SRCS)
163 148beec7 Zdenek Kabelac
	$(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $^ 1>.depend
164 57514323 Zdenek Kabelac
165 cf2818b0 Zdenek Kabelac
.libs: lib
166 127d5c8d Zdenek Kabelac
	@test -f .libs || touch .libs
167 6e023978 Roman Shaposhnik
	@for i in $(DEP_LIBS) ; do if $(TEST) $$i -nt .libs ; then touch .libs; fi ; done
168 cf2818b0 Zdenek Kabelac
169 bc634f6f Zdenek Kabelac
clean: $(CLEANVHOOK)
170 2cc8ae96 Fabrice Bellard
	$(MAKE) -C libavcodec clean
171 abac6175 Fabrice Bellard
	$(MAKE) -C libavformat clean
172 dd9ca370 Fabrice Bellard
	$(MAKE) -C tests clean
173 4c4b3fcd Fabrice Bellard
	rm -f *.o *.d *~ .libs .depend gmon.out TAGS ffmpeg_g$(EXESUF) ffplay_g$(EXESUF) $(PROG) $(PROGTEST)
174 85f07f22 Fabrice Bellard
175 142fc6b9 Philip Gladstone
clean-vhook:
176
	$(MAKE) -C vhook clean
177
178 85f07f22 Fabrice Bellard
distclean: clean
179 c72c6d2d Fabrice Bellard
	$(MAKE) -C libavcodec distclean
180 980fc7b8 Fabrice Bellard
	rm -f config.mak config.h
181 85f07f22 Fabrice Bellard
182
TAGS:
183 abac6175 Fabrice Bellard
	etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
184 57514323 Zdenek Kabelac
185 dd9ca370 Fabrice Bellard
# regression tests
186
187 951bf3e6 Fabrice Bellard
libavtest test mpeg4 mpeg test-server fulltest: ffmpeg$(EXESUF)
188 ec9fca31 Fabrice Bellard
	$(MAKE) -C tests $@
189 dd9ca370 Fabrice Bellard
190 ac977341 Fabrice Bellard
# tar release (use 'make -k tar' on a checkouted tree)
191 951bf3e6 Fabrice Bellard
FILE=ffmpeg-$(shell grep "\#define FFMPEG_VERSION " libavcodec/avcodec.h | \
192
                    cut -d "\"" -f 2 )
193 ac977341 Fabrice Bellard
194
tar:
195
	rm -rf /tmp/$(FILE)
196
	cp -r . /tmp/$(FILE)
197
	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
198
	rm -rf /tmp/$(FILE)
199
200 cf2818b0 Zdenek Kabelac
.PHONY: lib
201
202 57514323 Zdenek Kabelac
ifneq ($(wildcard .depend),)
203
include .depend
204
endif