Statistics
| Branch: | Revision:

ffmpeg / Makefile @ 4c9b0af5

History | View | Annotate | Download (5.75 KB)

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

    
7
VPATH=$(SRC_PATH_BARE)
8

    
9
CFLAGS=$(OPTFLAGS) -I$(BUILD_ROOT) -I$(SRC_PATH) -I$(SRC_PATH)/libavutil \
10
       -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libswscale \
11
       -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE
12
LDFLAGS+= -g
13

    
14
PROGS-$(CONFIG_FFMPEG)   += ffmpeg
15
PROGS-$(CONFIG_FFPLAY)   += ffplay
16
PROGS-$(CONFIG_FFSERVER) += ffserver
17

    
18
PROGS = $(addsuffix $(EXESUF), $(PROGS-yes))
19
PROGS_G = $(addsuffix _g$(EXESUF), $(PROGS-yes))
20
MANPAGES = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
21

    
22
BASENAMES=ffmpeg ffplay ffserver
23
ALLPROGS=$(addsuffix $(EXESUF), $(BASENAMES))
24
ALLPROGS_G=$(addsuffix _g$(EXESUF), $(BASENAMES))
25
ALLMANPAGES=$(addsuffix .1, $(BASENAMES))
26

    
27
ifeq ($(BUILD_SHARED),yes)
28
DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF)
29
else
30
DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
31
endif
32

    
33
ifeq ($(CONFIG_VHOOK),yes)
34
all: videohook
35
install: install-vhook
36
endif
37

    
38
ifeq ($(BUILD_DOC),yes)
39
all: documentation
40
install: install-man
41
endif
42

    
43
OBJS = ffmpeg.o ffserver.o cmdutils.o ffplay.o
44
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
45
LDFLAGS := -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil $(LDFLAGS)
46
EXTRALIBS := -lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)
47

    
48
ifeq ($(CONFIG_SWSCALER),yes)
49
LDFLAGS+=-L./libswscale
50
EXTRALIBS+=-lswscale$(BUILDSUF)
51
endif
52

    
53
all: lib $(PROGS)
54

    
55
lib:
56
	$(MAKE) -C libavutil   all
57
	$(MAKE) -C libavcodec  all
58
	$(MAKE) -C libavformat all
59
ifeq ($(CONFIG_PP),yes)
60
	$(MAKE) -C libpostproc all
61
endif
62
ifeq ($(CONFIG_SWSCALER),yes)
63
	$(MAKE) -C libswscale  all
64
endif
65

    
66
ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
67
	$(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(EXTRALIBS)
68

    
69
ffserver$(EXESUF): ffserver.o .libs
70
	$(CC) $(LDFLAGS) $(FFSERVERLDFLAGS) -o $@ ffserver.o $(EXTRALIBS)
71

    
72
ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
73
	$(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(EXTRALIBS) $(SDL_LIBS)
74

    
75
%$(EXESUF): %_g$(EXESUF)
76
	cp -p $< $@
77
	$(STRIP) $@
78

    
79
SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
80
ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
81
version.h: $(SVN_ENTRIES)
82
endif
83

    
84
version.h:
85
	$(SRC_PATH)/version.sh $(SRC_PATH)
86

    
87
output_example$(EXESUF): output_example.o .libs
88
	$(CC) $(LDFLAGS) -o $@ output_example.o $(EXTRALIBS)
89

    
90
qt-faststart$(EXESUF): qt-faststart.c
91
	$(CC) $(CFLAGS) $< -o $@
92

    
93
cws2fws$(EXESUF): cws2fws.c
94
	$(CC) $< -o $@ -lz
95

    
96
ffplay.o: ffplay.c
97
	$(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $<
98

    
99
ffmpeg.o ffplay.o ffserver.o: version.h
100

    
101
%.o: %.c
102
	$(CC) $(CFLAGS) -c -o $@ $<
103

    
104
videohook: .libs
105
	$(MAKE) -C vhook all
106

    
107
documentation:
108
	$(MAKE) -C doc all
109

    
110
install: install-progs install-libs install-headers
111

    
112
ifeq ($(BUILD_SHARED),yes)
113
install-progs: $(PROGS) install-libs
114
else
115
install-progs: $(PROGS)
116
endif
117
	install -d "$(bindir)"
118
	install -c -m 755 $(PROGS) "$(bindir)"
119

    
120
# Create the Windows installer.
121
wininstaller: all install
122
	makensis ffinstall.nsi
123

    
124
install-man:
125
	install -d "$(mandir)/man1"
126
	install -m 644 $(MANPAGES) "$(mandir)/man1"
127

    
128
install-vhook:
129
	$(MAKE) -C vhook install
130

    
131
install-libs:
132
	$(MAKE) -C libavutil   install-libs
133
	$(MAKE) -C libavcodec  install-libs
134
	$(MAKE) -C libavformat install-libs
135
ifeq ($(CONFIG_PP),yes)
136
	$(MAKE) -C libpostproc install-libs
137
endif
138
ifeq ($(CONFIG_SWSCALER),yes)
139
	$(MAKE) -C libswscale  install-libs
140
endif
141

    
142
ifeq ($(BUILD_SHARED),yes)
143
	-$(LDCONFIG)
144
endif
145

    
146
install-headers:
147
	$(MAKE) -C libavutil   install-headers
148
	$(MAKE) -C libavcodec  install-headers
149
	$(MAKE) -C libavformat install-headers
150
ifeq ($(CONFIG_PP),yes)
151
	$(MAKE) -C libpostproc install-headers
152
endif
153
	$(MAKE) -C libswscale  install-headers
154

    
155
uninstall: uninstall-progs uninstall-libs uninstall-headers uninstall-man uninstall-vhook
156

    
157
uninstall-progs:
158
	rm -f $(addprefix $(bindir)/, $(ALLPROGS))
159

    
160
uninstall-man:
161
	rm -f $(addprefix $(mandir)/man1/,$(ALLMANPAGES))
162

    
163
uninstall-vhook:
164
	$(MAKE) -C vhook uninstall
165

    
166
uninstall-libs:
167
	$(MAKE) -C libavutil   uninstall-libs
168
	$(MAKE) -C libavcodec  uninstall-libs
169
	$(MAKE) -C libavformat uninstall-libs
170
	$(MAKE) -C libpostproc uninstall-libs
171

    
172
uninstall-headers:
173
	$(MAKE) -C libavutil   uninstall-headers
174
	$(MAKE) -C libavcodec  uninstall-headers
175
	$(MAKE) -C libavformat uninstall-headers
176
	$(MAKE) -C libpostproc uninstall-headers
177
	-rmdir "$(incdir)"
178
	-rmdir "$(prefix)/include/postproc"
179

    
180
depend dep: .depend
181
	$(MAKE) -C libavutil   depend
182
	$(MAKE) -C libavcodec  depend
183
	$(MAKE) -C libavformat depend
184
ifeq ($(CONFIG_PP),yes)
185
	$(MAKE) -C libpostproc depend
186
endif
187
ifeq ($(CONFIG_SWSCALER),yes)
188
	$(MAKE) -C libswscale  depend
189
endif
190
ifeq ($(CONFIG_VHOOK),yes)
191
	$(MAKE) -C vhook       depend
192
endif
193

    
194
.depend: $(SRCS) version.h
195
	$(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $(filter-out %.h,$^) 1>.depend
196

    
197
$(DEP_LIBS): lib
198

    
199
.libs: $(DEP_LIBS)
200
	touch $@
201

    
202
clean:
203
	$(MAKE) -C libavutil   clean
204
	$(MAKE) -C libavcodec  clean
205
	$(MAKE) -C libavformat clean
206
	$(MAKE) -C libpostproc clean
207
	$(MAKE) -C libswscale  clean
208
	$(MAKE) -C tests       clean
209
	$(MAKE) -C vhook       clean
210
	$(MAKE) -C doc         clean
211
	rm -f *.o *.d *~ .libs gmon.out TAGS $(ALLPROGS) $(ALLPROGS_G) \
212
	   output_example$(EXESUF) qt-faststart$(EXESUF) cws2fws$(EXESUF)
213

    
214
distclean: clean
215
	$(MAKE) -C libavutil   distclean
216
	$(MAKE) -C libavcodec  distclean
217
	$(MAKE) -C libavformat distclean
218
	$(MAKE) -C libpostproc distclean
219
	$(MAKE) -C libswscale  distclean
220
	$(MAKE) -C tests       distclean
221
	$(MAKE) -C vhook       distclean
222
	rm -f .depend version.h config.* *.pc
223

    
224
TAGS:
225
	etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
226

    
227
# regression tests
228

    
229
codectest libavtest test-server fulltest test mpeg4 mpeg: $(PROGS)
230
	$(MAKE) -C tests $@
231

    
232
.PHONY: all lib videohook documentation install* wininstaller uninstall*
233
.PHONY: dep depend clean distclean TAGS
234
.PHONY: codectest libavtest test-server fulltest test mpeg4 mpeg
235

    
236
-include .depend