Statistics
| Branch: | Revision:

ffmpeg / Makefile @ 4b65d88f

History | View | Annotate | Download (5.85 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 \
10
       -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat \
11
       -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE
12
LDFLAGS+= -g
13

    
14
MANPAGES=doc/ffmpeg.1
15
PROGS_G+=ffmpeg_g$(EXESUF)
16
PROGS+=ffmpeg$(EXESUF)
17
PROGTEST=output_example$(EXESUF)
18
QTFASTSTART=qt-faststart$(EXESUF)
19

    
20
ifeq ($(CONFIG_FFSERVER),yes)
21
MANPAGES+=doc/ffserver.1
22
PROGS+=ffserver$(EXESUF)
23
endif
24

    
25
ifeq ($(CONFIG_FFPLAY),yes)
26
MANPAGES+=doc/ffplay.1
27
PROGS_G+=ffplay_g$(EXESUF)
28
PROGS+=ffplay$(EXESUF)
29
FFPLAY_O=ffplay.o
30
endif
31

    
32
BASENAMES=ffmpeg ffplay ffserver
33
ALLPROGS=$(addsuffix $(EXESUF), $(BASENAMES))
34
ALLPROGS_G=$(addsuffix _g$(EXESUF), $(BASENAMES))
35
ALLMANPAGES=$(addsuffix .1, $(BASENAMES))
36

    
37
ifeq ($(CONFIG_AUDIO_BEOS),yes)
38
EXTRALIBS+=-lmedia -lbe
39
endif
40

    
41
ifeq ($(BUILD_SHARED),yes)
42
DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF)
43
else
44
DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
45
endif
46

    
47
ifeq ($(BUILD_VHOOK),yes)
48
VHOOK=videohook
49
INSTALLVHOOK=install-vhook
50
endif
51

    
52
ifeq ($(BUILD_DOC),yes)
53
DOC=documentation
54
endif
55

    
56
OBJS = ffmpeg.o ffserver.o cmdutils.o $(FFPLAY_O)
57
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
58
FFLIBDIRS = -L./libavformat -L./libavcodec -L./libavutil
59
FFLIBS = -lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF)
60

    
61
all: version.h lib $(PROGS_G) $(PROGS) $(PROGTEST) $(VHOOK) $(QTFASTSTART) $(DOC)
62

    
63
lib:
64
	$(MAKE) -C libavutil   all
65
	$(MAKE) -C libavcodec  all
66
	$(MAKE) -C libavformat all
67
ifeq ($(CONFIG_PP),yes)
68
	$(MAKE) -C libpostproc all
69
endif
70

    
71
ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
72
	$(CC) $(FFLIBDIRS) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(FFLIBS) $(EXTRALIBS)
73

    
74
ffserver$(EXESUF): ffserver.o .libs
75
	$(CC) $(FFLIBDIRS) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS)
76

    
77
ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
78
	$(CC) $(FFLIBDIRS) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(FFLIBS) $(EXTRALIBS) $(SDL_LIBS)
79

    
80
%$(EXESUF): %_g$(EXESUF)
81
	cp -p $< $@
82
	$(STRIP) $@
83

    
84
.PHONY: version.h
85
version.h:
86
	$(SRC_PATH)/version.sh "$(SRC_PATH)"
87

    
88
output_example$(EXESUF): output_example.o .libs
89
	$(CC) $(FFLIBDIRS) $(LDFLAGS) -o $@ output_example.o $(FFLIBS) $(EXTRALIBS)
90

    
91
qt-faststart$(EXESUF): qt-faststart.c
92
	$(CC) $(CFLAGS) $(SRC_PATH)/qt-faststart.c -o qt-faststart$(EXESUF)
93

    
94
cws2fws$(EXESUF): cws2fws.c
95
	$(CC) $(SRC_PATH)/cws2fws.c -o cws2fws$(EXESUF) -lz
96

    
97
ffplay.o: ffplay.c
98
	$(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $<
99

    
100
%.o: %.c
101
	$(CC) $(CFLAGS) -c -o $@ $<
102

    
103
videohook: .libs
104
	$(MAKE) -C vhook all
105

    
106
documentation:
107
	$(MAKE) -C doc all
108

    
109
.PHONY: install
110

    
111
install: install-progs install-libs install-headers install-man $(INSTALLVHOOK)
112

    
113
ifeq ($(BUILD_SHARED),yes)
114
install-progs: $(PROGS) install-libs
115
else
116
install-progs: $(PROGS)
117
endif
118
	install -d "$(bindir)"
119
	install -c $(INSTALLSTRIP) -m 755 $(PROGS) "$(bindir)"
120

    
121
# create the window installer
122
wininstaller: all install
123
	makensis ffinstall.nsi
124

    
125
# install man from source dir if available
126
install-man:
127
ifneq ($(CONFIG_MINGW),yes)
128
	if [ -f doc/ffmpeg.1 ] ; then \
129
	    install -d "$(mandir)/man1" ; \
130
	    install -m 644 $(MANPAGES) "$(mandir)/man1" ; \
131
	fi
132
endif
133

    
134
install-vhook:
135
	$(MAKE) -C vhook install
136

    
137
install-libs:
138
	$(MAKE) -C libavutil   install-libs
139
	$(MAKE) -C libavcodec  install-libs
140
	$(MAKE) -C libavformat install-libs
141
ifeq ($(CONFIG_PP),yes)
142
	$(MAKE) -C libpostproc install-libs
143
endif
144
ifeq ($(BUILD_SHARED),yes)
145
	-$(LDCONFIG)
146
endif
147

    
148
install-headers:
149
	$(MAKE) -C libavutil   install-headers
150
	$(MAKE) -C libavcodec  install-headers
151
	$(MAKE) -C libavformat install-headers
152
ifeq ($(CONFIG_PP),yes)
153
	$(MAKE) -C libpostproc install-headers
154
endif
155

    
156
uninstall: uninstall-progs uninstall-libs uninstall-headers uninstall-man uninstall-vhook
157

    
158
uninstall-progs:
159
	rm -f $(addprefix $(bindir)/, $(ALLPROGS))
160

    
161
uninstall-man:
162
ifneq ($(CONFIG_MINGW),yes)
163
	rm -f $(addprefix $(mandir)/man1/,$(ALLMANPAGES))
164
endif
165

    
166
uninstall-vhook:
167
	$(MAKE) -C vhook uninstall
168

    
169
uninstall-libs:
170
	$(MAKE) -C libavutil   uninstall-libs
171
	$(MAKE) -C libavcodec  uninstall-libs
172
	$(MAKE) -C libavformat uninstall-libs
173
	$(MAKE) -C libpostproc uninstall-libs
174

    
175
uninstall-headers:
176
	$(MAKE) -C libavutil   uninstall-headers
177
	$(MAKE) -C libavcodec  uninstall-headers
178
	$(MAKE) -C libavformat uninstall-headers
179
	$(MAKE) -C libpostproc uninstall-headers
180
	-rmdir "$(incdir)"
181
	-rmdir "$(prefix)/include/postproc"
182

    
183
dep:	depend
184

    
185
depend: .depend
186
	$(MAKE) -C libavutil   depend
187
	$(MAKE) -C libavcodec  depend
188
	$(MAKE) -C libavformat depend
189
ifeq ($(BUILD_VHOOK),yes)
190
	$(MAKE) -C vhook       depend
191
endif
192

    
193
.depend: $(SRCS) version.h
194
	$(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $^ 1>.depend
195

    
196
.libs: lib
197
	@test -f .libs || touch .libs
198
	@for i in $(DEP_LIBS) ; do if test $$i -nt .libs ; then touch .libs; fi ; done
199

    
200
clean:
201
	$(MAKE) -C libavutil   clean
202
	$(MAKE) -C libavcodec  clean
203
	$(MAKE) -C libavformat clean
204
	$(MAKE) -C libpostproc clean
205
	$(MAKE) -C tests       clean
206
	$(MAKE) -C vhook       clean
207
	$(MAKE) -C doc         clean
208
	rm -f *.o *.d *~ .libs gmon.out TAGS \
209
	   $(ALLPROGS) $(ALLPROGS_G) $(PROGTEST) $(QTFASTSTART)
210

    
211
# Note well: config.log is NOT removed.
212
distclean: clean
213
	$(MAKE) -C libavutil   distclean
214
	$(MAKE) -C libavcodec  distclean
215
	$(MAKE) -C libavformat distclean
216
	$(MAKE) -C libpostproc distclean
217
	$(MAKE) -C tests       distclean
218
	$(MAKE) -C vhook       distclean
219
	rm -f .depend version.h config.* *.pc
220

    
221
TAGS:
222
	etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
223

    
224
# regression tests
225

    
226
libavtest test mpeg4 mpeg test-server fulltest: $(PROGS)
227
	$(MAKE) -C tests $@
228

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

    
233
tar:
234
	rm -rf /tmp/$(FILE)
235
	cp -r . /tmp/$(FILE)
236
	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude .svn )
237
	rm -rf /tmp/$(FILE)
238

    
239
.PHONY: lib
240

    
241
ifneq ($(wildcard .depend),)
242
include .depend
243
endif