Remove lots of unused commented code. (Cleanup)
[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
146ea952
NB
106documentation:
107 $(MAKE) -C doc all
108
4c9b0af5 109install: install-progs install-libs install-headers
81dcdc53 110
a4848db6 111ifeq ($(BUILD_SHARED),yes)
7d2f4546 112install-progs: $(PROGS) install-libs
a4848db6 113else
7d2f4546 114install-progs: $(PROGS)
a4848db6 115endif
951bf3e6 116 install -d "$(bindir)"
ca3798dc 117 install -c -m 755 $(PROGS) "$(bindir)"
85f07f22 118
7a7be126 119# Create the Windows installer.
d35ff76b
FB
120wininstaller: all install
121 makensis ffinstall.nsi
122
23a65308 123install-man:
8233b750
DB
124 install -d "$(mandir)/man1"
125 install -m 644 $(MANPAGES) "$(mandir)/man1"
23a65308 126
aa99b8ff
MN
127install-vhook:
128 $(MAKE) -C vhook install
142fc6b9 129
b12f8273 130install-libs:
8b2121e3
MR
131 $(MAKE) -C libavutil install-libs
132 $(MAKE) -C libavcodec install-libs
133 $(MAKE) -C libavformat install-libs
1a9150b1 134ifeq ($(CONFIG_PP),yes)
6d9a2421 135 $(MAKE) -C libpostproc install-libs
1a9150b1 136endif
790c9ca7
LA
137ifeq ($(CONFIG_SWSCALER),yes)
138 $(MAKE) -C libswscale install-libs
139endif
140
8b2121e3 141ifeq ($(BUILD_SHARED),yes)
1e7ffa50 142 -$(LDCONFIG)
b12f8273 143endif
37736979 144
f29f3b5d
DB
145install-headers:
146 $(MAKE) -C libavutil install-headers
147 $(MAKE) -C libavcodec install-headers
148 $(MAKE) -C libavformat install-headers
1a9150b1 149ifeq ($(CONFIG_PP),yes)
6d9a2421 150 $(MAKE) -C libpostproc install-headers
1a9150b1 151endif
790c9ca7 152 $(MAKE) -C libswscale install-headers
f29f3b5d 153
f9edb717
DB
154uninstall: uninstall-progs uninstall-libs uninstall-headers uninstall-man uninstall-vhook
155
f9edb717
DB
156uninstall-progs:
157 rm -f $(addprefix $(bindir)/, $(ALLPROGS))
158
f9edb717 159uninstall-man:
f9edb717 160 rm -f $(addprefix $(mandir)/man1/,$(ALLMANPAGES))
f9edb717
DB
161
162uninstall-vhook:
163 $(MAKE) -C vhook uninstall
164
165uninstall-libs:
166 $(MAKE) -C libavutil uninstall-libs
167 $(MAKE) -C libavcodec uninstall-libs
168 $(MAKE) -C libavformat uninstall-libs
6d9a2421 169 $(MAKE) -C libpostproc uninstall-libs
f9edb717
DB
170
171uninstall-headers:
172 $(MAKE) -C libavutil uninstall-headers
173 $(MAKE) -C libavcodec uninstall-headers
174 $(MAKE) -C libavformat uninstall-headers
6d9a2421 175 $(MAKE) -C libpostproc uninstall-headers
f9edb717
DB
176 -rmdir "$(incdir)"
177 -rmdir "$(prefix)/include/postproc"
178
354ca798 179depend dep: .depend
ea0f0681 180 $(MAKE) -C libavutil depend
5d22ccf7 181 $(MAKE) -C libavcodec depend
c80d990f 182 $(MAKE) -C libavformat depend
691c480e
DB
183ifeq ($(CONFIG_PP),yes)
184 $(MAKE) -C libpostproc depend
185endif
eaa6d7b6
DB
186ifeq ($(CONFIG_SWSCALER),yes)
187 $(MAKE) -C libswscale depend
188endif
d226c750 189ifeq ($(CONFIG_VHOOK),yes)
5d22ccf7 190 $(MAKE) -C vhook depend
811b32ed 191endif
4b8b2edb 192
fd071c26 193.depend: $(SRCS) version.h
0032cac2 194 $(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $(filter-out %.h,$^) 1>.depend
57514323 195
da34f7ac
MR
196$(DEP_LIBS): lib
197
198.libs: $(DEP_LIBS)
199 touch $@
cf2818b0 200
98013cc1 201clean:
5d22ccf7
DB
202 $(MAKE) -C libavutil clean
203 $(MAKE) -C libavcodec clean
abac6175 204 $(MAKE) -C libavformat clean
6d9a2421 205 $(MAKE) -C libpostproc clean
790c9ca7 206 $(MAKE) -C libswscale clean
5d22ccf7
DB
207 $(MAKE) -C tests clean
208 $(MAKE) -C vhook clean
bf840994 209 $(MAKE) -C doc clean
3e4134f6
DB
210 rm -f *.o *.d *~ .libs gmon.out TAGS $(ALLPROGS) $(ALLPROGS_G) \
211 output_example$(EXESUF) qt-faststart$(EXESUF) cws2fws$(EXESUF)
142fc6b9 212
85f07f22 213distclean: clean
98013cc1
DB
214 $(MAKE) -C libavutil distclean
215 $(MAKE) -C libavcodec distclean
216 $(MAKE) -C libavformat distclean
6d9a2421 217 $(MAKE) -C libpostproc distclean
790c9ca7 218 $(MAKE) -C libswscale distclean
98013cc1
DB
219 $(MAKE) -C tests distclean
220 $(MAKE) -C vhook distclean
5c6a5d58 221 rm -f .depend version.h config.* *.pc
85f07f22
FB
222
223TAGS:
abac6175 224 etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
57514323 225
dd9ca370
FB
226# regression tests
227
902d3c6d 228codectest libavtest test-server fulltest test mpeg4 mpeg: $(PROGS)
ec9fca31 229 $(MAKE) -C tests $@
dd9ca370 230
3263626f 231.PHONY: all lib videohook documentation install* wininstaller uninstall*
bedb3550 232.PHONY: dep depend clean distclean TAGS
3263626f 233.PHONY: codectest libavtest test-server fulltest test mpeg4 mpeg
cf2818b0 234
6ca0c110 235-include .depend