3 # (c) 2000-2004 Fabrice Bellard
9 CFLAGS
=$(OPTFLAGS
) -I.
-I
$(SRC_PATH
) -I
$(SRC_PATH
)/libavutil
-I
$(SRC_PATH
)/libavcodec
-I
$(SRC_PATH
)/libavformat
-D_FILE_OFFSET_BITS
=64 -D_LARGEFILE_SOURCE
-D_GNU_SOURCE
12 ifeq ($(TARGET_GPROF
),yes
)
19 PROGTEST
=output_example
$(EXESUF
)
20 QTFASTSTART
=qt-faststart
$(EXESUF
)
22 ifeq ($(CONFIG_FFSERVER
),yes
)
23 MANPAGE
+=doc
/ffserver
.1
24 PROG
+=ffserver
$(EXESUF
)
27 ifeq ($(CONFIG_FFPLAY
),yes
)
33 ifeq ($(CONFIG_AUDIO_BEOS
),yes
)
34 EXTRALIBS
+=-lmedia
-lbe
37 ifeq ($(BUILD_SHARED
),yes
)
38 DEP_LIBS
=libavcodec
/$(SLIBPREF
)avcodec
$(SLIBSUF
) libavformat
/$(SLIBPREF
)avformat
$(SLIBSUF
)
40 DEP_LIBS
=libavcodec
/$(LIBPREF
)avcodec
$(LIBSUF
) libavformat
/$(LIBPREF
)avformat
$(LIBSUF
)
43 ifeq ($(BUILD_VHOOK
),yes
)
45 INSTALLVHOOK
=install-vhook
48 ifeq ($(TARGET_OS
), SunOS
)
54 ifeq ($(BUILD_DOC
),yes
)
58 OBJS
= ffmpeg.o ffserver.o cmdutils.o
$(FFPLAY_O
)
59 SRCS
= $(OBJS
:.o
=.c
) $(ASM_OBJS
:.o
=.s
)
60 FFLIBS
= -L.
/libavformat
-lavformat
$(BUILDSUF
) -L.
/libavcodec
-lavcodec
$(BUILDSUF
) -L.
/libavutil
-lavutil
$(BUILDSUF
)
62 all: lib
$(PROG
) $(PROGTEST
) $(VHOOK
) $(QTFASTSTART
) $(DOC
)
65 $(MAKE
) -C libavutil
all
66 $(MAKE
) -C libavcodec
all
67 $(MAKE
) -C libavformat
all
69 ffmpeg_g
$(EXESUF
): ffmpeg.o cmdutils.o .libs
70 $(CC
) $(LDFLAGS
) -o
$@ ffmpeg.o cmdutils.o
$(FFLIBS
) $(EXTRALIBS
)
72 ffmpeg
$(EXESUF
): ffmpeg_g
$(EXESUF
)
76 ffserver
$(EXESUF
): ffserver.o .libs
77 $(CC
) $(LDFLAGS
) $(FFSLDFLAGS
) -o
$@ ffserver.o
$(FFLIBS
) $(EXTRALIBS
)
79 ffplay_g
$(EXESUF
): ffplay.o cmdutils.o .libs
80 $(CC
) $(LDFLAGS
) -o
$@ ffplay.o cmdutils.o
$(FFLIBS
) $(EXTRALIBS
) $(SDL_LIBS
)
82 ffplay
$(EXESUF
): ffplay_g
$(EXESUF
)
86 output_example
$(EXESUF
): output_example.o .libs
87 $(CC
) $(LDFLAGS
) -o
$@ output_example.o
$(FFLIBS
) $(EXTRALIBS
)
89 qt-faststart
$(EXESUF
): qt-faststart.c
90 $(CC
) $(SRC_PATH
)/qt-faststart.c
-o qt-faststart
$(EXESUF
)
92 cws2fws
$(EXESUF
): cws2fws.c
93 $(CC
) $(SRC_PATH
)/cws2fws.c
-o cws2fws
$(EXESUF
) -lz
96 $(CC
) $(CFLAGS
) $(SDL_CFLAGS
) -c
-o
$@
$<
99 $(CC
) $(CFLAGS
) -c
-o
$@
$<
109 install: all install-man
$(INSTALLVHOOK
)
110 $(MAKE
) -C libavutil
install
111 $(MAKE
) -C libavcodec
install
112 $(MAKE
) -C libavformat
install
113 install -d
"$(bindir)"
114 install -c
$(INSTALLSTRIP
) -m
755 $(PROG
) "$(bindir)"
116 # create the window installer
117 wininstaller
: all install
118 makensis ffinstall.nsi
120 # install man from source dir if available
122 ifneq ($(CONFIG_WIN32
),yes
)
123 if
[ -f doc
/ffmpeg
.1 ] ; then \
124 install -d
"$(mandir)/man1" ; \
125 install -m
644 $(MANPAGE
) "$(mandir)/man1" ; \
130 $(MAKE
) -C vhook
install
133 $(MAKE
) -C libavutil installlib
134 $(MAKE
) -C libavcodec installlib
135 $(MAKE
) -C libavformat installlib
140 $(MAKE
) -C libavcodec depend
141 $(MAKE
) -C libavformat depend
142 ifeq ($(BUILD_VHOOK
),yes
)
143 $(MAKE
) -C vhook depend
147 $(CC
) -MM
$(CFLAGS
) $(SDL_CFLAGS
) $^
1>.depend
150 @
test -f .libs || touch .libs
151 @for i in
$(DEP_LIBS
) ; do if
$(TEST
) $$i -nt .libs
; then touch .libs
; fi
; done
154 $(MAKE
) -C libavutil
clean
155 $(MAKE
) -C libavcodec
clean
156 $(MAKE
) -C libavformat
clean
157 $(MAKE
) -C tests
clean
158 $(MAKE
) -C vhook
clean
159 rm -f
*.o
*.d
*~ .libs gmon.out TAGS \
160 $(PROG
) $(PROGTEST
) $(QTFASTSTART
)
162 # Note well: config.log is NOT removed.
164 $(MAKE
) -C libavutil
distclean
165 $(MAKE
) -C libavcodec
distclean
166 $(MAKE
) -C libavformat
distclean
167 $(MAKE
) -C tests
distclean
168 $(MAKE
) -C vhook
distclean
169 rm -f Makefile.bak .depend config.mak config.h
*.
pc
172 etags
*.
[ch
] libavformat
/*.
[ch
] libavcodec
/*.
[ch
]
176 libavtest
test mpeg4 mpeg test-server fulltest
: ffmpeg
$(EXESUF
)
179 # tar release (use 'make -k tar' on a checkouted tree)
180 FILE
=ffmpeg-
$(shell grep
"\#define FFMPEG_VERSION " libavcodec
/avcodec.h | \
186 ( cd
/tmp
; tar zcvf ~
/$(FILE
).
tar.gz
$(FILE
) --exclude CVS
)
191 ifneq ($(wildcard .depend
),)