2002-05-26 00:22:57 +02:00
|
|
|
#
|
2001-07-22 16:37:44 +02:00
|
|
|
# Main ffmpeg Makefile
|
2004-03-26 21:42:28 +01:00
|
|
|
# (c) 2000-2004 Fabrice Bellard
|
2001-07-22 16:37:44 +02:00
|
|
|
#
|
2001-07-23 22:06:54 +02:00
|
|
|
include config.mak
|
2001-07-22 16:37:44 +02:00
|
|
|
|
2006-11-08 01:02:15 +01:00
|
|
|
VPATH=$(SRC_PATH_BARE)
|
2002-05-19 01:11:25 +02:00
|
|
|
|
2006-10-07 11:22:44 +02:00
|
|
|
CFLAGS=$(OPTFLAGS) -I$(BUILD_ROOT) -I$(SRC_PATH) -I$(SRC_PATH)/libavutil \
|
2006-10-23 19:06:32 +02:00
|
|
|
-I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libswscale \
|
2006-07-14 01:10:01 +02:00
|
|
|
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE
|
2005-12-17 19:14:38 +01:00
|
|
|
LDFLAGS+= -g
|
2002-07-25 18:40:10 +02:00
|
|
|
|
2006-11-02 18:09:47 +01:00
|
|
|
ifeq ($(CONFIG_FFMPEG),yes)
|
2006-05-18 14:19:07 +02:00
|
|
|
MANPAGES=doc/ffmpeg.1
|
|
|
|
PROGS_G+=ffmpeg_g$(EXESUF)
|
|
|
|
PROGS+=ffmpeg$(EXESUF)
|
2003-09-16 00:26:45 +02:00
|
|
|
PROGTEST=output_example$(EXESUF)
|
2004-03-26 21:42:28 +01:00
|
|
|
QTFASTSTART=qt-faststart$(EXESUF)
|
2006-11-02 18:09:47 +01:00
|
|
|
endif
|
2003-06-07 20:34:02 +02:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_FFSERVER),yes)
|
2006-05-18 14:19:07 +02:00
|
|
|
MANPAGES+=doc/ffserver.1
|
|
|
|
PROGS+=ffserver$(EXESUF)
|
2003-06-07 20:34:02 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_FFPLAY),yes)
|
2006-05-18 14:19:07 +02:00
|
|
|
MANPAGES+=doc/ffplay.1
|
|
|
|
PROGS_G+=ffplay_g$(EXESUF)
|
|
|
|
PROGS+=ffplay$(EXESUF)
|
2003-01-11 21:34:38 +01:00
|
|
|
endif
|
2001-07-22 16:37:44 +02:00
|
|
|
|
2006-05-18 14:33:13 +02:00
|
|
|
BASENAMES=ffmpeg ffplay ffserver
|
|
|
|
ALLPROGS=$(addsuffix $(EXESUF), $(BASENAMES))
|
|
|
|
ALLPROGS_G=$(addsuffix _g$(EXESUF), $(BASENAMES))
|
|
|
|
ALLMANPAGES=$(addsuffix .1, $(BASENAMES))
|
|
|
|
|
2002-11-05 01:38:06 +01:00
|
|
|
ifeq ($(CONFIG_AUDIO_BEOS),yes)
|
|
|
|
EXTRALIBS+=-lmedia -lbe
|
|
|
|
endif
|
2002-05-26 00:22:57 +02:00
|
|
|
|
2001-10-27 14:04:27 +02:00
|
|
|
ifeq ($(BUILD_SHARED),yes)
|
2003-07-11 23:33:27 +02:00
|
|
|
DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF)
|
2001-10-27 14:04:27 +02:00
|
|
|
else
|
2003-01-11 21:34:38 +01:00
|
|
|
DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
|
2004-10-22 04:04:30 +02:00
|
|
|
endif
|
|
|
|
|
2002-11-20 04:02:23 +01:00
|
|
|
ifeq ($(BUILD_VHOOK),yes)
|
|
|
|
VHOOK=videohook
|
|
|
|
INSTALLVHOOK=install-vhook
|
2002-11-23 02:29:25 +01:00
|
|
|
endif
|
2002-11-20 04:02:23 +01:00
|
|
|
|
2004-07-05 20:06:16 +02:00
|
|
|
ifeq ($(BUILD_DOC),yes)
|
|
|
|
DOC=documentation
|
|
|
|
endif
|
|
|
|
|
2006-09-08 20:17:50 +02:00
|
|
|
OBJS = ffmpeg.o ffserver.o cmdutils.o ffplay.o
|
2002-04-22 21:57:45 +02:00
|
|
|
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
|
2006-10-15 14:57:47 +02:00
|
|
|
LDFLAGS := -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil $(LDFLAGS)
|
2006-09-08 21:36:21 +02:00
|
|
|
EXTRALIBS := -lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)
|
2002-04-22 21:57:45 +02:00
|
|
|
|
2006-08-08 20:51:38 +02:00
|
|
|
ifeq ($(CONFIG_SWSCALER),yes)
|
2006-09-08 20:06:22 +02:00
|
|
|
LDFLAGS+=-L./libswscale
|
2006-09-08 20:28:58 +02:00
|
|
|
EXTRALIBS+=-lswscale$(BUILDSUF)
|
2006-08-08 20:51:38 +02:00
|
|
|
endif
|
|
|
|
|
2006-09-13 01:13:22 +02:00
|
|
|
all: lib $(PROGS_G) $(PROGS) $(PROGTEST) $(VHOOK) $(QTFASTSTART) $(DOC)
|
2001-07-22 16:37:44 +02:00
|
|
|
|
2003-09-16 00:26:45 +02:00
|
|
|
lib:
|
2006-05-18 10:40:15 +02:00
|
|
|
$(MAKE) -C libavutil all
|
|
|
|
$(MAKE) -C libavcodec all
|
2002-11-25 20:07:40 +01:00
|
|
|
$(MAKE) -C libavformat all
|
2006-02-11 22:42:11 +01:00
|
|
|
ifeq ($(CONFIG_PP),yes)
|
2006-06-01 23:37:48 +02:00
|
|
|
$(MAKE) -C libpostproc all
|
2006-02-11 22:42:11 +01:00
|
|
|
endif
|
2006-08-08 20:51:38 +02:00
|
|
|
ifeq ($(CONFIG_SWSCALER),yes)
|
|
|
|
$(MAKE) -C libswscale all
|
|
|
|
endif
|
2001-07-22 16:37:44 +02:00
|
|
|
|
2003-09-16 00:26:45 +02:00
|
|
|
ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
|
2006-09-08 20:28:58 +02:00
|
|
|
$(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(EXTRALIBS)
|
2001-07-22 16:37:44 +02:00
|
|
|
|
2003-09-16 00:26:45 +02:00
|
|
|
ffserver$(EXESUF): ffserver.o .libs
|
2006-09-08 20:28:58 +02:00
|
|
|
$(CC) $(LDFLAGS) $(FFSERVERLDFLAGS) -o $@ ffserver.o $(EXTRALIBS)
|
2001-07-22 16:37:44 +02:00
|
|
|
|
2003-09-16 00:26:45 +02:00
|
|
|
ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
|
2006-09-08 20:28:58 +02:00
|
|
|
$(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(EXTRALIBS) $(SDL_LIBS)
|
2003-06-07 20:34:02 +02:00
|
|
|
|
2006-06-20 01:26:46 +02:00
|
|
|
%$(EXESUF): %_g$(EXESUF)
|
2003-06-07 20:34:02 +02:00
|
|
|
cp -p $< $@
|
|
|
|
$(STRIP) $@
|
|
|
|
|
2006-06-20 12:24:08 +02:00
|
|
|
version.h:
|
2006-11-08 01:02:15 +01:00
|
|
|
$(SRC_PATH)/version.sh $(SRC_PATH)
|
2006-06-20 12:24:08 +02:00
|
|
|
|
2003-09-16 00:26:45 +02:00
|
|
|
output_example$(EXESUF): output_example.o .libs
|
2006-09-08 20:28:58 +02:00
|
|
|
$(CC) $(LDFLAGS) -o $@ output_example.o $(EXTRALIBS)
|
2003-07-22 14:46:15 +02:00
|
|
|
|
2004-03-26 21:42:28 +01:00
|
|
|
qt-faststart$(EXESUF): qt-faststart.c
|
2006-09-09 19:28:53 +02:00
|
|
|
$(CC) $(CFLAGS) $< -o $@
|
2004-03-26 21:42:28 +01:00
|
|
|
|
2004-10-16 13:08:49 +02:00
|
|
|
cws2fws$(EXESUF): cws2fws.c
|
2006-09-09 19:28:53 +02:00
|
|
|
$(CC) $< -o $@ -lz
|
2004-10-16 13:08:49 +02:00
|
|
|
|
2003-06-07 20:34:02 +02:00
|
|
|
ffplay.o: ffplay.c
|
2005-12-17 19:14:38 +01:00
|
|
|
$(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $<
|
2001-09-25 01:21:02 +02:00
|
|
|
|
2006-09-13 01:13:22 +02:00
|
|
|
ffmpeg.o ffplay.o ffserver.o: version.h
|
|
|
|
|
2001-07-22 16:37:44 +02:00
|
|
|
%.o: %.c
|
2005-12-17 19:14:38 +01:00
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2001-07-22 16:37:44 +02:00
|
|
|
|
2003-03-12 22:48:26 +01:00
|
|
|
videohook: .libs
|
2002-11-20 04:02:23 +01:00
|
|
|
$(MAKE) -C vhook all
|
|
|
|
|
2004-07-05 20:06:16 +02:00
|
|
|
documentation:
|
|
|
|
$(MAKE) -C doc all
|
|
|
|
|
2006-02-11 19:50:45 +01:00
|
|
|
install: install-progs install-libs install-headers install-man $(INSTALLVHOOK)
|
2006-02-11 18:06:59 +01:00
|
|
|
|
2006-02-11 20:01:54 +01:00
|
|
|
ifeq ($(BUILD_SHARED),yes)
|
2006-05-18 14:19:07 +02:00
|
|
|
install-progs: $(PROGS) install-libs
|
2006-02-11 20:01:54 +01:00
|
|
|
else
|
2006-05-18 14:19:07 +02:00
|
|
|
install-progs: $(PROGS)
|
2006-02-11 20:01:54 +01:00
|
|
|
endif
|
2003-09-16 00:26:45 +02:00
|
|
|
install -d "$(bindir)"
|
2006-05-18 14:19:07 +02:00
|
|
|
install -c $(INSTALLSTRIP) -m 755 $(PROGS) "$(bindir)"
|
2001-07-22 16:37:44 +02:00
|
|
|
|
2003-09-12 00:49:35 +02:00
|
|
|
# create the window installer
|
|
|
|
wininstaller: all install
|
|
|
|
makensis ffinstall.nsi
|
|
|
|
|
2003-08-24 18:02:39 +02:00
|
|
|
# install man from source dir if available
|
|
|
|
install-man:
|
2006-07-11 23:45:45 +02:00
|
|
|
ifneq ($(CONFIG_MINGW),yes)
|
2005-01-21 23:16:05 +01:00
|
|
|
if [ -f doc/ffmpeg.1 ] ; then \
|
2004-07-08 13:02:04 +02:00
|
|
|
install -d "$(mandir)/man1" ; \
|
2006-05-18 14:19:07 +02:00
|
|
|
install -m 644 $(MANPAGES) "$(mandir)/man1" ; \
|
2003-08-24 18:02:39 +02:00
|
|
|
fi
|
2003-09-16 00:26:45 +02:00
|
|
|
endif
|
2003-08-24 18:02:39 +02:00
|
|
|
|
2004-07-08 13:02:04 +02:00
|
|
|
install-vhook:
|
|
|
|
$(MAKE) -C vhook install
|
2002-11-20 04:02:23 +01:00
|
|
|
|
2006-02-11 19:50:45 +01:00
|
|
|
install-libs:
|
2006-02-13 13:53:25 +01:00
|
|
|
$(MAKE) -C libavutil install-libs
|
|
|
|
$(MAKE) -C libavcodec install-libs
|
|
|
|
$(MAKE) -C libavformat install-libs
|
2006-02-11 22:42:11 +01:00
|
|
|
ifeq ($(CONFIG_PP),yes)
|
2006-06-01 23:37:48 +02:00
|
|
|
$(MAKE) -C libpostproc install-libs
|
2006-02-11 22:42:11 +01:00
|
|
|
endif
|
2006-08-08 20:51:38 +02:00
|
|
|
ifeq ($(CONFIG_SWSCALER),yes)
|
|
|
|
$(MAKE) -C libswscale install-libs
|
|
|
|
endif
|
|
|
|
|
2006-02-13 13:53:25 +01:00
|
|
|
ifeq ($(BUILD_SHARED),yes)
|
2006-03-26 23:01:49 +02:00
|
|
|
-$(LDCONFIG)
|
2006-02-11 19:50:45 +01:00
|
|
|
endif
|
2002-07-25 18:40:10 +02:00
|
|
|
|
2006-02-11 18:44:06 +01:00
|
|
|
install-headers:
|
|
|
|
$(MAKE) -C libavutil install-headers
|
|
|
|
$(MAKE) -C libavcodec install-headers
|
|
|
|
$(MAKE) -C libavformat install-headers
|
2006-02-11 22:42:11 +01:00
|
|
|
ifeq ($(CONFIG_PP),yes)
|
2006-06-01 23:37:48 +02:00
|
|
|
$(MAKE) -C libpostproc install-headers
|
2006-02-11 22:42:11 +01:00
|
|
|
endif
|
2006-08-08 20:51:38 +02:00
|
|
|
$(MAKE) -C libswscale install-headers
|
2006-02-11 18:44:06 +01:00
|
|
|
|
2006-05-18 14:14:02 +02:00
|
|
|
uninstall: uninstall-progs uninstall-libs uninstall-headers uninstall-man uninstall-vhook
|
|
|
|
|
|
|
|
uninstall-progs:
|
|
|
|
rm -f $(addprefix $(bindir)/, $(ALLPROGS))
|
|
|
|
|
|
|
|
uninstall-man:
|
2006-07-11 23:45:45 +02:00
|
|
|
ifneq ($(CONFIG_MINGW),yes)
|
2006-05-18 14:14:02 +02:00
|
|
|
rm -f $(addprefix $(mandir)/man1/,$(ALLMANPAGES))
|
|
|
|
endif
|
|
|
|
|
|
|
|
uninstall-vhook:
|
|
|
|
$(MAKE) -C vhook uninstall
|
|
|
|
|
|
|
|
uninstall-libs:
|
|
|
|
$(MAKE) -C libavutil uninstall-libs
|
|
|
|
$(MAKE) -C libavcodec uninstall-libs
|
|
|
|
$(MAKE) -C libavformat uninstall-libs
|
2006-06-01 23:37:48 +02:00
|
|
|
$(MAKE) -C libpostproc uninstall-libs
|
2006-05-18 14:14:02 +02:00
|
|
|
|
|
|
|
uninstall-headers:
|
|
|
|
$(MAKE) -C libavutil uninstall-headers
|
|
|
|
$(MAKE) -C libavcodec uninstall-headers
|
|
|
|
$(MAKE) -C libavformat uninstall-headers
|
2006-06-01 23:37:48 +02:00
|
|
|
$(MAKE) -C libpostproc uninstall-headers
|
2006-05-18 14:14:02 +02:00
|
|
|
-rmdir "$(incdir)"
|
|
|
|
-rmdir "$(prefix)/include/postproc"
|
|
|
|
|
2002-04-22 21:57:45 +02:00
|
|
|
dep: depend
|
|
|
|
|
2003-01-22 10:55:08 +01:00
|
|
|
depend: .depend
|
2006-06-02 01:20:51 +02:00
|
|
|
$(MAKE) -C libavutil depend
|
2006-05-18 10:40:15 +02:00
|
|
|
$(MAKE) -C libavcodec depend
|
2005-02-27 03:46:30 +01:00
|
|
|
$(MAKE) -C libavformat depend
|
2006-09-12 12:33:27 +02:00
|
|
|
ifeq ($(CONFIG_PP),yes)
|
|
|
|
$(MAKE) -C libpostproc depend
|
|
|
|
endif
|
2006-10-01 18:33:31 +02:00
|
|
|
ifeq ($(CONFIG_SWSCALER),yes)
|
|
|
|
$(MAKE) -C libswscale depend
|
|
|
|
endif
|
2003-02-01 21:57:37 +01:00
|
|
|
ifeq ($(BUILD_VHOOK),yes)
|
2006-05-18 10:40:15 +02:00
|
|
|
$(MAKE) -C vhook depend
|
2003-02-01 21:57:37 +01:00
|
|
|
endif
|
2003-01-22 10:55:08 +01:00
|
|
|
|
2006-06-22 23:28:30 +02:00
|
|
|
.depend: $(SRCS) version.h
|
2006-08-31 20:30:41 +02:00
|
|
|
$(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $(SRCS) 1>.depend
|
2002-04-22 21:57:45 +02:00
|
|
|
|
2003-03-12 19:38:18 +01:00
|
|
|
.libs: lib
|
2003-03-13 16:36:53 +01:00
|
|
|
@test -f .libs || touch .libs
|
2006-07-10 02:29:33 +02:00
|
|
|
@for i in $(DEP_LIBS) ; do if test $$i -nt .libs ; then touch .libs; fi ; done
|
2003-03-12 19:38:18 +01:00
|
|
|
|
2006-01-16 15:59:54 +01:00
|
|
|
clean:
|
2006-05-18 10:40:15 +02:00
|
|
|
$(MAKE) -C libavutil clean
|
|
|
|
$(MAKE) -C libavcodec clean
|
2002-11-25 20:07:40 +01:00
|
|
|
$(MAKE) -C libavformat clean
|
2006-06-01 23:37:48 +02:00
|
|
|
$(MAKE) -C libpostproc clean
|
2006-08-08 20:51:38 +02:00
|
|
|
$(MAKE) -C libswscale clean
|
2006-05-18 10:40:15 +02:00
|
|
|
$(MAKE) -C tests clean
|
|
|
|
$(MAKE) -C vhook clean
|
2006-07-02 20:17:30 +02:00
|
|
|
$(MAKE) -C doc clean
|
2006-01-16 15:59:54 +01:00
|
|
|
rm -f *.o *.d *~ .libs gmon.out TAGS \
|
2006-05-18 14:33:13 +02:00
|
|
|
$(ALLPROGS) $(ALLPROGS_G) $(PROGTEST) $(QTFASTSTART)
|
2002-11-20 04:02:23 +01:00
|
|
|
|
2004-10-11 21:50:50 +02:00
|
|
|
# Note well: config.log is NOT removed.
|
2001-07-22 16:37:44 +02:00
|
|
|
distclean: clean
|
2006-01-16 15:59:54 +01:00
|
|
|
$(MAKE) -C libavutil distclean
|
|
|
|
$(MAKE) -C libavcodec distclean
|
|
|
|
$(MAKE) -C libavformat distclean
|
2006-06-01 23:37:48 +02:00
|
|
|
$(MAKE) -C libpostproc distclean
|
2006-08-08 20:51:38 +02:00
|
|
|
$(MAKE) -C libswscale distclean
|
2006-01-16 15:59:54 +01:00
|
|
|
$(MAKE) -C tests distclean
|
|
|
|
$(MAKE) -C vhook distclean
|
2006-07-02 20:24:11 +02:00
|
|
|
rm -f .depend version.h config.* *.pc
|
2001-07-22 16:37:44 +02:00
|
|
|
|
|
|
|
TAGS:
|
2002-11-25 20:07:40 +01:00
|
|
|
etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
|
2002-04-22 21:57:45 +02:00
|
|
|
|
2002-05-19 01:11:25 +02:00
|
|
|
# regression tests
|
|
|
|
|
2006-10-02 18:56:09 +02:00
|
|
|
codectest libavtest test-server fulltest test mpeg4 mpeg: $(PROGS)
|
2003-07-16 21:14:07 +02:00
|
|
|
$(MAKE) -C tests $@
|
2002-05-19 01:11:25 +02:00
|
|
|
|
2002-12-27 15:33:53 +01:00
|
|
|
# tar release (use 'make -k tar' on a checkouted tree)
|
2006-08-25 16:53:47 +02:00
|
|
|
FILE=ffmpeg-$(shell grep "\#define FFMPEG_VERSION " version.h | \
|
2003-09-16 00:26:45 +02:00
|
|
|
cut -d "\"" -f 2 )
|
2002-12-27 15:33:53 +01:00
|
|
|
|
|
|
|
tar:
|
|
|
|
rm -rf /tmp/$(FILE)
|
|
|
|
cp -r . /tmp/$(FILE)
|
2006-06-09 15:13:08 +02:00
|
|
|
( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude .svn )
|
2002-12-27 15:33:53 +01:00
|
|
|
rm -rf /tmp/$(FILE)
|
|
|
|
|
2006-10-03 19:42:17 +02:00
|
|
|
.PHONY: all lib videohook documentation install* wininstaller uninstall*
|
|
|
|
.PHONY: dep depend clean distclean TAGS tar
|
|
|
|
.PHONY: codectest libavtest test-server fulltest test mpeg4 mpeg
|
2003-03-12 19:38:18 +01:00
|
|
|
|
2002-04-22 21:57:45 +02:00
|
|
|
ifneq ($(wildcard .depend),)
|
|
|
|
include .depend
|
|
|
|
endif
|