Statistics
| Branch: | Revision:

ffmpeg / Makefile @ 4014fe37

History | View | Annotate | Download (5.9 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 997baf01 Måns Rullgård
VPATH=$(SRC_PATH_BARE)
8 dd9ca370 Fabrice Bellard
9 cbeee4d8 Diego Biurrun
CFLAGS=$(OPTFLAGS) -I$(BUILD_ROOT) -I$(SRC_PATH) -I$(SRC_PATH)/libavutil \
10 a163ed1a Luca Abeni
       -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libswscale \
11 4b65d88f Måns Rullgård
       -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE
12 115329f1 Diego Biurrun
LDFLAGS+= -g
13 37736979 Fabrice Bellard
14 786b30af Diego Biurrun
ifeq ($(CONFIG_FFMPEG),yes)
15 7d2f4546 Diego Biurrun
MANPAGES=doc/ffmpeg.1
16
PROGS_G+=ffmpeg_g$(EXESUF)
17
PROGS+=ffmpeg$(EXESUF)
18 786b30af Diego Biurrun
endif
19 01310af2 Fabrice Bellard
20
ifeq ($(CONFIG_FFSERVER),yes)
21 7d2f4546 Diego Biurrun
MANPAGES+=doc/ffserver.1
22
PROGS+=ffserver$(EXESUF)
23 01310af2 Fabrice Bellard
endif
24
25
ifeq ($(CONFIG_FFPLAY),yes)
26 7d2f4546 Diego Biurrun
MANPAGES+=doc/ffplay.1
27
PROGS_G+=ffplay_g$(EXESUF)
28
PROGS+=ffplay$(EXESUF)
29 f3ec2d46 Slavik Gnatenko
endif
30 85f07f22 Fabrice Bellard
31 6b991cb2 Diego Biurrun
BASENAMES=ffmpeg ffplay ffserver
32
ALLPROGS=$(addsuffix $(EXESUF), $(BASENAMES))
33
ALLPROGS_G=$(addsuffix _g$(EXESUF), $(BASENAMES))
34
ALLMANPAGES=$(addsuffix .1, $(BASENAMES))
35
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 f02be79d Roman Shaposhnik
endif
41
42 d226c750 Måns Rullgård
ifeq ($(CONFIG_VHOOK),yes)
43 142fc6b9 Philip Gladstone
VHOOK=videohook
44
INSTALLVHOOK=install-vhook
45 47930f09 Philip Gladstone
endif
46 142fc6b9 Philip Gladstone
47 146ea952 Nicolas Boos
ifeq ($(BUILD_DOC),yes)
48
DOC=documentation
49 8233b750 Diego Biurrun
INSTALLMAN=install-man
50 146ea952 Nicolas Boos
endif
51
52 f381af7b Diego Biurrun
OBJS = ffmpeg.o ffserver.o cmdutils.o ffplay.o
53 57514323 Zdenek Kabelac
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
54 84471efd Diego Biurrun
LDFLAGS := -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil $(LDFLAGS)
55 8dc6f118 Panagiotis Issaris
EXTRALIBS := -lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)
56 57514323 Zdenek Kabelac
57 790c9ca7 Luca Abeni
ifeq ($(CONFIG_SWSCALER),yes)
58 cc654dd7 Diego Biurrun
LDFLAGS+=-L./libswscale
59 6de9e506 Diego Biurrun
EXTRALIBS+=-lswscale$(BUILDSUF)
60 790c9ca7 Luca Abeni
endif
61
62 4d15aae1 Diego Biurrun
all: lib $(PROGS_G) $(PROGS) $(VHOOK) $(DOC)
63 85f07f22 Fabrice Bellard
64 951bf3e6 Fabrice Bellard
lib:
65 5d22ccf7 Diego Biurrun
	$(MAKE) -C libavutil   all
66
	$(MAKE) -C libavcodec  all
67 abac6175 Fabrice Bellard
	$(MAKE) -C libavformat all
68 1a9150b1 Diego Biurrun
ifeq ($(CONFIG_PP),yes)
69 6d9a2421 Diego Biurrun
	$(MAKE) -C libpostproc all
70 1a9150b1 Diego Biurrun
endif
71 790c9ca7 Luca Abeni
ifeq ($(CONFIG_SWSCALER),yes)
72
	$(MAKE) -C libswscale  all
73
endif
74 85f07f22 Fabrice Bellard
75 951bf3e6 Fabrice Bellard
ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
76 6de9e506 Diego Biurrun
	$(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(EXTRALIBS)
77 85f07f22 Fabrice Bellard
78 951bf3e6 Fabrice Bellard
ffserver$(EXESUF): ffserver.o .libs
79 6de9e506 Diego Biurrun
	$(CC) $(LDFLAGS) $(FFSERVERLDFLAGS) -o $@ ffserver.o $(EXTRALIBS)
80 85f07f22 Fabrice Bellard
81 951bf3e6 Fabrice Bellard
ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
82 6de9e506 Diego Biurrun
	$(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(EXTRALIBS) $(SDL_LIBS)
83 01310af2 Fabrice Bellard
84 0cfd96cc Diego Biurrun
%$(EXESUF): %_g$(EXESUF)
85 01310af2 Fabrice Bellard
	cp -p $< $@
86
	$(STRIP) $@
87
88 a4da50e1 Måns Rullgård
SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
89
ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
90
version.h: $(SVN_ENTRIES)
91
endif
92
93 f1cc88a5 Diego Biurrun
version.h:
94 997baf01 Måns Rullgård
	$(SRC_PATH)/version.sh $(SRC_PATH)
95 f1cc88a5 Diego Biurrun
96 951bf3e6 Fabrice Bellard
output_example$(EXESUF): output_example.o .libs
97 6de9e506 Diego Biurrun
	$(CC) $(LDFLAGS) -o $@ output_example.o $(EXTRALIBS)
98 8de65d4f Fabrice Bellard
99 38100e8c Mike Melanson
qt-faststart$(EXESUF): qt-faststart.c
100 3acc68b4 Måns Rullgård
	$(CC) $(CFLAGS) $< -o $@
101 38100e8c Mike Melanson
102 f7599d5f Alex Beregszaszi
cws2fws$(EXESUF): cws2fws.c
103 3acc68b4 Måns Rullgård
	$(CC) $< -o $@ -lz
104 f7599d5f Alex Beregszaszi
105 01310af2 Fabrice Bellard
ffplay.o: ffplay.c
106 115329f1 Diego Biurrun
	$(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $<
107 2744a37f Fabrice Bellard
108 496cfa3c Måns Rullgård
ffmpeg.o ffplay.o ffserver.o: version.h
109
110 85f07f22 Fabrice Bellard
%.o: %.c
111 115329f1 Diego Biurrun
	$(CC) $(CFLAGS) -c -o $@ $<
112 85f07f22 Fabrice Bellard
113 be12b2a4 François Revol
videohook: .libs
114 142fc6b9 Philip Gladstone
	$(MAKE) -C vhook all
115
116 146ea952 Nicolas Boos
documentation:
117
	$(MAKE) -C doc all
118
119 8233b750 Diego Biurrun
install: install-progs install-libs install-headers $(INSTALLMAN) $(INSTALLVHOOK)
120 81dcdc53 Diego Biurrun
121 a4848db6 Diego Biurrun
ifeq ($(BUILD_SHARED),yes)
122 7d2f4546 Diego Biurrun
install-progs: $(PROGS) install-libs
123 a4848db6 Diego Biurrun
else
124 7d2f4546 Diego Biurrun
install-progs: $(PROGS)
125 a4848db6 Diego Biurrun
endif
126 951bf3e6 Fabrice Bellard
	install -d "$(bindir)"
127 7d2f4546 Diego Biurrun
	install -c $(INSTALLSTRIP) -m 755 $(PROGS) "$(bindir)"
128 85f07f22 Fabrice Bellard
129 d35ff76b Fabrice Bellard
# create the window installer
130
wininstaller: all install
131
	makensis ffinstall.nsi
132
133 23a65308 Fabrice Bellard
install-man:
134 8233b750 Diego Biurrun
	install -d "$(mandir)/man1"
135
	install -m 644 $(MANPAGES) "$(mandir)/man1"
136 23a65308 Fabrice Bellard
137 aa99b8ff Michael Niedermayer
install-vhook:
138
	$(MAKE) -C vhook install
139 142fc6b9 Philip Gladstone
140 b12f8273 Diego Biurrun
install-libs:
141 8b2121e3 Måns Rullgård
	$(MAKE) -C libavutil   install-libs
142
	$(MAKE) -C libavcodec  install-libs
143
	$(MAKE) -C libavformat install-libs
144 1a9150b1 Diego Biurrun
ifeq ($(CONFIG_PP),yes)
145 6d9a2421 Diego Biurrun
	$(MAKE) -C libpostproc install-libs
146 1a9150b1 Diego Biurrun
endif
147 790c9ca7 Luca Abeni
ifeq ($(CONFIG_SWSCALER),yes)
148
	$(MAKE) -C libswscale  install-libs
149
endif
150
151 8b2121e3 Måns Rullgård
ifeq ($(BUILD_SHARED),yes)
152 1e7ffa50 Diego Biurrun
	-$(LDCONFIG)
153 b12f8273 Diego Biurrun
endif
154 37736979 Fabrice Bellard
155 f29f3b5d Diego Biurrun
install-headers:
156
	$(MAKE) -C libavutil   install-headers
157
	$(MAKE) -C libavcodec  install-headers
158
	$(MAKE) -C libavformat install-headers
159 1a9150b1 Diego Biurrun
ifeq ($(CONFIG_PP),yes)
160 6d9a2421 Diego Biurrun
	$(MAKE) -C libpostproc install-headers
161 1a9150b1 Diego Biurrun
endif
162 790c9ca7 Luca Abeni
	$(MAKE) -C libswscale  install-headers
163 f29f3b5d Diego Biurrun
164 f9edb717 Diego Biurrun
uninstall: uninstall-progs uninstall-libs uninstall-headers uninstall-man uninstall-vhook
165
166
uninstall-progs:
167
	rm -f $(addprefix $(bindir)/, $(ALLPROGS))
168
169
uninstall-man:
170
	rm -f $(addprefix $(mandir)/man1/,$(ALLMANPAGES))
171
172
uninstall-vhook:
173
	$(MAKE) -C vhook uninstall
174
175
uninstall-libs:
176
	$(MAKE) -C libavutil   uninstall-libs
177
	$(MAKE) -C libavcodec  uninstall-libs
178
	$(MAKE) -C libavformat uninstall-libs
179 6d9a2421 Diego Biurrun
	$(MAKE) -C libpostproc uninstall-libs
180 f9edb717 Diego Biurrun
181
uninstall-headers:
182
	$(MAKE) -C libavutil   uninstall-headers
183
	$(MAKE) -C libavcodec  uninstall-headers
184
	$(MAKE) -C libavformat uninstall-headers
185 6d9a2421 Diego Biurrun
	$(MAKE) -C libpostproc uninstall-headers
186 f9edb717 Diego Biurrun
	-rmdir "$(incdir)"
187
	-rmdir "$(prefix)/include/postproc"
188
189 354ca798 Diego Biurrun
depend dep: .depend
190 ea0f0681 Diego Biurrun
	$(MAKE) -C libavutil   depend
191 5d22ccf7 Diego Biurrun
	$(MAKE) -C libavcodec  depend
192 c80d990f Steven M. Schultz
	$(MAKE) -C libavformat depend
193 691c480e Diego Biurrun
ifeq ($(CONFIG_PP),yes)
194
	$(MAKE) -C libpostproc depend
195
endif
196 eaa6d7b6 Diego Biurrun
ifeq ($(CONFIG_SWSCALER),yes)
197
	$(MAKE) -C libswscale  depend
198
endif
199 d226c750 Måns Rullgård
ifeq ($(CONFIG_VHOOK),yes)
200 5d22ccf7 Diego Biurrun
	$(MAKE) -C vhook       depend
201 811b32ed Fabrice Bellard
endif
202 4b8b2edb Fabrice Bellard
203 fd071c26 Diego Biurrun
.depend: $(SRCS) version.h
204 0032cac2 Måns Rullgård
	$(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $(filter-out %.h,$^) 1>.depend
205 57514323 Zdenek Kabelac
206 da34f7ac Måns Rullgård
$(DEP_LIBS): lib
207
208
.libs: $(DEP_LIBS)
209
	touch $@
210 cf2818b0 Zdenek Kabelac
211 98013cc1 Diego Biurrun
clean:
212 5d22ccf7 Diego Biurrun
	$(MAKE) -C libavutil   clean
213
	$(MAKE) -C libavcodec  clean
214 abac6175 Fabrice Bellard
	$(MAKE) -C libavformat clean
215 6d9a2421 Diego Biurrun
	$(MAKE) -C libpostproc clean
216 790c9ca7 Luca Abeni
	$(MAKE) -C libswscale  clean
217 5d22ccf7 Diego Biurrun
	$(MAKE) -C tests       clean
218
	$(MAKE) -C vhook       clean
219 bf840994 Luca Barbato
	$(MAKE) -C doc         clean
220 3e4134f6 Diego Biurrun
	rm -f *.o *.d *~ .libs gmon.out TAGS $(ALLPROGS) $(ALLPROGS_G) \
221
	   output_example$(EXESUF) qt-faststart$(EXESUF) cws2fws$(EXESUF)
222 142fc6b9 Philip Gladstone
223 85f07f22 Fabrice Bellard
distclean: clean
224 98013cc1 Diego Biurrun
	$(MAKE) -C libavutil   distclean
225
	$(MAKE) -C libavcodec  distclean
226
	$(MAKE) -C libavformat distclean
227 6d9a2421 Diego Biurrun
	$(MAKE) -C libpostproc distclean
228 790c9ca7 Luca Abeni
	$(MAKE) -C libswscale  distclean
229 98013cc1 Diego Biurrun
	$(MAKE) -C tests       distclean
230
	$(MAKE) -C vhook       distclean
231 5c6a5d58 Diego Biurrun
	rm -f .depend version.h config.* *.pc
232 85f07f22 Fabrice Bellard
233
TAGS:
234 abac6175 Fabrice Bellard
	etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
235 57514323 Zdenek Kabelac
236 dd9ca370 Fabrice Bellard
# regression tests
237
238 902d3c6d Diego Biurrun
codectest libavtest test-server fulltest test mpeg4 mpeg: $(PROGS)
239 ec9fca31 Fabrice Bellard
	$(MAKE) -C tests $@
240 dd9ca370 Fabrice Bellard
241 3263626f Diego Biurrun
.PHONY: all lib videohook documentation install* wininstaller uninstall*
242 bedb3550 Diego Biurrun
.PHONY: dep depend clean distclean TAGS
243 3263626f Diego Biurrun
.PHONY: codectest libavtest test-server fulltest test mpeg4 mpeg
244 cf2818b0 Zdenek Kabelac
245 57514323 Zdenek Kabelac
ifneq ($(wildcard .depend),)
246
include .depend
247
endif