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