VirtualBox

source: vbox/trunk/src/libs/ffmpeg-20060710/Makefile@ 8757

Last change on this file since 8757 was 5776, checked in by vboxsync, 17 years ago

ffmpeg: exported to OSE

File size: 5.9 KB
Line 
1#
2# Main ffmpeg Makefile
3# (c) 2000-2004 Fabrice Bellard
4#
5include config.mak
6
7VPATH=$(SRC_PATH)
8
9CFLAGS=$(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_GNU_SOURCE
12LDFLAGS+= -g
13
14MANPAGES=doc/ffmpeg.1
15PROGS_G+=ffmpeg_g$(EXESUF)
16PROGS+=ffmpeg$(EXESUF)
17PROGTEST=output_example$(EXESUF)
18QTFASTSTART=qt-faststart$(EXESUF)
19
20ifeq ($(CONFIG_FFSERVER),yes)
21MANPAGES+=doc/ffserver.1
22PROGS+=ffserver$(EXESUF)
23endif
24
25ifeq ($(CONFIG_FFPLAY),yes)
26MANPAGES+=doc/ffplay.1
27PROGS_G+=ffplay_g$(EXESUF)
28PROGS+=ffplay$(EXESUF)
29FFPLAY_O=ffplay.o
30endif
31
32BASENAMES=ffmpeg ffplay ffserver
33ALLPROGS=$(addsuffix $(EXESUF), $(BASENAMES))
34ALLPROGS_G=$(addsuffix _g$(EXESUF), $(BASENAMES))
35ALLMANPAGES=$(addsuffix .1, $(BASENAMES))
36
37ifeq ($(CONFIG_AUDIO_BEOS),yes)
38EXTRALIBS+=-lmedia -lbe
39endif
40
41ifeq ($(BUILD_SHARED),yes)
42DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF)
43else
44DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
45endif
46
47ifeq ($(BUILD_VHOOK),yes)
48VHOOK=videohook
49INSTALLVHOOK=install-vhook
50endif
51
52ifeq ($(BUILD_DOC),yes)
53DOC=documentation
54endif
55
56OBJS = ffmpeg.o ffserver.o cmdutils.o $(FFPLAY_O)
57SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
58FFLIBDIRS = -L./libavformat -L./libavcodec -L./libavutil
59FFLIBS = -lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF)
60
61all: version.h lib $(PROGS_G) $(PROGS) $(PROGTEST) $(VHOOK) $(QTFASTSTART) $(DOC)
62
63lib:
64 $(MAKE) -C libavutil all
65 $(MAKE) -C libavcodec all
66 $(MAKE) -C libavformat all
67ifeq ($(CONFIG_PP),yes)
68 $(MAKE) -C libpostproc all
69endif
70
71ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
72 $(CC) $(FFLIBDIRS) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(FFLIBS) $(EXTRALIBS)
73
74ffserver$(EXESUF): ffserver.o .libs
75 $(CC) $(FFLIBDIRS) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS)
76
77ffplay_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
85version.h:
86 $(SRC_PATH)/version.sh "$(SRC_PATH)"
87
88output_example$(EXESUF): output_example.o .libs
89 $(CC) $(FFLIBDIRS) $(LDFLAGS) -o $@ output_example.o $(FFLIBS) $(EXTRALIBS)
90
91qt-faststart$(EXESUF): qt-faststart.c
92 $(CC) $(CFLAGS) $(SRC_PATH)/qt-faststart.c -o qt-faststart$(EXESUF)
93
94cws2fws$(EXESUF): cws2fws.c
95 $(CC) $(SRC_PATH)/cws2fws.c -o cws2fws$(EXESUF) -lz
96
97ffplay.o: ffplay.c
98 $(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $<
99
100%.o: %.c
101 $(CC) $(CFLAGS) -c -o $@ $<
102
103videohook: .libs
104 $(MAKE) -C vhook all
105
106documentation:
107 $(MAKE) -C doc all
108
109.PHONY: install
110
111install: install-progs install-libs install-headers install-man $(INSTALLVHOOK)
112
113ifeq ($(BUILD_SHARED),yes)
114install-progs: $(PROGS) install-libs
115else
116install-progs: $(PROGS)
117endif
118 install -d "$(bindir)"
119 install -c $(INSTALLSTRIP) -m 755 $(PROGS) "$(bindir)"
120
121# create the window installer
122wininstaller: all install
123 makensis ffinstall.nsi
124
125# install man from source dir if available
126install-man:
127ifneq ($(CONFIG_WIN32),yes)
128 if [ -f doc/ffmpeg.1 ] ; then \
129 install -d "$(mandir)/man1" ; \
130 install -m 644 $(MANPAGES) "$(mandir)/man1" ; \
131 fi
132endif
133
134install-vhook:
135 $(MAKE) -C vhook install
136
137install-libs:
138 $(MAKE) -C libavutil install-libs
139 $(MAKE) -C libavcodec install-libs
140 $(MAKE) -C libavformat install-libs
141ifeq ($(CONFIG_PP),yes)
142 $(MAKE) -C libpostproc install-libs
143endif
144ifeq ($(BUILD_SHARED),yes)
145 -$(LDCONFIG)
146endif
147
148install-headers:
149 $(MAKE) -C libavutil install-headers
150 $(MAKE) -C libavcodec install-headers
151 $(MAKE) -C libavformat install-headers
152ifeq ($(CONFIG_PP),yes)
153 $(MAKE) -C libpostproc install-headers
154endif
155
156uninstall: uninstall-progs uninstall-libs uninstall-headers uninstall-man uninstall-vhook
157
158uninstall-progs:
159 rm -f $(addprefix $(bindir)/, $(ALLPROGS))
160
161uninstall-man:
162ifneq ($(CONFIG_WIN32),yes)
163 rm -f $(addprefix $(mandir)/man1/,$(ALLMANPAGES))
164endif
165
166uninstall-vhook:
167 $(MAKE) -C vhook uninstall
168
169uninstall-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
175uninstall-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
183dep: depend
184
185depend: .depend
186 $(MAKE) -C libavutil depend
187 $(MAKE) -C libavcodec depend
188 $(MAKE) -C libavformat depend
189ifeq ($(BUILD_VHOOK),yes)
190 $(MAKE) -C vhook depend
191endif
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
200clean:
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.
212distclean: 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
221TAGS:
222 etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
223
224# regression tests
225
226libavtest test mpeg4 mpeg test-server fulltest: $(PROGS)
227 $(MAKE) -C tests $@
228
229# tar release (use 'make -k tar' on a checkouted tree)
230FILE=ffmpeg-$(shell grep "\#define FFMPEG_VERSION " libavcodec/avcodec.h | \
231 cut -d "\"" -f 2 )
232
233tar:
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
241ifneq ($(wildcard .depend),)
242include .depend
243endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette