Statistics
| Branch: | Revision:

ffmpeg / Makefile @ 1a9150b1

History | View | Annotate | Download (5.31 KB)

1
#
2
# Main ffmpeg Makefile
3
# (c) 2000-2004 Fabrice Bellard
4
#
5
include config.mak
6

    
7
VPATH=$(SRC_PATH)
8

    
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
10
LDFLAGS+= -g
11

    
12
ifeq ($(TARGET_GPROF),yes)
13
CFLAGS+=-p
14
LDFLAGS+=-p
15
endif
16

    
17
MANPAGE=doc/ffmpeg.1
18
PROG_G+=ffmpeg_g$(EXESUF)
19
PROG+=ffmpeg$(EXESUF)
20
PROGTEST=output_example$(EXESUF)
21
QTFASTSTART=qt-faststart$(EXESUF)
22

    
23
ifeq ($(CONFIG_FFSERVER),yes)
24
MANPAGE+=doc/ffserver.1
25
PROG+=ffserver$(EXESUF)
26
endif
27

    
28
ifeq ($(CONFIG_FFPLAY),yes)
29
MANPAGE+=doc/ffplay.1
30
PROG_G+=ffplay_g$(EXESUF)
31
PROG+=ffplay$(EXESUF)
32
FFPLAY_O=ffplay.o
33
endif
34

    
35
ifeq ($(CONFIG_AUDIO_BEOS),yes)
36
EXTRALIBS+=-lmedia -lbe
37
endif
38

    
39
ifeq ($(BUILD_SHARED),yes)
40
DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF)
41
else
42
DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
43
endif
44

    
45
ifeq ($(BUILD_VHOOK),yes)
46
VHOOK=videohook
47
INSTALLVHOOK=install-vhook
48
endif
49

    
50
ifeq ($(TARGET_OS), SunOS)
51
TEST=/usr/bin/test
52
else
53
TEST=test
54
endif
55

    
56
ifeq ($(BUILD_DOC),yes)
57
DOC=documentation
58
endif
59

    
60
OBJS = ffmpeg.o ffserver.o cmdutils.o $(FFPLAY_O)
61
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
62
FFLIBS = -L./libavformat -lavformat$(BUILDSUF) -L./libavcodec -lavcodec$(BUILDSUF) -L./libavutil -lavutil$(BUILDSUF)
63

    
64
all: lib $(PROG_G) $(PROG) $(PROGTEST) $(VHOOK) $(QTFASTSTART) $(DOC)
65

    
66
lib:
67
	$(MAKE) -C libavutil all
68
	$(MAKE) -C libavcodec all
69
	$(MAKE) -C libavformat all
70
ifeq ($(CONFIG_PP),yes)
71
	$(MAKE) -C libavcodec/libpostproc all
72
endif
73

    
74
ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
75
	$(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(FFLIBS) $(EXTRALIBS)
76

    
77
ffmpeg$(EXESUF): ffmpeg_g$(EXESUF)
78
	cp -p $< $@
79
	$(STRIP) $@
80

    
81
ffserver$(EXESUF): ffserver.o .libs
82
	$(CC) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS)
83

    
84
ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
85
	$(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(FFLIBS) $(EXTRALIBS) $(SDL_LIBS)
86

    
87
ffplay$(EXESUF): ffplay_g$(EXESUF)
88
	cp -p $< $@
89
	$(STRIP) $@
90

    
91
output_example$(EXESUF): output_example.o .libs
92
	$(CC) $(LDFLAGS) -o $@ output_example.o $(FFLIBS) $(EXTRALIBS)
93

    
94
qt-faststart$(EXESUF): qt-faststart.c
95
	$(CC) $(SRC_PATH)/qt-faststart.c -o qt-faststart$(EXESUF)
96

    
97
cws2fws$(EXESUF): cws2fws.c
98
	$(CC) $(SRC_PATH)/cws2fws.c -o cws2fws$(EXESUF) -lz
99

    
100
ffplay.o: ffplay.c
101
	$(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $<
102

    
103
%.o: %.c
104
	$(CC) $(CFLAGS) -c -o $@ $<
105

    
106
videohook: .libs
107
	$(MAKE) -C vhook all
108

    
109
documentation:
110
	$(MAKE) -C doc all
111

    
112
.PHONY: install
113

    
114
install: install-progs install-libs install-headers install-man $(INSTALLVHOOK)
115

    
116
ifeq ($(BUILD_SHARED),yes)
117
install-progs: $(PROG) install-libs
118
else
119
install-progs: $(PROG)
120
endif
121
	install -d "$(bindir)"
122
	install -c $(INSTALLSTRIP) -m 755 $(PROG) "$(bindir)"
123

    
124
# create the window installer
125
wininstaller: all install
126
	makensis ffinstall.nsi
127

    
128
# install man from source dir if available
129
install-man:
130
ifneq ($(CONFIG_WIN32),yes)
131
	if [ -f doc/ffmpeg.1 ] ; then \
132
	    install -d "$(mandir)/man1" ; \
133
	    install -m 644 $(MANPAGE) "$(mandir)/man1" ; \
134
	fi
135
endif
136

    
137
install-vhook:
138
	$(MAKE) -C vhook install
139

    
140
install-libs:
141
	install -d $(libdir)
142
ifeq ($(BUILD_SHARED),yes)
143
	$(MAKE) -C libavutil   install-lib-shared
144
	$(MAKE) -C libavcodec  install-lib-shared
145
	$(MAKE) -C libavformat install-lib-shared
146
ifeq ($(CONFIG_PP),yes)
147
	$(MAKE) -C libavcodec/libpostproc install-lib-shared
148
endif
149
	$(LDCONFIG) || true
150
endif
151
ifeq ($(BUILD_STATIC),yes)
152
	$(MAKE) -C libavutil   install-lib-static
153
	$(MAKE) -C libavcodec  install-lib-static
154
	$(MAKE) -C libavformat install-lib-static
155
ifeq ($(CONFIG_PP),yes)
156
	$(MAKE) -C libavcodec/libpostproc install-lib-static
157
endif
158
endif
159

    
160
install-headers:
161
	install -d "$(incdir)"
162
	install -d "$(libdir)/pkgconfig"
163
	$(MAKE) -C libavutil   install-headers
164
	$(MAKE) -C libavcodec  install-headers
165
	$(MAKE) -C libavformat install-headers
166
ifeq ($(CONFIG_PP),yes)
167
	$(MAKE) -C libavcodec/libpostproc install-headers
168
endif
169

    
170
dep:	depend
171

    
172
depend: .depend
173
	$(MAKE) -C libavcodec depend
174
	$(MAKE) -C libavformat depend
175
ifeq ($(BUILD_VHOOK),yes)
176
	$(MAKE) -C vhook depend
177
endif
178

    
179
.depend: $(SRCS)
180
	$(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $^ 1>.depend
181

    
182
.libs: lib
183
	@test -f .libs || touch .libs
184
	@for i in $(DEP_LIBS) ; do if $(TEST) $$i -nt .libs ; then touch .libs; fi ; done
185

    
186
clean:
187
	$(MAKE) -C libavutil clean
188
	$(MAKE) -C libavcodec clean
189
	$(MAKE) -C libavformat clean
190
	$(MAKE) -C libavcodec/libpostproc clean
191
	$(MAKE) -C tests clean
192
	$(MAKE) -C vhook clean
193
	rm -f *.o *.d *~ .libs gmon.out TAGS \
194
	   $(PROG) $(PROG_G) $(PROGTEST) $(QTFASTSTART)
195

    
196
# Note well: config.log is NOT removed.
197
distclean: clean
198
	$(MAKE) -C libavutil   distclean
199
	$(MAKE) -C libavcodec  distclean
200
	$(MAKE) -C libavformat distclean
201
	$(MAKE) -C libavcodec/libpostproc distclean
202
	$(MAKE) -C tests       distclean
203
	$(MAKE) -C vhook       distclean
204
	rm -f .depend config.mak config.h *.pc
205

    
206
TAGS:
207
	etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
208

    
209
# regression tests
210

    
211
libavtest test mpeg4 mpeg test-server fulltest: ffmpeg$(EXESUF)
212
	$(MAKE) -C tests $@
213

    
214
# tar release (use 'make -k tar' on a checkouted tree)
215
FILE=ffmpeg-$(shell grep "\#define FFMPEG_VERSION " libavcodec/avcodec.h | \
216
                    cut -d "\"" -f 2 )
217

    
218
tar:
219
	rm -rf /tmp/$(FILE)
220
	cp -r . /tmp/$(FILE)
221
	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
222
	rm -rf /tmp/$(FILE)
223

    
224
.PHONY: lib
225

    
226
ifneq ($(wildcard .depend),)
227
include .depend
228
endif