The server configuration file is passed as a command line parameter.
[libav.git] / Makefile
CommitLineData
a1b63811 1#
85f07f22 2# Main ffmpeg Makefile
38100e8c 3# (c) 2000-2004 Fabrice Bellard
85f07f22 4#
980fc7b8 5include config.mak
85f07f22 6
997baf01 7VPATH=$(SRC_PATH_BARE)
dd9ca370 8
cbeee4d8 9CFLAGS=$(OPTFLAGS) -I$(BUILD_ROOT) -I$(SRC_PATH) -I$(SRC_PATH)/libavutil \
a163ed1a 10 -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libswscale \
4b65d88f 11 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE
115329f1 12LDFLAGS+= -g
37736979 13
0cb8579a
MR
14PROGS-$(CONFIG_FFMPEG) += ffmpeg
15PROGS-$(CONFIG_FFPLAY) += ffplay
16PROGS-$(CONFIG_FFSERVER) += ffserver
01310af2 17
0cb8579a
MR
18PROGS = $(addsuffix $(EXESUF), $(PROGS-yes))
19PROGS_G = $(addsuffix _g$(EXESUF), $(PROGS-yes))
20MANPAGES = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
85f07f22 21
6b991cb2
DB
22BASENAMES=ffmpeg ffplay ffserver
23ALLPROGS=$(addsuffix $(EXESUF), $(BASENAMES))
24ALLPROGS_G=$(addsuffix _g$(EXESUF), $(BASENAMES))
25ALLMANPAGES=$(addsuffix .1, $(BASENAMES))
26
0fd94442 27ifeq ($(BUILD_SHARED),yes)
6bc114b2 28DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF)
0fd94442 29else
f3ec2d46 30DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
f02be79d
RS
31endif
32
d226c750 33ifeq ($(CONFIG_VHOOK),yes)
4c9b0af5
MR
34all: videohook
35install: install-vhook
47930f09 36endif
142fc6b9 37
146ea952 38ifeq ($(BUILD_DOC),yes)
4c9b0af5
MR
39all: documentation
40install: install-man
146ea952
NB
41endif
42
7f0f6e13 43SRCS = $(addsuffix .c, $(PROGS-yes)) cmdutils.c
84471efd 44LDFLAGS := -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil $(LDFLAGS)
8dc6f118 45EXTRALIBS := -lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)
57514323 46
790c9ca7 47ifeq ($(CONFIG_SWSCALER),yes)
cc654dd7 48LDFLAGS+=-L./libswscale
6de9e506 49EXTRALIBS+=-lswscale$(BUILDSUF)
790c9ca7
LA
50endif
51
4c9b0af5 52all: lib $(PROGS)
85f07f22 53
951bf3e6 54lib:
5d22ccf7
DB
55 $(MAKE) -C libavutil all
56 $(MAKE) -C libavcodec all
abac6175 57 $(MAKE) -C libavformat all
1a9150b1 58ifeq ($(CONFIG_PP),yes)
6d9a2421 59 $(MAKE) -C libpostproc all
1a9150b1 60endif
790c9ca7
LA
61ifeq ($(CONFIG_SWSCALER),yes)
62 $(MAKE) -C libswscale all
63endif
85f07f22 64
951bf3e6 65ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
6de9e506 66 $(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(EXTRALIBS)
85f07f22 67
951bf3e6 68ffserver$(EXESUF): ffserver.o .libs
6de9e506 69 $(CC) $(LDFLAGS) $(FFSERVERLDFLAGS) -o $@ ffserver.o $(EXTRALIBS)
85f07f22 70
951bf3e6 71ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
6de9e506 72 $(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(EXTRALIBS) $(SDL_LIBS)
01310af2 73
0cfd96cc 74%$(EXESUF): %_g$(EXESUF)
01310af2
FB
75 cp -p $< $@
76 $(STRIP) $@
77
a4da50e1
MR
78SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
79ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
80version.h: $(SVN_ENTRIES)
81endif
82
f1cc88a5 83version.h:
997baf01 84 $(SRC_PATH)/version.sh $(SRC_PATH)
f1cc88a5 85
951bf3e6 86output_example$(EXESUF): output_example.o .libs
6de9e506 87 $(CC) $(LDFLAGS) -o $@ output_example.o $(EXTRALIBS)
8de65d4f 88
38100e8c 89qt-faststart$(EXESUF): qt-faststart.c
3acc68b4 90 $(CC) $(CFLAGS) $< -o $@
38100e8c 91
f7599d5f 92cws2fws$(EXESUF): cws2fws.c
3acc68b4 93 $(CC) $< -o $@ -lz
f7599d5f 94
01310af2 95ffplay.o: ffplay.c
115329f1 96 $(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $<
2744a37f 97
496cfa3c
MR
98ffmpeg.o ffplay.o ffserver.o: version.h
99
85f07f22 100%.o: %.c
115329f1 101 $(CC) $(CFLAGS) -c -o $@ $<
85f07f22 102
be12b2a4 103videohook: .libs
142fc6b9
PG
104 $(MAKE) -C vhook all
105
e9b19db8
DB
106documentation: $(addprefix doc/, ffmpeg-doc.html faq.html ffserver-doc.html \
107 ffplay-doc.html hooks.html $(ALLMANPAGES))
108
109doc/%.html: doc/%.texi
110 texi2html -monolithic -number $<
111 mv $(@F) $@
112
113doc/%.pod: doc/%-doc.texi
114 doc/texi2pod.pl $< $@
115
116doc/%.1: doc/%.pod
117 pod2man --section=1 --center=" " --release=" " $< > $@
146ea952 118
4c9b0af5 119install: install-progs install-libs install-headers
81dcdc53 120
a4848db6 121ifeq ($(BUILD_SHARED),yes)
7d2f4546 122install-progs: $(PROGS) install-libs
a4848db6 123else
7d2f4546 124install-progs: $(PROGS)
a4848db6 125endif
951bf3e6 126 install -d "$(bindir)"
ca3798dc 127 install -c -m 755 $(PROGS) "$(bindir)"
85f07f22 128
7a7be126 129# Create the Windows installer.
d35ff76b
FB
130wininstaller: all install
131 makensis ffinstall.nsi
132
23a65308 133install-man:
8233b750
DB
134 install -d "$(mandir)/man1"
135 install -m 644 $(MANPAGES) "$(mandir)/man1"
23a65308 136
aa99b8ff
MN
137install-vhook:
138 $(MAKE) -C vhook install
142fc6b9 139
b12f8273 140install-libs:
8b2121e3
MR
141 $(MAKE) -C libavutil install-libs
142 $(MAKE) -C libavcodec install-libs
143 $(MAKE) -C libavformat install-libs
1a9150b1 144ifeq ($(CONFIG_PP),yes)
6d9a2421 145 $(MAKE) -C libpostproc install-libs
1a9150b1 146endif
790c9ca7
LA
147ifeq ($(CONFIG_SWSCALER),yes)
148 $(MAKE) -C libswscale install-libs
149endif
150
8b2121e3 151ifeq ($(BUILD_SHARED),yes)
1e7ffa50 152 -$(LDCONFIG)
b12f8273 153endif
37736979 154
f29f3b5d
DB
155install-headers:
156 $(MAKE) -C libavutil install-headers
157 $(MAKE) -C libavcodec install-headers
158 $(MAKE) -C libavformat install-headers
1a9150b1 159ifeq ($(CONFIG_PP),yes)
6d9a2421 160 $(MAKE) -C libpostproc install-headers
1a9150b1 161endif
790c9ca7 162 $(MAKE) -C libswscale install-headers
f29f3b5d 163
f9edb717
DB
164uninstall: uninstall-progs uninstall-libs uninstall-headers uninstall-man uninstall-vhook
165
f9edb717
DB
166uninstall-progs:
167 rm -f $(addprefix $(bindir)/, $(ALLPROGS))
168
f9edb717 169uninstall-man:
f9edb717 170 rm -f $(addprefix $(mandir)/man1/,$(ALLMANPAGES))
f9edb717
DB
171
172uninstall-vhook:
173 $(MAKE) -C vhook uninstall
174
175uninstall-libs:
176 $(MAKE) -C libavutil uninstall-libs
177 $(MAKE) -C libavcodec uninstall-libs
178 $(MAKE) -C libavformat uninstall-libs
6d9a2421 179 $(MAKE) -C libpostproc uninstall-libs
f9edb717
DB
180
181uninstall-headers:
182 $(MAKE) -C libavutil uninstall-headers
183 $(MAKE) -C libavcodec uninstall-headers
184 $(MAKE) -C libavformat uninstall-headers
6d9a2421 185 $(MAKE) -C libpostproc uninstall-headers
f9edb717
DB
186 -rmdir "$(incdir)"
187 -rmdir "$(prefix)/include/postproc"
188
354ca798 189depend dep: .depend
ea0f0681 190 $(MAKE) -C libavutil depend
5d22ccf7 191 $(MAKE) -C libavcodec depend
c80d990f 192 $(MAKE) -C libavformat depend
691c480e
DB
193ifeq ($(CONFIG_PP),yes)
194 $(MAKE) -C libpostproc depend
195endif
eaa6d7b6
DB
196ifeq ($(CONFIG_SWSCALER),yes)
197 $(MAKE) -C libswscale depend
198endif
d226c750 199ifeq ($(CONFIG_VHOOK),yes)
5d22ccf7 200 $(MAKE) -C vhook depend
811b32ed 201endif
4b8b2edb 202
fd071c26 203.depend: $(SRCS) version.h
0032cac2 204 $(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $(filter-out %.h,$^) 1>.depend
57514323 205
da34f7ac
MR
206$(DEP_LIBS): lib
207
208.libs: $(DEP_LIBS)
209 touch $@
cf2818b0 210
98013cc1 211clean:
5d22ccf7
DB
212 $(MAKE) -C libavutil clean
213 $(MAKE) -C libavcodec clean
abac6175 214 $(MAKE) -C libavformat clean
6d9a2421 215 $(MAKE) -C libpostproc clean
790c9ca7 216 $(MAKE) -C libswscale clean
5d22ccf7
DB
217 $(MAKE) -C tests clean
218 $(MAKE) -C vhook clean
3e4134f6
DB
219 rm -f *.o *.d *~ .libs gmon.out TAGS $(ALLPROGS) $(ALLPROGS_G) \
220 output_example$(EXESUF) qt-faststart$(EXESUF) cws2fws$(EXESUF)
e9b19db8 221 rm -f doc/*.html doc/*.pod doc/*.1
142fc6b9 222
85f07f22 223distclean: clean
98013cc1
DB
224 $(MAKE) -C libavutil distclean
225 $(MAKE) -C libavcodec distclean
226 $(MAKE) -C libavformat distclean
6d9a2421 227 $(MAKE) -C libpostproc distclean
790c9ca7 228 $(MAKE) -C libswscale distclean
98013cc1
DB
229 $(MAKE) -C tests distclean
230 $(MAKE) -C vhook distclean
5c6a5d58 231 rm -f .depend version.h config.* *.pc
85f07f22
FB
232
233TAGS:
abac6175 234 etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
57514323 235
dd9ca370
FB
236# regression tests
237
5e2dfd39 238codectest libavtest seektest test-server fulltest test: $(PROGS)
ec9fca31 239 $(MAKE) -C tests $@
dd9ca370 240
3263626f 241.PHONY: all lib videohook documentation install* wininstaller uninstall*
bedb3550 242.PHONY: dep depend clean distclean TAGS
5e2dfd39 243.PHONY: codectest libavtest seektest test-server fulltest test
cf2818b0 244
6ca0c110 245-include .depend