Disable protocols by default on WinCE, not MinGW.
[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
dd9ca370
FB
7VPATH=$(SRC_PATH)
8
c11c2bc2 9CFLAGS=$(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
115329f1 10LDFLAGS+= -g
37736979 11
980fc7b8 12ifeq ($(TARGET_GPROF),yes)
85f07f22
FB
13CFLAGS+=-p
14LDFLAGS+=-p
15endif
16
8b8e1c55 17MANPAGE=doc/ffmpeg.1
951bf3e6
FB
18PROG=ffmpeg$(EXESUF)
19PROGTEST=output_example$(EXESUF)
38100e8c 20QTFASTSTART=qt-faststart$(EXESUF)
01310af2
FB
21
22ifeq ($(CONFIG_FFSERVER),yes)
8b8e1c55 23MANPAGE+=doc/ffserver.1
951bf3e6 24PROG+=ffserver$(EXESUF)
01310af2
FB
25endif
26
27ifeq ($(CONFIG_FFPLAY),yes)
8b8e1c55 28MANPAGE+=doc/ffplay.1
951bf3e6 29PROG+=ffplay$(EXESUF)
426c31a1 30FFPLAY_O=ffplay.o
f3ec2d46 31endif
85f07f22 32
dfdfa47c
FR
33ifeq ($(CONFIG_AUDIO_BEOS),yes)
34EXTRALIBS+=-lmedia -lbe
35endif
a1b63811 36
0fd94442 37ifeq ($(BUILD_SHARED),yes)
6bc114b2 38DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF)
0fd94442 39else
f3ec2d46 40DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
f02be79d
RS
41endif
42
142fc6b9
PG
43ifeq ($(BUILD_VHOOK),yes)
44VHOOK=videohook
45INSTALLVHOOK=install-vhook
47930f09 46endif
142fc6b9 47
6e023978
RS
48ifeq ($(TARGET_OS), SunOS)
49TEST=/usr/bin/test
50else
51TEST=test
52endif
53
146ea952
NB
54ifeq ($(BUILD_DOC),yes)
55DOC=documentation
56endif
57
426c31a1 58OBJS = ffmpeg.o ffserver.o cmdutils.o $(FFPLAY_O)
57514323 59SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
c11c2bc2 60FFLIBS = -L./libavformat -lavformat$(BUILDSUF) -L./libavcodec -lavcodec$(BUILDSUF) -L./libavutil -lavutil$(BUILDSUF)
57514323 61
146ea952 62all: lib $(PROG) $(PROGTEST) $(VHOOK) $(QTFASTSTART) $(DOC)
85f07f22 63
951bf3e6 64lib:
c11c2bc2 65 $(MAKE) -C libavutil all
2cc8ae96 66 $(MAKE) -C libavcodec all
abac6175 67 $(MAKE) -C libavformat all
85f07f22 68
951bf3e6 69ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
01310af2 70 $(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(FFLIBS) $(EXTRALIBS)
85f07f22 71
951bf3e6 72ffmpeg$(EXESUF): ffmpeg_g$(EXESUF)
f3ec2d46
SG
73 cp -p $< $@
74 $(STRIP) $@
37736979 75
951bf3e6 76ffserver$(EXESUF): ffserver.o .libs
115329f1 77 $(CC) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS)
85f07f22 78
951bf3e6 79ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
01310af2
FB
80 $(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(FFLIBS) $(EXTRALIBS) $(SDL_LIBS)
81
951bf3e6 82ffplay$(EXESUF): ffplay_g$(EXESUF)
01310af2
FB
83 cp -p $< $@
84 $(STRIP) $@
85
951bf3e6 86output_example$(EXESUF): output_example.o .libs
8de65d4f
FB
87 $(CC) $(LDFLAGS) -o $@ output_example.o $(FFLIBS) $(EXTRALIBS)
88
38100e8c 89qt-faststart$(EXESUF): qt-faststart.c
426c31a1 90 $(CC) $(SRC_PATH)/qt-faststart.c -o qt-faststart$(EXESUF)
38100e8c 91
f7599d5f
AB
92cws2fws$(EXESUF): cws2fws.c
93 $(CC) $(SRC_PATH)/cws2fws.c -o cws2fws$(EXESUF) -lz
94
01310af2 95ffplay.o: ffplay.c
115329f1 96 $(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $<
2744a37f 97
85f07f22 98%.o: %.c
115329f1 99 $(CC) $(CFLAGS) -c -o $@ $<
85f07f22 100
be12b2a4 101videohook: .libs
142fc6b9
PG
102 $(MAKE) -C vhook all
103
146ea952
NB
104documentation:
105 $(MAKE) -C doc all
106
d35ff76b
FB
107.PHONY: install
108
23a65308 109install: all install-man $(INSTALLVHOOK)
c11c2bc2 110 $(MAKE) -C libavutil install
0fd94442 111 $(MAKE) -C libavcodec install
6bc114b2 112 $(MAKE) -C libavformat install
951bf3e6 113 install -d "$(bindir)"
65d1bea2 114 install -c $(INSTALLSTRIP) -m 755 $(PROG) "$(bindir)"
85f07f22 115
d35ff76b
FB
116# create the window installer
117wininstaller: all install
118 makensis ffinstall.nsi
119
23a65308
FB
120# install man from source dir if available
121install-man:
951bf3e6 122ifneq ($(CONFIG_WIN32),yes)
8b8e1c55 123 if [ -f doc/ffmpeg.1 ] ; then \
aa99b8ff
MN
124 install -d "$(mandir)/man1" ; \
125 install -m 644 $(MANPAGE) "$(mandir)/man1" ; \
23a65308 126 fi
951bf3e6 127endif
23a65308 128
aa99b8ff
MN
129install-vhook:
130 $(MAKE) -C vhook install
142fc6b9 131
37736979 132installlib:
c11c2bc2 133 $(MAKE) -C libavutil installlib
37736979 134 $(MAKE) -C libavcodec installlib
abac6175 135 $(MAKE) -C libavformat installlib
37736979 136
57514323
ZK
137dep: depend
138
4b8b2edb 139depend: .depend
c80d990f
SS
140 $(MAKE) -C libavcodec depend
141 $(MAKE) -C libavformat depend
811b32ed 142ifeq ($(BUILD_VHOOK),yes)
c80d990f 143 $(MAKE) -C vhook depend
811b32ed 144endif
4b8b2edb
FB
145
146.depend: $(SRCS)
148beec7 147 $(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $^ 1>.depend
57514323 148
cf2818b0 149.libs: lib
127d5c8d 150 @test -f .libs || touch .libs
6e023978 151 @for i in $(DEP_LIBS) ; do if $(TEST) $$i -nt .libs ; then touch .libs; fi ; done
cf2818b0 152
98013cc1 153clean:
c11c2bc2 154 $(MAKE) -C libavutil clean
2cc8ae96 155 $(MAKE) -C libavcodec clean
abac6175 156 $(MAKE) -C libavformat clean
dd9ca370 157 $(MAKE) -C tests clean
142fc6b9 158 $(MAKE) -C vhook clean
98013cc1
DB
159 rm -f *.o *.d *~ .libs gmon.out TAGS \
160 $(PROG) $(PROGTEST) $(QTFASTSTART)
142fc6b9 161
f255e0ab 162# Note well: config.log is NOT removed.
85f07f22 163distclean: clean
98013cc1
DB
164 $(MAKE) -C libavutil distclean
165 $(MAKE) -C libavcodec distclean
166 $(MAKE) -C libavformat distclean
167 $(MAKE) -C tests distclean
168 $(MAKE) -C vhook distclean
169 rm -f Makefile.bak .depend config.mak config.h *.pc
85f07f22
FB
170
171TAGS:
abac6175 172 etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
57514323 173
dd9ca370
FB
174# regression tests
175
951bf3e6 176libavtest test mpeg4 mpeg test-server fulltest: ffmpeg$(EXESUF)
ec9fca31 177 $(MAKE) -C tests $@
dd9ca370 178
ac977341 179# tar release (use 'make -k tar' on a checkouted tree)
951bf3e6
FB
180FILE=ffmpeg-$(shell grep "\#define FFMPEG_VERSION " libavcodec/avcodec.h | \
181 cut -d "\"" -f 2 )
ac977341
FB
182
183tar:
184 rm -rf /tmp/$(FILE)
185 cp -r . /tmp/$(FILE)
186 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
187 rm -rf /tmp/$(FILE)
188
cf2818b0
ZK
189.PHONY: lib
190
57514323
ZK
191ifneq ($(wildcard .depend),)
192include .depend
193endif