-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE
LDFLAGS+= -g
-ifeq ($(CONFIG_FFMPEG),yes)
-MANPAGES=doc/ffmpeg.1
-PROGS_G+=ffmpeg_g$(EXESUF)
-PROGS+=ffmpeg$(EXESUF)
-endif
-
-ifeq ($(CONFIG_FFSERVER),yes)
-MANPAGES+=doc/ffserver.1
-PROGS+=ffserver$(EXESUF)
-endif
+PROGS-$(CONFIG_FFMPEG) += ffmpeg
+PROGS-$(CONFIG_FFPLAY) += ffplay
+PROGS-$(CONFIG_FFSERVER) += ffserver
-ifeq ($(CONFIG_FFPLAY),yes)
-MANPAGES+=doc/ffplay.1
-PROGS_G+=ffplay_g$(EXESUF)
-PROGS+=ffplay$(EXESUF)
-endif
+PROGS = $(addsuffix $(EXESUF), $(PROGS-yes))
+PROGS_G = $(addsuffix _g$(EXESUF), $(PROGS-yes))
+MANPAGES = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
BASENAMES=ffmpeg ffplay ffserver
ALLPROGS=$(addsuffix $(EXESUF), $(BASENAMES))
endif
ifeq ($(CONFIG_VHOOK),yes)
-VHOOK=videohook
-INSTALLVHOOK=install-vhook
+all: videohook
+install: install-vhook
endif
ifeq ($(BUILD_DOC),yes)
-DOC=documentation
-INSTALLMAN=install-man
+all: documentation
+install: install-man
endif
-OBJS = ffmpeg.o ffserver.o cmdutils.o ffplay.o
-SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
+SRCS = $(addsuffix .c, $(PROGS-yes)) cmdutils.c
LDFLAGS := -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil $(LDFLAGS)
EXTRALIBS := -lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)
EXTRALIBS+=-lswscale$(BUILDSUF)
endif
-all: lib $(PROGS_G) $(PROGS) $(VHOOK) $(DOC)
+all: lib $(PROGS)
lib:
$(MAKE) -C libavutil all
cp -p $< $@
$(STRIP) $@
+SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
+ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
+version.h: $(SVN_ENTRIES)
+endif
+
version.h:
$(SRC_PATH)/version.sh $(SRC_PATH)
videohook: .libs
$(MAKE) -C vhook all
-documentation:
- $(MAKE) -C doc all
+documentation: $(addprefix doc/, ffmpeg-doc.html faq.html ffserver-doc.html \
+ ffplay-doc.html hooks.html $(ALLMANPAGES))
-install: install-progs install-libs install-headers $(INSTALLMAN) $(INSTALLVHOOK)
+doc/%.html: doc/%.texi
+ texi2html -monolithic -number $<
+ mv $(@F) $@
+
+doc/%.pod: doc/%-doc.texi
+ doc/texi2pod.pl $< $@
+
+doc/%.1: doc/%.pod
+ pod2man --section=1 --center=" " --release=" " $< > $@
+
+install: install-progs install-libs install-headers
ifeq ($(BUILD_SHARED),yes)
install-progs: $(PROGS) install-libs
install-progs: $(PROGS)
endif
install -d "$(bindir)"
- install -c $(INSTALLSTRIP) -m 755 $(PROGS) "$(bindir)"
+ install -c -m 755 $(PROGS) "$(bindir)"
-# create the window installer
+# Create the Windows installer.
wininstaller: all install
makensis ffinstall.nsi
.depend: $(SRCS) version.h
$(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $(filter-out %.h,$^) 1>.depend
-.libs: lib
- @test -f .libs || touch .libs
- @for i in $(DEP_LIBS) ; do if test $$i -nt .libs ; then touch .libs; fi ; done
+$(DEP_LIBS): lib
+
+.libs: $(DEP_LIBS)
+ touch $@
clean:
$(MAKE) -C libavutil clean
$(MAKE) -C libswscale clean
$(MAKE) -C tests clean
$(MAKE) -C vhook clean
- $(MAKE) -C doc clean
- rm -f *.o *.d *~ .libs gmon.out TAGS \
- $(ALLPROGS) $(ALLPROGS_G) output_example$(EXESUF) qt-faststart$(EXESUF)
+ rm -f *.o *.d *~ .libs gmon.out TAGS $(ALLPROGS) $(ALLPROGS_G) \
+ output_example$(EXESUF) qt-faststart$(EXESUF) cws2fws$(EXESUF)
+ rm -f doc/*.html doc/*.pod doc/*.1
-# Note well: config.log is NOT removed.
distclean: clean
$(MAKE) -C libavutil distclean
$(MAKE) -C libavcodec distclean
# regression tests
-codectest libavtest test-server fulltest test mpeg4 mpeg: $(PROGS)
+codectest libavtest seektest test-server fulltest test: $(PROGS)
$(MAKE) -C tests $@
.PHONY: all lib videohook documentation install* wininstaller uninstall*
.PHONY: dep depend clean distclean TAGS
-.PHONY: codectest libavtest test-server fulltest test mpeg4 mpeg
+.PHONY: codectest libavtest seektest test-server fulltest test
-ifneq ($(wildcard .depend),)
-include .depend
-endif
+-include .depend