2002-05-25 22:22:57 +00:00
|
|
|
#
|
2001-07-22 14:37:44 +00:00
|
|
|
# Main ffmpeg Makefile
|
2002-05-25 22:22:57 +00:00
|
|
|
# (c) 2000, 2001, 2002 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)
|
|
|
|
|
2002-11-25 19:07:40 +00: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 02:45:14 +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
|
|
|
|
|
2001-08-15 22:29:44 +00:00
|
|
|
ifeq ($(CONFIG_WIN32),yes)
|
|
|
|
EXE=.exe
|
|
|
|
PROG=ffmpeg$(EXE)
|
|
|
|
else
|
|
|
|
EXT=
|
2002-12-18 16:34:07 +00:00
|
|
|
PROG=ffmpeg ffplay
|
|
|
|
ifeq ($(CONFIG_FFSERVER),yes)
|
|
|
|
PROG+=ffserver
|
|
|
|
endif
|
2001-08-15 22:29:44 +00:00
|
|
|
endif
|
2001-07-22 14:37:44 +00:00
|
|
|
|
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)
|
2002-11-25 19:07:40 +00:00
|
|
|
DEP_LIBS=libavcodec/libavcodec.so libavformat/libavformat.a
|
2001-10-27 12:04:27 +00:00
|
|
|
else
|
2002-11-25 19:07:40 +00:00
|
|
|
DEP_LIBS=libavcodec/libavcodec.a libavformat/libavformat.a
|
2002-03-10 14:44:19 +00:00
|
|
|
ifeq ($(CONFIG_MP3LAME),yes)
|
|
|
|
EXTRALIBS+=-lmp3lame
|
|
|
|
endif
|
2002-09-01 18:07:56 +00:00
|
|
|
ifeq ($(CONFIG_VORBIS),yes)
|
|
|
|
EXTRALIBS+=-logg -lvorbis -lvorbisenc
|
|
|
|
endif
|
2001-10-27 12:04:27 +00:00
|
|
|
endif
|
|
|
|
|
2002-11-20 03:02:23 +00:00
|
|
|
ifeq ($(BUILD_VHOOK),yes)
|
|
|
|
VHOOK=videohook
|
|
|
|
INSTALLVHOOK=install-vhook
|
|
|
|
CLEANVHOOK=clean-vhook
|
2002-11-23 01:29:25 +00:00
|
|
|
endif
|
2002-11-20 03:02:23 +00:00
|
|
|
|
2002-04-22 19:57:45 +00:00
|
|
|
OBJS = ffmpeg.o ffserver.o
|
|
|
|
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
|
|
|
|
|
2002-11-20 03:02:23 +00:00
|
|
|
all: lib $(PROG) $(VHOOK)
|
2001-07-22 14:37:44 +00:00
|
|
|
|
|
|
|
lib:
|
2001-08-11 18:57:27 +00:00
|
|
|
$(MAKE) -C libavcodec all
|
2002-11-25 19:07:40 +00:00
|
|
|
$(MAKE) -C libavformat all
|
2001-07-22 14:37:44 +00:00
|
|
|
|
2002-07-25 16:40:10 +00:00
|
|
|
ffmpeg_g$(EXE): ffmpeg.o $(DEP_LIBS)
|
2002-11-25 19:07:40 +00:00
|
|
|
$(CC) $(LDFLAGS) -o $@ ffmpeg.o -L./libavcodec -L./libavformat \
|
2002-05-25 22:22:57 +00:00
|
|
|
-lavformat -lavcodec $(EXTRALIBS)
|
2001-07-22 14:37:44 +00:00
|
|
|
|
2002-07-25 16:40:10 +00:00
|
|
|
ffmpeg$(EXE): ffmpeg_g$(EXE)
|
2002-11-03 01:39:20 +00:00
|
|
|
cp -p $< $@ ; $(STRIP) $@
|
2002-07-25 16:40:10 +00:00
|
|
|
|
2002-05-25 22:22:57 +00:00
|
|
|
ffserver$(EXE): ffserver.o $(DEP_LIBS)
|
2002-08-30 00:05:28 +00:00
|
|
|
$(CC) $(LDFLAGS) $(FFSLDFLAGS) \
|
2002-11-25 19:07:40 +00:00
|
|
|
-o $@ ffserver.o -L./libavcodec -L./libavformat \
|
2002-11-26 05:01:36 +00:00
|
|
|
-lavformat -lavcodec $(EXTRALIBS)
|
2001-07-22 14:37:44 +00:00
|
|
|
|
2001-09-24 23:21:02 +00:00
|
|
|
ffplay: ffmpeg$(EXE)
|
|
|
|
ln -sf $< $@
|
|
|
|
|
2001-07-22 14:37:44 +00:00
|
|
|
%.o: %.c
|
2001-08-15 22:29:44 +00:00
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2001-07-22 14:37:44 +00:00
|
|
|
|
2002-11-20 03:02:23 +00:00
|
|
|
videohook:
|
|
|
|
$(MAKE) -C vhook all
|
|
|
|
|
|
|
|
install: all $(INSTALLVHOOK)
|
2001-10-27 12:04:27 +00:00
|
|
|
$(MAKE) -C libavcodec install
|
2002-08-13 18:51:11 +00:00
|
|
|
install -d $(prefix)/bin
|
2003-01-01 15:35:34 +00:00
|
|
|
install -c -s -m 755 $(PROG) $(prefix)/bin
|
2001-09-24 23:21:02 +00:00
|
|
|
ln -sf ffmpeg $(prefix)/bin/ffplay
|
2001-07-22 14:37:44 +00:00
|
|
|
|
2002-11-20 03:02:23 +00:00
|
|
|
install-vhook: $(prefix)/lib/vhook
|
|
|
|
$(MAKE) -C vhook install INSTDIR=$(prefix)/lib/vhook
|
|
|
|
|
|
|
|
$(prefix)/lib/vhook:
|
2002-11-27 02:45:14 +00:00
|
|
|
install -d $@
|
2002-11-20 03:02:23 +00:00
|
|
|
|
2002-07-25 16:40:10 +00:00
|
|
|
installlib:
|
|
|
|
$(MAKE) -C libavcodec installlib
|
2002-11-25 19:07:40 +00:00
|
|
|
$(MAKE) -C libavformat installlib
|
2002-07-25 16:40:10 +00:00
|
|
|
|
2002-04-22 19:57:45 +00:00
|
|
|
dep: depend
|
|
|
|
|
|
|
|
depend:
|
|
|
|
$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
|
|
|
|
|
2002-11-20 03:02:23 +00:00
|
|
|
clean: $(CLEANVHOOK)
|
2001-08-11 18:57:27 +00:00
|
|
|
$(MAKE) -C libavcodec clean
|
2002-11-25 19:07:40 +00:00
|
|
|
$(MAKE) -C libavformat clean
|
2002-05-18 23:11:25 +00:00
|
|
|
$(MAKE) -C tests clean
|
2002-07-25 16:40:10 +00:00
|
|
|
rm -f *.o *~ .depend gmon.out TAGS ffmpeg_g$(EXE) $(PROG)
|
2001-07-22 14:37:44 +00:00
|
|
|
|
2002-11-20 03:02:23 +00:00
|
|
|
clean-vhook:
|
|
|
|
$(MAKE) -C vhook clean
|
|
|
|
|
2001-07-22 14:37:44 +00:00
|
|
|
distclean: clean
|
2001-08-15 13:16:05 +00:00
|
|
|
$(MAKE) -C libavcodec distclean
|
2001-07-23 20:06:54 +00:00
|
|
|
rm -f config.mak config.h
|
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
|
|
|
|
|
2002-05-20 16:34:07 +00:00
|
|
|
libavtest test mpeg4 mpeg: ffmpeg$(EXE)
|
2002-11-26 05:01:36 +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)
|
|
|
|
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)
|
|
|
|
|
2002-04-22 19:57:45 +00:00
|
|
|
ifneq ($(wildcard .depend),)
|
|
|
|
include .depend
|
|
|
|
endif
|