2002-05-26 00:22:57 +02:00
|
|
|
#
|
2001-07-22 16:37:44 +02:00
|
|
|
# Main ffmpeg Makefile
|
2002-05-26 00:22:57 +02:00
|
|
|
# (c) 2000, 2001, 2002 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
|
|
|
|
2002-05-19 01:11:25 +02:00
|
|
|
VPATH=$(SRC_PATH)
|
|
|
|
|
2002-11-25 20:07:40 +01:00
|
|
|
CFLAGS= $(OPTFLAGS) -Wall -g -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 03:45:14 +01:00
|
|
|
LDFLAGS+= -g
|
2002-07-25 18:40:10 +02:00
|
|
|
|
2001-07-23 22:06:54 +02:00
|
|
|
ifeq ($(TARGET_GPROF),yes)
|
2001-07-22 16:37:44 +02:00
|
|
|
CFLAGS+=-p
|
|
|
|
LDFLAGS+=-p
|
|
|
|
endif
|
|
|
|
|
2001-08-16 00:29:44 +02:00
|
|
|
ifeq ($(CONFIG_WIN32),yes)
|
|
|
|
EXE=.exe
|
|
|
|
PROG=ffmpeg$(EXE)
|
|
|
|
else
|
2003-01-11 21:34:38 +01:00
|
|
|
ifeq ($(CONFIG_OS2),yes)
|
|
|
|
EXE=.exe
|
|
|
|
PROG=ffmpeg$(EXE)
|
|
|
|
else
|
|
|
|
EXE=
|
2002-12-18 17:34:07 +01:00
|
|
|
PROG=ffmpeg ffplay
|
|
|
|
ifeq ($(CONFIG_FFSERVER),yes)
|
|
|
|
PROG+=ffserver
|
|
|
|
endif
|
2001-08-16 00:29:44 +02:00
|
|
|
endif
|
2003-01-11 21:34:38 +01:00
|
|
|
endif
|
2001-07-22 16:37:44 +02:00
|
|
|
|
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-01-11 21:34:38 +01:00
|
|
|
DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
|
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)
|
2002-03-10 15:44:19 +01:00
|
|
|
ifeq ($(CONFIG_MP3LAME),yes)
|
|
|
|
EXTRALIBS+=-lmp3lame
|
|
|
|
endif
|
2003-03-13 16:05:54 +01:00
|
|
|
endif
|
|
|
|
|
2003-05-14 13:40:16 +02:00
|
|
|
ifeq ($(AMR_NB),yes)
|
|
|
|
EXTRALIBS+= libavcodec/amr/spc.a libavcodec/amr/fipop.a
|
|
|
|
AMRLIBS=amrlibs
|
|
|
|
CLEANAMR=cleanamr
|
|
|
|
endif
|
|
|
|
|
2002-09-01 20:07:56 +02:00
|
|
|
ifeq ($(CONFIG_VORBIS),yes)
|
|
|
|
EXTRALIBS+=-logg -lvorbis -lvorbisenc
|
|
|
|
endif
|
2001-10-27 14:04:27 +02:00
|
|
|
|
2003-05-12 14:32:33 +02:00
|
|
|
ifeq ($(CONFIG_FAAD),yes)
|
|
|
|
ifeq ($(CONFIG_FAADBIN),yes)
|
|
|
|
# no libs needed
|
|
|
|
else
|
|
|
|
EXTRALIBS += -lfaad
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2002-11-20 04:02:23 +01:00
|
|
|
ifeq ($(BUILD_VHOOK),yes)
|
|
|
|
VHOOK=videohook
|
|
|
|
INSTALLVHOOK=install-vhook
|
|
|
|
CLEANVHOOK=clean-vhook
|
2002-11-23 02:29:25 +01:00
|
|
|
endif
|
2002-11-20 04:02:23 +01:00
|
|
|
|
2003-04-16 00:29:37 +02:00
|
|
|
ifeq ($(TARGET_OS), SunOS)
|
|
|
|
TEST=/usr/bin/test
|
|
|
|
else
|
|
|
|
TEST=test
|
|
|
|
endif
|
|
|
|
|
2002-04-22 21:57:45 +02:00
|
|
|
OBJS = ffmpeg.o ffserver.o
|
|
|
|
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
|
2003-03-12 19:38:18 +01:00
|
|
|
FFLIBS = -L./libavformat -lavformat -L./libavcodec -lavcodec
|
2002-04-22 21:57:45 +02:00
|
|
|
|
2002-11-20 04:02:23 +01:00
|
|
|
all: lib $(PROG) $(VHOOK)
|
2001-07-22 16:37:44 +02:00
|
|
|
|
2003-05-14 13:40:16 +02:00
|
|
|
lib: $(AMRLIBS)
|
2001-08-11 20:57:27 +02:00
|
|
|
$(MAKE) -C libavcodec all
|
2002-11-25 20:07:40 +01:00
|
|
|
$(MAKE) -C libavformat all
|
2001-07-22 16:37:44 +02:00
|
|
|
|
2003-05-14 13:40:16 +02:00
|
|
|
#make sure you have added -DMMS_IO to CFLAGS in libavcodec/amr/makefile!!
|
|
|
|
amrlibs:
|
|
|
|
$(MAKE) -C libavcodec/amr spclib fipoplib
|
|
|
|
|
2003-03-12 19:38:18 +01:00
|
|
|
ffmpeg_g$(EXE): ffmpeg.o .libs
|
|
|
|
$(CC) $(LDFLAGS) -o $@ ffmpeg.o $(FFLIBS) $(EXTRALIBS)
|
2001-07-22 16:37:44 +02:00
|
|
|
|
2002-07-25 18:40:10 +02:00
|
|
|
ffmpeg$(EXE): ffmpeg_g$(EXE)
|
2003-01-11 21:34:38 +01:00
|
|
|
cp -p $< $@
|
|
|
|
$(STRIP) $@
|
2002-07-25 18:40:10 +02:00
|
|
|
|
2003-03-12 19:38:18 +01:00
|
|
|
ffserver$(EXE): ffserver.o .libs
|
|
|
|
$(CC) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS)
|
2001-07-22 16:37:44 +02:00
|
|
|
|
2001-09-25 01:21:02 +02:00
|
|
|
ffplay: ffmpeg$(EXE)
|
|
|
|
ln -sf $< $@
|
|
|
|
|
2001-07-22 16:37:44 +02:00
|
|
|
%.o: %.c
|
2001-08-16 00:29:44 +02: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
|
|
|
|
|
|
|
|
install: all $(INSTALLVHOOK)
|
2001-10-27 14:04:27 +02:00
|
|
|
$(MAKE) -C libavcodec install
|
2002-08-13 20:51:11 +02:00
|
|
|
install -d $(prefix)/bin
|
2003-01-01 16:35:34 +01:00
|
|
|
install -c -s -m 755 $(PROG) $(prefix)/bin
|
2001-09-25 01:21:02 +02:00
|
|
|
ln -sf ffmpeg $(prefix)/bin/ffplay
|
2001-07-22 16:37:44 +02:00
|
|
|
|
2002-11-20 04:02:23 +01:00
|
|
|
install-vhook: $(prefix)/lib/vhook
|
|
|
|
$(MAKE) -C vhook install INSTDIR=$(prefix)/lib/vhook
|
|
|
|
|
|
|
|
$(prefix)/lib/vhook:
|
2002-11-27 03:45:14 +01:00
|
|
|
install -d $@
|
2002-11-20 04:02:23 +01:00
|
|
|
|
2002-07-25 18:40:10 +02:00
|
|
|
installlib:
|
|
|
|
$(MAKE) -C libavcodec installlib
|
2002-11-25 20:07:40 +01:00
|
|
|
$(MAKE) -C libavformat installlib
|
2002-07-25 18:40:10 +02:00
|
|
|
|
2002-04-22 21:57:45 +02:00
|
|
|
dep: depend
|
|
|
|
|
2003-01-22 10:55:08 +01:00
|
|
|
depend: .depend
|
2003-02-01 21:57:37 +01:00
|
|
|
make -C libavcodec depend
|
|
|
|
make -C libavformat depend
|
|
|
|
ifeq ($(BUILD_VHOOK),yes)
|
|
|
|
make -C vhook depend
|
|
|
|
endif
|
2003-01-22 10:55:08 +01:00
|
|
|
|
|
|
|
.depend: $(SRCS)
|
|
|
|
$(CC) -MM $(CFLAGS) $^ 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
|
2003-04-16 00:29:37 +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
|
|
|
|
2003-05-14 13:40:16 +02:00
|
|
|
clean: $(CLEANVHOOK) $(CLEANAMR)
|
2001-08-11 20:57:27 +02:00
|
|
|
$(MAKE) -C libavcodec clean
|
2002-11-25 20:07:40 +01:00
|
|
|
$(MAKE) -C libavformat clean
|
2002-05-19 01:11:25 +02:00
|
|
|
$(MAKE) -C tests clean
|
2003-03-12 19:38:18 +01:00
|
|
|
rm -f *.o *.d *~ .libs .depend gmon.out TAGS ffmpeg_g$(EXE) $(PROG)
|
2001-07-22 16:37:44 +02:00
|
|
|
|
2002-11-20 04:02:23 +01:00
|
|
|
clean-vhook:
|
|
|
|
$(MAKE) -C vhook clean
|
|
|
|
|
2001-07-22 16:37:44 +02:00
|
|
|
distclean: clean
|
2001-08-15 15:16:05 +02:00
|
|
|
$(MAKE) -C libavcodec distclean
|
2001-07-23 22:06:54 +02:00
|
|
|
rm -f config.mak config.h
|
2001-07-22 16:37:44 +02:00
|
|
|
|
2003-05-14 13:40:16 +02:00
|
|
|
cleanamr:
|
|
|
|
$(MAKE) -C libavcodec/amr clean
|
|
|
|
|
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
|
|
|
|
|
2002-05-20 18:34:07 +02:00
|
|
|
libavtest test mpeg4 mpeg: ffmpeg$(EXE)
|
2003-03-26 11:37:05 +01:00
|
|
|
$(MAKE) all -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)
|
|
|
|
FILE=ffmpeg-$(shell cat VERSION)
|
|
|
|
|
|
|
|
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 19:38:18 +01:00
|
|
|
.PHONY: lib
|
|
|
|
|
2002-04-22 21:57:45 +02:00
|
|
|
ifneq ($(wildcard .depend),)
|
|
|
|
include .depend
|
|
|
|
endif
|