2002-05-26 01:22:57 +03:00
|
|
|
#
|
2001-07-22 17:37:44 +03:00
|
|
|
# Main ffmpeg Makefile
|
2004-03-26 22:42:28 +02:00
|
|
|
# (c) 2000-2004 Fabrice Bellard
|
2001-07-22 17:37:44 +03:00
|
|
|
#
|
2001-07-23 23:06:54 +03:00
|
|
|
include config.mak
|
2001-07-22 17:37:44 +03:00
|
|
|
|
2002-05-19 02:11:25 +03:00
|
|
|
VPATH=$(SRC_PATH)
|
|
|
|
|
2003-10-18 21:47:06 +03:00
|
|
|
CFLAGS=$(OPTFLAGS) -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
|
2002-11-27 04:45:14 +02:00
|
|
|
LDFLAGS+= -g
|
2002-07-25 19:40:10 +03:00
|
|
|
|
2001-07-23 23:06:54 +03:00
|
|
|
ifeq ($(TARGET_GPROF),yes)
|
2001-07-22 17:37:44 +03:00
|
|
|
CFLAGS+=-p
|
|
|
|
LDFLAGS+=-p
|
|
|
|
endif
|
|
|
|
|
2004-06-18 01:46:11 +03:00
|
|
|
MANPAGE=$(SRC_PATH)/doc/ffmpeg.1
|
2003-09-16 01:26:45 +03:00
|
|
|
PROG=ffmpeg$(EXESUF)
|
|
|
|
PROGTEST=output_example$(EXESUF)
|
2004-03-26 22:42:28 +02:00
|
|
|
QTFASTSTART=qt-faststart$(EXESUF)
|
2003-06-07 21:34:02 +03:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_FFSERVER),yes)
|
2004-06-18 01:46:11 +03:00
|
|
|
MANPAGE+=$(SRC_PATH)/doc/ffserver.1
|
2003-09-16 01:26:45 +03:00
|
|
|
PROG+=ffserver$(EXESUF)
|
2003-06-07 21:34:02 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_FFPLAY),yes)
|
2004-06-18 01:46:11 +03:00
|
|
|
MANPAGE+=$(SRC_PATH)/doc/ffplay.1
|
2003-09-16 01:26:45 +03:00
|
|
|
PROG+=ffplay$(EXESUF)
|
2004-08-11 04:24:28 +03:00
|
|
|
FFPLAY_O=ffplay.o
|
2003-01-11 22:34:38 +02:00
|
|
|
endif
|
2001-07-22 17:37:44 +03:00
|
|
|
|
2002-11-05 02:38:06 +02:00
|
|
|
ifeq ($(CONFIG_AUDIO_BEOS),yes)
|
|
|
|
EXTRALIBS+=-lmedia -lbe
|
|
|
|
endif
|
2002-05-26 01:22:57 +03:00
|
|
|
|
2001-10-27 15:04:27 +03:00
|
|
|
ifeq ($(BUILD_SHARED),yes)
|
2003-07-12 00:33:27 +03:00
|
|
|
DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF)
|
2001-10-27 15:04:27 +03:00
|
|
|
else
|
2003-01-11 22:34:38 +02:00
|
|
|
DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
|
2002-03-10 16:44:19 +02:00
|
|
|
ifeq ($(CONFIG_MP3LAME),yes)
|
|
|
|
EXTRALIBS+=-lmp3lame
|
|
|
|
endif
|
2003-03-13 17:05:54 +02:00
|
|
|
endif
|
|
|
|
|
2002-09-01 21:07:56 +03:00
|
|
|
ifeq ($(CONFIG_VORBIS),yes)
|
|
|
|
EXTRALIBS+=-logg -lvorbis -lvorbisenc
|
|
|
|
endif
|
2001-10-27 15:04:27 +03:00
|
|
|
|
2003-05-12 15:32:33 +03:00
|
|
|
ifeq ($(CONFIG_FAAD),yes)
|
|
|
|
ifeq ($(CONFIG_FAADBIN),yes)
|
|
|
|
# no libs needed
|
|
|
|
else
|
|
|
|
EXTRALIBS += -lfaad
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2003-10-04 12:53:34 +03:00
|
|
|
ifeq ($(CONFIG_FAAC),yes)
|
|
|
|
EXTRALIBS+=-lfaac
|
|
|
|
endif
|
|
|
|
|
2004-07-16 22:48:30 +03:00
|
|
|
ifeq ($(CONFIG_XVID),yes)
|
|
|
|
EXTRALIBS+=-lxvidcore
|
|
|
|
endif
|
|
|
|
|
2002-11-20 05:02:23 +02:00
|
|
|
ifeq ($(BUILD_VHOOK),yes)
|
|
|
|
VHOOK=videohook
|
|
|
|
INSTALLVHOOK=install-vhook
|
|
|
|
CLEANVHOOK=clean-vhook
|
2002-11-23 03:29:25 +02:00
|
|
|
endif
|
2002-11-20 05:02:23 +02:00
|
|
|
|
2003-04-16 01:29:37 +03:00
|
|
|
ifeq ($(TARGET_OS), SunOS)
|
|
|
|
TEST=/usr/bin/test
|
|
|
|
else
|
|
|
|
TEST=test
|
|
|
|
endif
|
|
|
|
|
2004-07-05 21:06:16 +03:00
|
|
|
ifeq ($(BUILD_DOC),yes)
|
|
|
|
DOC=documentation
|
|
|
|
endif
|
|
|
|
|
2004-08-11 04:24:28 +03:00
|
|
|
OBJS = ffmpeg.o ffserver.o cmdutils.o $(FFPLAY_O)
|
2002-04-22 22:57:45 +03:00
|
|
|
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
|
2003-03-12 20:38:18 +02:00
|
|
|
FFLIBS = -L./libavformat -lavformat -L./libavcodec -lavcodec
|
2002-04-22 22:57:45 +03:00
|
|
|
|
2004-07-05 21:06:16 +03:00
|
|
|
all: lib $(PROG) $(PROGTEST) $(VHOOK) $(QTFASTSTART) $(DOC)
|
2001-07-22 17:37:44 +03:00
|
|
|
|
2003-09-16 01:26:45 +03:00
|
|
|
lib:
|
2001-08-11 21:57:27 +03:00
|
|
|
$(MAKE) -C libavcodec all
|
2002-11-25 21:07:40 +02:00
|
|
|
$(MAKE) -C libavformat all
|
2001-07-22 17:37:44 +03:00
|
|
|
|
2003-09-16 01:26:45 +03:00
|
|
|
ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
|
2003-06-07 21:34:02 +03:00
|
|
|
$(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(FFLIBS) $(EXTRALIBS)
|
2001-07-22 17:37:44 +03:00
|
|
|
|
2003-09-16 01:26:45 +03:00
|
|
|
ffmpeg$(EXESUF): ffmpeg_g$(EXESUF)
|
2003-01-11 22:34:38 +02:00
|
|
|
cp -p $< $@
|
|
|
|
$(STRIP) $@
|
2002-07-25 19:40:10 +03:00
|
|
|
|
2003-09-16 01:26:45 +03:00
|
|
|
ffserver$(EXESUF): ffserver.o .libs
|
2003-03-12 20:38:18 +02:00
|
|
|
$(CC) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS)
|
2001-07-22 17:37:44 +03:00
|
|
|
|
2003-09-16 01:26:45 +03:00
|
|
|
ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
|
2003-06-07 21:34:02 +03:00
|
|
|
$(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(FFLIBS) $(EXTRALIBS) $(SDL_LIBS)
|
|
|
|
|
2003-09-16 01:26:45 +03:00
|
|
|
ffplay$(EXESUF): ffplay_g$(EXESUF)
|
2003-06-07 21:34:02 +03:00
|
|
|
cp -p $< $@
|
|
|
|
$(STRIP) $@
|
|
|
|
|
2003-09-16 01:26:45 +03:00
|
|
|
output_example$(EXESUF): output_example.o .libs
|
2003-07-22 15:46:15 +03:00
|
|
|
$(CC) $(LDFLAGS) -o $@ output_example.o $(FFLIBS) $(EXTRALIBS)
|
|
|
|
|
2004-03-26 22:42:28 +02:00
|
|
|
qt-faststart$(EXESUF): qt-faststart.c
|
2004-08-11 04:24:28 +03:00
|
|
|
$(CC) $(SRC_PATH)/qt-faststart.c -o qt-faststart$(EXESUF)
|
2004-03-26 22:42:28 +02:00
|
|
|
|
2003-06-07 21:34:02 +03:00
|
|
|
ffplay.o: ffplay.c
|
|
|
|
$(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $<
|
2001-09-25 02:21:02 +03:00
|
|
|
|
2001-07-22 17:37:44 +03:00
|
|
|
%.o: %.c
|
2001-08-16 01:29:44 +03:00
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2001-07-22 17:37:44 +03:00
|
|
|
|
2003-03-12 23:48:26 +02:00
|
|
|
videohook: .libs
|
2002-11-20 05:02:23 +02:00
|
|
|
$(MAKE) -C vhook all
|
|
|
|
|
2004-07-05 21:06:16 +03:00
|
|
|
documentation:
|
|
|
|
$(MAKE) -C doc all
|
|
|
|
|
2003-09-12 01:49:35 +03:00
|
|
|
.PHONY: install
|
|
|
|
|
2003-08-24 19:02:39 +03:00
|
|
|
install: all install-man $(INSTALLVHOOK)
|
2001-10-27 15:04:27 +03:00
|
|
|
$(MAKE) -C libavcodec install
|
2003-07-12 00:33:27 +03:00
|
|
|
$(MAKE) -C libavformat install
|
2003-09-16 01:26:45 +03:00
|
|
|
install -d "$(bindir)"
|
|
|
|
install -c -s -m 755 $(PROG) "$(bindir)"
|
2001-07-22 17:37:44 +03:00
|
|
|
|
2003-09-12 01:49:35 +03:00
|
|
|
# create the window installer
|
|
|
|
wininstaller: all install
|
|
|
|
makensis ffinstall.nsi
|
|
|
|
|
2003-08-24 19:02:39 +03:00
|
|
|
# install man from source dir if available
|
|
|
|
install-man:
|
2003-09-16 01:26:45 +03:00
|
|
|
ifneq ($(CONFIG_WIN32),yes)
|
2003-08-24 19:02:39 +03:00
|
|
|
if [ -f $(SRC_PATH)/doc/ffmpeg.1 ] ; then \
|
2004-07-08 14:02:04 +03:00
|
|
|
install -d "$(mandir)/man1" ; \
|
|
|
|
install -m 644 $(MANPAGE) "$(mandir)/man1" ; \
|
2003-08-24 19:02:39 +03:00
|
|
|
fi
|
2003-09-16 01:26:45 +03:00
|
|
|
endif
|
2003-08-24 19:02:39 +03:00
|
|
|
|
2004-07-08 14:02:04 +03:00
|
|
|
install-vhook:
|
|
|
|
$(MAKE) -C vhook install
|
2002-11-20 05:02:23 +02:00
|
|
|
|
2002-07-25 19:40:10 +03:00
|
|
|
installlib:
|
|
|
|
$(MAKE) -C libavcodec installlib
|
2002-11-25 21:07:40 +02:00
|
|
|
$(MAKE) -C libavformat installlib
|
2002-07-25 19:40:10 +03:00
|
|
|
|
2002-04-22 22:57:45 +03:00
|
|
|
dep: depend
|
|
|
|
|
2003-01-22 11:55:08 +02:00
|
|
|
depend: .depend
|
2003-02-01 22:57:37 +02:00
|
|
|
make -C libavcodec depend
|
|
|
|
make -C libavformat depend
|
|
|
|
ifeq ($(BUILD_VHOOK),yes)
|
|
|
|
make -C vhook depend
|
|
|
|
endif
|
2003-01-22 11:55:08 +02:00
|
|
|
|
|
|
|
.depend: $(SRCS)
|
2004-03-09 14:18:40 +02:00
|
|
|
$(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $^ 1>.depend
|
2002-04-22 22:57:45 +03:00
|
|
|
|
2003-03-12 20:38:18 +02:00
|
|
|
.libs: lib
|
2003-03-13 17:36:53 +02:00
|
|
|
@test -f .libs || touch .libs
|
2003-04-16 01:29:37 +03:00
|
|
|
@for i in $(DEP_LIBS) ; do if $(TEST) $$i -nt .libs ; then touch .libs; fi ; done
|
2003-03-12 20:38:18 +02:00
|
|
|
|
2003-06-05 17:30:52 +03:00
|
|
|
clean: $(CLEANVHOOK)
|
2001-08-11 21:57:27 +03:00
|
|
|
$(MAKE) -C libavcodec clean
|
2002-11-25 21:07:40 +02:00
|
|
|
$(MAKE) -C libavformat clean
|
2002-05-19 02:11:25 +03:00
|
|
|
$(MAKE) -C tests clean
|
2003-09-28 18:04:44 +03:00
|
|
|
rm -f *.o *.d *~ .libs .depend gmon.out TAGS ffmpeg_g$(EXESUF) ffplay_g$(EXESUF) $(PROG) $(PROGTEST)
|
2001-07-22 17:37:44 +03:00
|
|
|
|
2002-11-20 05:02:23 +02:00
|
|
|
clean-vhook:
|
|
|
|
$(MAKE) -C vhook clean
|
|
|
|
|
2001-07-22 17:37:44 +03:00
|
|
|
distclean: clean
|
2001-08-15 16:16:05 +03:00
|
|
|
$(MAKE) -C libavcodec distclean
|
2001-07-23 23:06:54 +03:00
|
|
|
rm -f config.mak config.h
|
2001-07-22 17:37:44 +03:00
|
|
|
|
|
|
|
TAGS:
|
2002-11-25 21:07:40 +02:00
|
|
|
etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
|
2002-04-22 22:57:45 +03:00
|
|
|
|
2002-05-19 02:11:25 +03:00
|
|
|
# regression tests
|
|
|
|
|
2003-09-16 01:26:45 +03:00
|
|
|
libavtest test mpeg4 mpeg test-server fulltest: ffmpeg$(EXESUF)
|
2003-07-16 22:14:07 +03:00
|
|
|
$(MAKE) -C tests $@
|
2002-05-19 02:11:25 +03:00
|
|
|
|
2002-12-27 16:33:53 +02:00
|
|
|
# tar release (use 'make -k tar' on a checkouted tree)
|
2003-09-16 01:26:45 +03:00
|
|
|
FILE=ffmpeg-$(shell grep "\#define FFMPEG_VERSION " libavcodec/avcodec.h | \
|
|
|
|
cut -d "\"" -f 2 )
|
2002-12-27 16:33:53 +02: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 20:38:18 +02:00
|
|
|
.PHONY: lib
|
|
|
|
|
2002-04-22 22:57:45 +03:00
|
|
|
ifneq ($(wildcard .depend),)
|
|
|
|
include .depend
|
|
|
|
endif
|