Statistics
| Branch: | Revision:

ffmpeg / Makefile @ 1eb17b3c

History | View | Annotate | Download (4.45 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

    
71
ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
72
	$(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(FFLIBS) $(EXTRALIBS)
73

    
74
ffmpeg$(EXESUF): ffmpeg_g$(EXESUF)
75
	cp -p $< $@
76
	$(STRIP) $@
77

    
78
ffserver$(EXESUF): ffserver.o .libs
79
	$(CC) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS)
80

    
81
ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
82
	$(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(FFLIBS) $(EXTRALIBS) $(SDL_LIBS)
83

    
84
ffplay$(EXESUF): ffplay_g$(EXESUF)
85
	cp -p $< $@
86
	$(STRIP) $@
87

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

    
91
qt-faststart$(EXESUF): qt-faststart.c
92
	$(CC) $(SRC_PATH)/qt-faststart.c -o qt-faststart$(EXESUF)
93

    
94
cws2fws$(EXESUF): cws2fws.c
95
	$(CC) $(SRC_PATH)/cws2fws.c -o cws2fws$(EXESUF) -lz
96

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

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

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

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

    
109
.PHONY: install
110

    
111
install: all install-progs install-man $(INSTALLVHOOK)
112
	$(MAKE) -C libavutil install
113
	$(MAKE) -C libavcodec install
114
	$(MAKE) -C libavformat install
115

    
116
install-progs: $(PROG)
117
	install -d "$(bindir)"
118
	install -c $(INSTALLSTRIP) -m 755 $(PROG) "$(bindir)"
119

    
120
# create the window installer
121
wininstaller: all install
122
	makensis ffinstall.nsi
123

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

    
133
install-vhook:
134
	$(MAKE) -C vhook install
135

    
136
installlib:
137
	$(MAKE) -C libavutil installlib
138
	$(MAKE) -C libavcodec installlib
139
	$(MAKE) -C libavformat installlib
140

    
141
dep:	depend
142

    
143
depend: .depend
144
	$(MAKE) -C libavcodec depend
145
	$(MAKE) -C libavformat depend
146
ifeq ($(BUILD_VHOOK),yes)
147
	$(MAKE) -C vhook depend
148
endif
149

    
150
.depend: $(SRCS)
151
	$(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $^ 1>.depend
152

    
153
.libs: lib
154
	@test -f .libs || touch .libs
155
	@for i in $(DEP_LIBS) ; do if $(TEST) $$i -nt .libs ; then touch .libs; fi ; done
156

    
157
clean:
158
	$(MAKE) -C libavutil clean
159
	$(MAKE) -C libavcodec clean
160
	$(MAKE) -C libavformat clean
161
	$(MAKE) -C tests clean
162
	$(MAKE) -C vhook clean
163
	rm -f *.o *.d *~ .libs gmon.out TAGS \
164
	   $(PROG) $(PROG_G) $(PROGTEST) $(QTFASTSTART)
165

    
166
# Note well: config.log is NOT removed.
167
distclean: clean
168
	$(MAKE) -C libavutil   distclean
169
	$(MAKE) -C libavcodec  distclean
170
	$(MAKE) -C libavformat distclean
171
	$(MAKE) -C tests       distclean
172
	$(MAKE) -C vhook       distclean
173
	rm -f .depend config.mak config.h *.pc
174

    
175
TAGS:
176
	etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
177

    
178
# regression tests
179

    
180
libavtest test mpeg4 mpeg test-server fulltest: ffmpeg$(EXESUF)
181
	$(MAKE) -C tests $@
182

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

    
187
tar:
188
	rm -rf /tmp/$(FILE)
189
	cp -r . /tmp/$(FILE)
190
	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
191
	rm -rf /tmp/$(FILE)
192

    
193
.PHONY: lib
194

    
195
ifneq ($(wildcard .depend),)
196
include .depend
197
endif