Statistics
| Branch: | Revision:

ffmpeg / Makefile @ c11c2bc2

History | View | Annotate | Download (4.81 KB)

1
#
2
# Main ffmpeg Makefile
3
# (c) 2000-2004 Fabrice Bellard
4
#
5
include config.mak
6

    
7
VPATH=$(SRC_PATH)
8

    
9
CFLAGS=$(OPTFLAGS) -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavutil -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
10
LDFLAGS+= -g 
11

    
12
ifeq ($(TARGET_GPROF),yes)
13
CFLAGS+=-p
14
LDFLAGS+=-p
15
endif
16

    
17
MANPAGE=doc/ffmpeg.1
18
PROG=ffmpeg$(EXESUF)
19
PROGTEST=output_example$(EXESUF)
20
QTFASTSTART=qt-faststart$(EXESUF)
21

    
22
ifeq ($(CONFIG_FFSERVER),yes)
23
MANPAGE+=doc/ffserver.1
24
PROG+=ffserver$(EXESUF)
25
endif
26

    
27
ifeq ($(CONFIG_FFPLAY),yes)
28
MANPAGE+=doc/ffplay.1
29
PROG+=ffplay$(EXESUF)
30
FFPLAY_O=ffplay.o
31
endif
32

    
33
ifeq ($(CONFIG_AUDIO_BEOS),yes)
34
EXTRALIBS+=-lmedia -lbe
35
endif
36

    
37
ifeq ($(BUILD_SHARED),yes)
38
DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF)
39
else
40
DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
41
ifeq ($(CONFIG_MP3LAME),yes)
42
EXTRALIBS+=-lmp3lame
43
endif
44
endif
45

    
46
ifeq ($(CONFIG_LIBOGG),yes)
47
ifeq ($(CONFIG_LIBVORBIS),yes)
48
EXTRALIBS+= -lvorbisenc -lvorbis
49
endif
50
ifeq ($(CONFIG_LIBTHEORA),yes)
51
EXTRALIBS+= -ltheora
52
endif
53
EXTRALIBS+= -logg
54
endif
55

    
56
ifeq ($(CONFIG_FAAD),yes)
57
ifeq ($(CONFIG_FAADBIN),yes)
58
# no libs needed
59
else
60
EXTRALIBS += -lfaad
61
endif
62
endif
63

    
64
ifeq ($(CONFIG_FAAC),yes)
65
EXTRALIBS+=-lfaac
66
endif
67

    
68
ifeq ($(CONFIG_XVID),yes)
69
EXTRALIBS+=-lxvidcore
70
endif
71

    
72
ifeq ($(CONFIG_DC1394),yes)
73
EXTRALIBS+=-ldc1394_control -lraw1394
74
endif
75

    
76
ifeq ($(BUILD_VHOOK),yes)
77
VHOOK=videohook
78
INSTALLVHOOK=install-vhook
79
CLEANVHOOK=clean-vhook
80
endif
81

    
82
ifeq ($(TARGET_OS), SunOS)
83
TEST=/usr/bin/test
84
else
85
TEST=test
86
endif
87

    
88
ifeq ($(BUILD_DOC),yes)
89
DOC=documentation
90
endif
91

    
92
OBJS = ffmpeg.o ffserver.o cmdutils.o $(FFPLAY_O)
93
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
94
FFLIBS = -L./libavformat -lavformat$(BUILDSUF) -L./libavcodec -lavcodec$(BUILDSUF) -L./libavutil -lavutil$(BUILDSUF)
95

    
96
all: lib $(PROG) $(PROGTEST) $(VHOOK) $(QTFASTSTART) $(DOC)
97

    
98
lib:
99
	$(MAKE) -C libavutil all
100
	$(MAKE) -C libavcodec all
101
	$(MAKE) -C libavformat all
102

    
103
ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
104
	$(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(FFLIBS) $(EXTRALIBS)
105

    
106
ffmpeg$(EXESUF): ffmpeg_g$(EXESUF)
107
	cp -p $< $@
108
	$(STRIP) $@
109

    
110
ffserver$(EXESUF): ffserver.o .libs
111
	$(CC) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS) 
112

    
113
ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
114
	$(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(FFLIBS) $(EXTRALIBS) $(SDL_LIBS)
115

    
116
ffplay$(EXESUF): ffplay_g$(EXESUF)
117
	cp -p $< $@
118
	$(STRIP) $@
119

    
120
output_example$(EXESUF): output_example.o .libs
121
	$(CC) $(LDFLAGS) -o $@ output_example.o $(FFLIBS) $(EXTRALIBS)
122

    
123
qt-faststart$(EXESUF): qt-faststart.c
124
	$(CC) $(SRC_PATH)/qt-faststart.c -o qt-faststart$(EXESUF)
125

    
126
cws2fws$(EXESUF): cws2fws.c
127
	$(CC) $(SRC_PATH)/cws2fws.c -o cws2fws$(EXESUF) -lz
128

    
129
ffplay.o: ffplay.c
130
	$(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $< 
131

    
132
%.o: %.c
133
	$(CC) $(CFLAGS) -c -o $@ $< 
134

    
135
videohook: .libs
136
	$(MAKE) -C vhook all
137

    
138
documentation:
139
	$(MAKE) -C doc all
140

    
141
.PHONY: install
142

    
143
install: all install-man $(INSTALLVHOOK)
144
	$(MAKE) -C libavutil install
145
	$(MAKE) -C libavcodec install
146
	$(MAKE) -C libavformat install
147
	install -d "$(bindir)"
148
	install -c $(INSTALLSTRIP) -m 755 $(PROG) "$(bindir)"
149

    
150
# create the window installer
151
wininstaller: all install
152
	makensis ffinstall.nsi
153

    
154
# install man from source dir if available
155
install-man:
156
ifneq ($(CONFIG_WIN32),yes)
157
	if [ -f doc/ffmpeg.1 ] ; then \
158
	    install -d "$(mandir)/man1" ; \
159
	    install -m 644 $(MANPAGE) "$(mandir)/man1" ; \
160
	fi
161
endif
162

    
163
install-vhook:
164
	$(MAKE) -C vhook install
165

    
166
installlib:
167
	$(MAKE) -C libavutil installlib
168
	$(MAKE) -C libavcodec installlib
169
	$(MAKE) -C libavformat installlib
170

    
171
dep:	depend
172

    
173
depend: .depend
174
	$(MAKE) -C libavcodec depend
175
	$(MAKE) -C libavformat depend
176
ifeq ($(BUILD_VHOOK),yes)
177
	$(MAKE) -C vhook depend
178
endif
179

    
180
.depend: $(SRCS)
181
	$(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $^ 1>.depend
182

    
183
.libs: lib
184
	@test -f .libs || touch .libs
185
	@for i in $(DEP_LIBS) ; do if $(TEST) $$i -nt .libs ; then touch .libs; fi ; done
186

    
187
clean: $(CLEANVHOOK)
188
	$(MAKE) -C libavutil clean
189
	$(MAKE) -C libavcodec clean
190
	$(MAKE) -C libavformat clean
191
	$(MAKE) -C tests clean
192
	rm -f *.o *.d *~ .libs .depend gmon.out TAGS ffmpeg_g$(EXESUF) \
193
	   ffplay_g$(EXESUF) $(PROG) $(PROGTEST) $(QTFASTSTART)
194

    
195
clean-vhook:
196
	$(MAKE) -C vhook clean
197

    
198
# Note well: config.log is NOT removed.
199
distclean: clean
200
	$(MAKE) -C libavcodec distclean
201
	rm -f config.mak config.h
202

    
203
TAGS:
204
	etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
205

    
206
# regression tests
207

    
208
libavtest test mpeg4 mpeg test-server fulltest: ffmpeg$(EXESUF)
209
	$(MAKE) -C tests $@
210

    
211
# tar release (use 'make -k tar' on a checkouted tree)
212
FILE=ffmpeg-$(shell grep "\#define FFMPEG_VERSION " libavcodec/avcodec.h | \
213
                    cut -d "\"" -f 2 )
214

    
215
tar:
216
	rm -rf /tmp/$(FILE)
217
	cp -r . /tmp/$(FILE)
218
	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
219
	rm -rf /tmp/$(FILE)
220

    
221
.PHONY: lib
222

    
223
ifneq ($(wildcard .depend),)
224
include .depend
225
endif