2002-05-26 01:22:57 +03:00
|
|
|
#
|
2001-07-22 17:37:44 +03:00
|
|
|
# Main ffmpeg Makefile
|
2002-05-26 01:22:57 +03:00
|
|
|
# (c) 2000, 2001, 2002 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)
|
|
|
|
|
2002-07-18 23:27:09 +03:00
|
|
|
CFLAGS= $(OPTFLAGS) -Wall -g -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libav -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
|
2002-08-21 22:18:02 +03:00
|
|
|
ifeq ($(CONFIG_DARWIN),yes)
|
|
|
|
LDFLAGS+= -g -d
|
2002-08-30 03:05:28 +03:00
|
|
|
FFSLDFLAGS= -Wl,-bind_at_load
|
2002-08-21 22:18:02 +03:00
|
|
|
else
|
2002-07-25 19:40:10 +03:00
|
|
|
LDFLAGS+= -g -Wl,--warn-common
|
2002-08-30 03:05:28 +03:00
|
|
|
FFSLDFLAGS= -Wl,-E
|
2002-08-21 22:18:02 +03:00
|
|
|
endif
|
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
|
|
|
|
|
2001-08-16 01:29:44 +03:00
|
|
|
ifeq ($(CONFIG_WIN32),yes)
|
|
|
|
EXE=.exe
|
|
|
|
PROG=ffmpeg$(EXE)
|
|
|
|
else
|
|
|
|
EXT=
|
2001-09-25 02:21:02 +03:00
|
|
|
PROG=ffmpeg ffplay ffserver
|
2001-08-16 01:29:44 +03: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)
|
2002-05-26 01:22:57 +03:00
|
|
|
DEP_LIBS=libavcodec/libavcodec.so libav/libavformat.a
|
2001-10-27 15:04:27 +03:00
|
|
|
else
|
2002-05-26 01:22:57 +03:00
|
|
|
DEP_LIBS=libavcodec/libavcodec.a libav/libavformat.a
|
2002-03-10 16:44:19 +02:00
|
|
|
ifeq ($(CONFIG_MP3LAME),yes)
|
|
|
|
EXTRALIBS+=-lmp3lame
|
|
|
|
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
|
|
|
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
|
|
|
ifneq ($(CONFIG_DARWIN),yes)
|
2002-11-20 05:02:23 +02:00
|
|
|
LDFLAGS += -rdynamic
|
|
|
|
endif
|
2002-11-23 03:29:25 +02:00
|
|
|
endif
|
2002-11-20 05:02:23 +02:00
|
|
|
|
2002-04-22 22:57:45 +03:00
|
|
|
OBJS = ffmpeg.o ffserver.o
|
|
|
|
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
|
|
|
|
|
2002-11-20 05:02:23 +02:00
|
|
|
all: lib $(PROG) $(VHOOK)
|
2001-07-22 17:37:44 +03:00
|
|
|
|
|
|
|
lib:
|
2001-08-11 21:57:27 +03:00
|
|
|
$(MAKE) -C libavcodec all
|
|
|
|
$(MAKE) -C libav all
|
2001-07-22 17:37:44 +03:00
|
|
|
|
2002-07-25 19:40:10 +03:00
|
|
|
ffmpeg_g$(EXE): ffmpeg.o $(DEP_LIBS)
|
2002-05-26 01:22:57 +03:00
|
|
|
$(CC) $(LDFLAGS) -o $@ ffmpeg.o -L./libavcodec -L./libav \
|
|
|
|
-lavformat -lavcodec $(EXTRALIBS)
|
2001-07-22 17:37:44 +03:00
|
|
|
|
2002-07-25 19:40:10 +03:00
|
|
|
ffmpeg$(EXE): ffmpeg_g$(EXE)
|
2002-11-03 03:39:20 +02:00
|
|
|
cp -p $< $@ ; $(STRIP) $@
|
2002-07-25 19:40:10 +03:00
|
|
|
|
2002-05-26 01:22:57 +03:00
|
|
|
ffserver$(EXE): ffserver.o $(DEP_LIBS)
|
2002-08-30 03:05:28 +03:00
|
|
|
$(CC) $(LDFLAGS) $(FFSLDFLAGS) \
|
|
|
|
-o $@ ffserver.o -L./libavcodec -L./libav \
|
2002-07-25 19:40:10 +03:00
|
|
|
-lavformat -lavcodec -ldl $(EXTRALIBS)
|
2001-07-22 17:37:44 +03:00
|
|
|
|
2001-09-25 02:21:02 +03:00
|
|
|
ffplay: ffmpeg$(EXE)
|
|
|
|
ln -sf $< $@
|
|
|
|
|
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
|
|
|
|
2002-11-20 05:02:23 +02:00
|
|
|
videohook:
|
|
|
|
$(MAKE) -C vhook all
|
|
|
|
|
|
|
|
install: all $(INSTALLVHOOK)
|
2001-10-27 15:04:27 +03:00
|
|
|
$(MAKE) -C libavcodec install
|
2002-08-13 21:51:11 +03:00
|
|
|
install -d $(prefix)/bin
|
2001-07-23 23:06:54 +03:00
|
|
|
install -s -m 755 $(PROG) $(prefix)/bin
|
2001-09-25 02:21:02 +03:00
|
|
|
ln -sf ffmpeg $(prefix)/bin/ffplay
|
2001-07-22 17:37:44 +03:00
|
|
|
|
2002-11-20 05:02:23 +02:00
|
|
|
install-vhook: $(prefix)/lib/vhook
|
|
|
|
$(MAKE) -C vhook install INSTDIR=$(prefix)/lib/vhook
|
|
|
|
|
|
|
|
$(prefix)/lib/vhook:
|
|
|
|
mkdir $@
|
|
|
|
|
2002-07-25 19:40:10 +03:00
|
|
|
installlib:
|
|
|
|
$(MAKE) -C libavcodec installlib
|
|
|
|
$(MAKE) -C libav installlib
|
|
|
|
|
2002-04-22 22:57:45 +03:00
|
|
|
dep: depend
|
|
|
|
|
|
|
|
depend:
|
|
|
|
$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
|
|
|
|
|
2002-11-20 05:02:23 +02:00
|
|
|
clean: $(CLEANVHOOK)
|
2001-08-11 21:57:27 +03:00
|
|
|
$(MAKE) -C libavcodec clean
|
|
|
|
$(MAKE) -C libav clean
|
2002-05-19 02:11:25 +03:00
|
|
|
$(MAKE) -C tests clean
|
2002-07-25 19:40:10 +03:00
|
|
|
rm -f *.o *~ .depend gmon.out TAGS ffmpeg_g$(EXE) $(PROG)
|
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:
|
|
|
|
etags *.[ch] libav/*.[ch] libavcodec/*.[ch]
|
2002-04-22 22:57:45 +03:00
|
|
|
|
2002-05-19 02:11:25 +03:00
|
|
|
# regression tests
|
|
|
|
|
2002-05-20 19:34:07 +03:00
|
|
|
libavtest test mpeg4 mpeg: ffmpeg$(EXE)
|
2002-05-19 02:11:25 +03:00
|
|
|
make -C tests $@
|
|
|
|
|
2002-04-22 22:57:45 +03:00
|
|
|
ifneq ($(wildcard .depend),)
|
|
|
|
include .depend
|
|
|
|
endif
|