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
|
|
|
|
2006-11-08 00:02:15 +00:00
|
|
|
VPATH=$(SRC_PATH_BARE)
|
2002-05-18 23:11:25 +00:00
|
|
|
|
2006-10-07 09:22:44 +00:00
|
|
|
CFLAGS=$(OPTFLAGS) -I$(BUILD_ROOT) -I$(SRC_PATH) -I$(SRC_PATH)/libavutil \
|
2006-10-23 17:06:32 +00:00
|
|
|
-I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libswscale \
|
2006-07-13 23:10:01 +00:00
|
|
|
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE
|
2005-12-17 18:14:38 +00:00
|
|
|
LDFLAGS+= -g
|
2002-07-25 16:40:10 +00:00
|
|
|
|
2007-02-27 19:00:26 +00:00
|
|
|
PROGS-$(CONFIG_FFMPEG) += ffmpeg
|
|
|
|
PROGS-$(CONFIG_FFPLAY) += ffplay
|
|
|
|
PROGS-$(CONFIG_FFSERVER) += ffserver
|
2003-06-07 18:34:02 +00:00
|
|
|
|
2007-02-27 19:00:26 +00:00
|
|
|
PROGS = $(addsuffix $(EXESUF), $(PROGS-yes))
|
|
|
|
PROGS_G = $(addsuffix _g$(EXESUF), $(PROGS-yes))
|
|
|
|
MANPAGES = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
|
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))
|
|
|
|
|
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
|
|
|
|
|
2006-11-08 23:18:18 +00:00
|
|
|
ifeq ($(CONFIG_VHOOK),yes)
|
2007-02-27 22:51:30 +00:00
|
|
|
all: videohook
|
|
|
|
install: install-vhook
|
2002-11-23 01:29:25 +00:00
|
|
|
endif
|
2002-11-20 03:02:23 +00:00
|
|
|
|
2004-07-05 18:06:16 +00:00
|
|
|
ifeq ($(BUILD_DOC),yes)
|
2007-02-27 22:51:30 +00:00
|
|
|
all: documentation
|
|
|
|
install: install-man
|
2004-07-05 18:06:16 +00:00
|
|
|
endif
|
|
|
|
|
2007-03-08 00:24:14 +00:00
|
|
|
SRCS = $(addsuffix .c, $(PROGS-yes)) cmdutils.c
|
2006-10-15 12:57:47 +00:00
|
|
|
LDFLAGS := -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil $(LDFLAGS)
|
2006-09-08 19:36:21 +00:00
|
|
|
EXTRALIBS := -lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)
|
2002-04-22 19:57:45 +00:00
|
|
|
|
2006-08-08 18:51:38 +00:00
|
|
|
ifeq ($(CONFIG_SWSCALER),yes)
|
2006-09-08 18:06:22 +00:00
|
|
|
LDFLAGS+=-L./libswscale
|
2006-09-08 18:28:58 +00:00
|
|
|
EXTRALIBS+=-lswscale$(BUILDSUF)
|
2006-08-08 18:51:38 +00:00
|
|
|
endif
|
|
|
|
|
2007-02-27 22:51:30 +00:00
|
|
|
all: lib $(PROGS)
|
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)
|
2006-06-01 21:37:48 +00:00
|
|
|
$(MAKE) -C libpostproc all
|
2006-02-11 21:42:11 +00:00
|
|
|
endif
|
2006-08-08 18:51:38 +00:00
|
|
|
ifeq ($(CONFIG_SWSCALER),yes)
|
|
|
|
$(MAKE) -C libswscale 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
|
2006-09-08 18:28:58 +00:00
|
|
|
$(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(EXTRALIBS)
|
2001-07-22 14:37:44 +00:00
|
|
|
|
2003-09-15 22:26:45 +00:00
|
|
|
ffserver$(EXESUF): ffserver.o .libs
|
2006-09-08 18:28:58 +00:00
|
|
|
$(CC) $(LDFLAGS) $(FFSERVERLDFLAGS) -o $@ ffserver.o $(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
|
2006-09-08 18:28:58 +00:00
|
|
|
$(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(EXTRALIBS) $(SDL_LIBS)
|
2003-06-07 18:34:02 +00:00
|
|
|
|
2006-06-19 23:26:46 +00:00
|
|
|
%$(EXESUF): %_g$(EXESUF)
|
2003-06-07 18:34:02 +00:00
|
|
|
cp -p $< $@
|
|
|
|
$(STRIP) $@
|
|
|
|
|
2006-12-26 17:25:16 +00:00
|
|
|
SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
|
|
|
|
ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
|
|
|
|
version.h: $(SVN_ENTRIES)
|
|
|
|
endif
|
|
|
|
|
2006-06-20 10:24:08 +00:00
|
|
|
version.h:
|
2006-11-08 00:02:15 +00:00
|
|
|
$(SRC_PATH)/version.sh $(SRC_PATH)
|
2006-06-20 10:24:08 +00:00
|
|
|
|
2003-09-15 22:26:45 +00:00
|
|
|
output_example$(EXESUF): output_example.o .libs
|
2006-09-08 18:28:58 +00:00
|
|
|
$(CC) $(LDFLAGS) -o $@ output_example.o $(EXTRALIBS)
|
2003-07-22 12:46:15 +00:00
|
|
|
|
2004-03-26 20:42:28 +00:00
|
|
|
qt-faststart$(EXESUF): qt-faststart.c
|
2006-09-09 17:28:53 +00:00
|
|
|
$(CC) $(CFLAGS) $< -o $@
|
2004-03-26 20:42:28 +00:00
|
|
|
|
2004-10-16 11:08:49 +00:00
|
|
|
cws2fws$(EXESUF): cws2fws.c
|
2006-09-09 17:28:53 +00:00
|
|
|
$(CC) $< -o $@ -lz
|
2004-10-16 11:08:49 +00:00
|
|
|
|
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
|
|
|
|
2006-09-12 23:13:22 +00:00
|
|
|
ffmpeg.o ffplay.o ffserver.o: version.h
|
|
|
|
|
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
|
|
|
|
|
2007-02-27 22:51:30 +00:00
|
|
|
install: install-progs install-libs install-headers
|
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)"
|
2007-01-25 12:29:48 +00:00
|
|
|
install -c -m 755 $(PROGS) "$(bindir)"
|
2001-07-22 14:37:44 +00:00
|
|
|
|
2007-01-25 12:13:15 +00:00
|
|
|
# Create the Windows installer.
|
2003-09-11 22:49:35 +00:00
|
|
|
wininstaller: all install
|
|
|
|
makensis ffinstall.nsi
|
|
|
|
|
2003-08-24 16:02:39 +00:00
|
|
|
install-man:
|
2006-11-14 02:53:59 +00:00
|
|
|
install -d "$(mandir)/man1"
|
|
|
|
install -m 644 $(MANPAGES) "$(mandir)/man1"
|
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-06-01 21:37:48 +00:00
|
|
|
$(MAKE) -C libpostproc install-libs
|
2006-02-11 21:42:11 +00:00
|
|
|
endif
|
2006-08-08 18:51:38 +00:00
|
|
|
ifeq ($(CONFIG_SWSCALER),yes)
|
|
|
|
$(MAKE) -C libswscale install-libs
|
|
|
|
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)
|
2006-06-01 21:37:48 +00:00
|
|
|
$(MAKE) -C libpostproc install-headers
|
2006-02-11 21:42:11 +00:00
|
|
|
endif
|
2006-08-08 18:51:38 +00:00
|
|
|
$(MAKE) -C libswscale install-headers
|
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:
|
|
|
|
rm -f $(addprefix $(mandir)/man1/,$(ALLMANPAGES))
|
|
|
|
|
|
|
|
uninstall-vhook:
|
|
|
|
$(MAKE) -C vhook uninstall
|
|
|
|
|
|
|
|
uninstall-libs:
|
|
|
|
$(MAKE) -C libavutil uninstall-libs
|
|
|
|
$(MAKE) -C libavcodec uninstall-libs
|
|
|
|
$(MAKE) -C libavformat uninstall-libs
|
2006-06-01 21:37:48 +00:00
|
|
|
$(MAKE) -C libpostproc uninstall-libs
|
2006-05-18 12:14:02 +00:00
|
|
|
|
|
|
|
uninstall-headers:
|
|
|
|
$(MAKE) -C libavutil uninstall-headers
|
|
|
|
$(MAKE) -C libavcodec uninstall-headers
|
|
|
|
$(MAKE) -C libavformat uninstall-headers
|
2006-06-01 21:37:48 +00:00
|
|
|
$(MAKE) -C libpostproc uninstall-headers
|
2006-05-18 12:14:02 +00:00
|
|
|
-rmdir "$(incdir)"
|
|
|
|
-rmdir "$(prefix)/include/postproc"
|
|
|
|
|
2006-11-12 16:07:14 +00:00
|
|
|
depend dep: .depend
|
2006-06-01 23:20:51 +00:00
|
|
|
$(MAKE) -C libavutil 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
|
2006-09-12 10:33:27 +00:00
|
|
|
ifeq ($(CONFIG_PP),yes)
|
|
|
|
$(MAKE) -C libpostproc depend
|
|
|
|
endif
|
2006-10-01 16:33:31 +00:00
|
|
|
ifeq ($(CONFIG_SWSCALER),yes)
|
|
|
|
$(MAKE) -C libswscale depend
|
|
|
|
endif
|
2006-11-08 23:18:18 +00:00
|
|
|
ifeq ($(CONFIG_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
|
|
|
|
2006-06-22 21:28:30 +00:00
|
|
|
.depend: $(SRCS) version.h
|
2006-11-12 16:37:32 +00:00
|
|
|
$(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $(filter-out %.h,$^) 1>.depend
|
2002-04-22 19:57:45 +00:00
|
|
|
|
2006-12-07 19:25:04 +00:00
|
|
|
$(DEP_LIBS): lib
|
|
|
|
|
|
|
|
.libs: $(DEP_LIBS)
|
|
|
|
touch $@
|
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-06-01 21:37:48 +00:00
|
|
|
$(MAKE) -C libpostproc clean
|
2006-08-08 18:51:38 +00:00
|
|
|
$(MAKE) -C libswscale clean
|
2006-05-18 08:40:15 +00:00
|
|
|
$(MAKE) -C tests clean
|
|
|
|
$(MAKE) -C vhook clean
|
2006-07-02 18:17:30 +00:00
|
|
|
$(MAKE) -C doc clean
|
2006-11-15 02:13:11 +00:00
|
|
|
rm -f *.o *.d *~ .libs gmon.out TAGS $(ALLPROGS) $(ALLPROGS_G) \
|
|
|
|
output_example$(EXESUF) qt-faststart$(EXESUF) cws2fws$(EXESUF)
|
2002-11-20 03:02:23 +00:00
|
|
|
|
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-06-01 21:37:48 +00:00
|
|
|
$(MAKE) -C libpostproc distclean
|
2006-08-08 18:51:38 +00:00
|
|
|
$(MAKE) -C libswscale distclean
|
2006-01-16 14:59:54 +00:00
|
|
|
$(MAKE) -C tests distclean
|
|
|
|
$(MAKE) -C vhook distclean
|
2006-07-02 18:24:11 +00:00
|
|
|
rm -f .depend version.h config.* *.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-10-02 16:56:09 +00:00
|
|
|
codectest libavtest test-server fulltest test mpeg4 mpeg: $(PROGS)
|
2003-07-16 19:14:07 +00:00
|
|
|
$(MAKE) -C tests $@
|
2002-05-18 23:11:25 +00:00
|
|
|
|
2006-10-03 17:42:17 +00:00
|
|
|
.PHONY: all lib videohook documentation install* wininstaller uninstall*
|
2006-11-15 00:51:07 +00:00
|
|
|
.PHONY: dep depend clean distclean TAGS
|
2006-10-03 17:42:17 +00:00
|
|
|
.PHONY: codectest libavtest test-server fulltest test mpeg4 mpeg
|
2003-03-12 18:38:18 +00:00
|
|
|
|
2007-02-23 23:44:48 +00:00
|
|
|
-include .depend
|