Statistics
| Branch: | Revision:

ffmpeg / Makefile @ 146ea952

History | View | Annotate | Download (4.32 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)/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=$(SRC_PATH)/doc/ffmpeg.1
18
PROG=ffmpeg$(EXESUF)
19
PROGTEST=output_example$(EXESUF)
20
QTFASTSTART=qt-faststart$(EXESUF)
21

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

    
27
ifeq ($(CONFIG_FFPLAY),yes)
28
MANPAGE+=$(SRC_PATH)/doc/ffplay.1
29
PROG+=ffplay$(EXESUF)
30
endif
31

    
32
ifeq ($(CONFIG_AUDIO_BEOS),yes)
33
EXTRALIBS+=-lmedia -lbe
34
endif
35

    
36
ifeq ($(BUILD_SHARED),yes)
37
DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF)
38
else
39
DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
40
ifeq ($(CONFIG_MP3LAME),yes)
41
EXTRALIBS+=-lmp3lame
42
endif
43
endif
44

    
45
ifeq ($(CONFIG_VORBIS),yes)
46
EXTRALIBS+=-logg -lvorbis -lvorbisenc
47
endif
48

    
49
ifeq ($(CONFIG_FAAD),yes)
50
ifeq ($(CONFIG_FAADBIN),yes)
51
# no libs needed
52
else
53
EXTRALIBS += -lfaad
54
endif
55
endif
56

    
57
ifeq ($(CONFIG_FAAC),yes)
58
EXTRALIBS+=-lfaac
59
endif
60

    
61
ifeq ($(BUILD_VHOOK),yes)
62
VHOOK=videohook
63
INSTALLVHOOK=install-vhook
64
CLEANVHOOK=clean-vhook
65
endif
66

    
67
ifeq ($(TARGET_OS), SunOS)
68
TEST=/usr/bin/test
69
else
70
TEST=test
71
endif
72

    
73
ifeq ($(BUILD_DOC),yes)
74
DOC=documentation
75
endif
76

    
77
OBJS = ffmpeg.o ffserver.o cmdutils.o ffplay.o
78
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
79
FFLIBS = -L./libavformat -lavformat -L./libavcodec -lavcodec
80

    
81
all: lib $(PROG) $(PROGTEST) $(VHOOK) $(QTFASTSTART) $(DOC)
82

    
83
lib:
84
	$(MAKE) -C libavcodec all
85
	$(MAKE) -C libavformat all
86

    
87
ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
88
	$(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(FFLIBS) $(EXTRALIBS)
89

    
90
ffmpeg$(EXESUF): ffmpeg_g$(EXESUF)
91
	cp -p $< $@
92
	$(STRIP) $@
93

    
94
ffserver$(EXESUF): ffserver.o .libs
95
	$(CC) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS) 
96

    
97
ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
98
	$(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(FFLIBS) $(EXTRALIBS) $(SDL_LIBS)
99

    
100
ffplay$(EXESUF): ffplay_g$(EXESUF)
101
	cp -p $< $@
102
	$(STRIP) $@
103

    
104
output_example$(EXESUF): output_example.o .libs
105
	$(CC) $(LDFLAGS) -o $@ output_example.o $(FFLIBS) $(EXTRALIBS)
106

    
107
qt-faststart$(EXESUF): qt-faststart.c
108
	$(CC) qt-faststart.c -o qt-faststart$(EXESUF)
109

    
110
ffplay.o: ffplay.c
111
	$(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $< 
112

    
113
%.o: %.c
114
	$(CC) $(CFLAGS) -c -o $@ $< 
115

    
116
videohook: .libs
117
	$(MAKE) -C vhook all
118

    
119
documentation:
120
	$(MAKE) -C doc all
121

    
122
.PHONY: install
123

    
124
install: all install-man $(INSTALLVHOOK)
125
	$(MAKE) -C libavcodec install
126
	$(MAKE) -C libavformat install
127
	install -d "$(bindir)"
128
	install -c -s -m 755 $(PROG) "$(bindir)"
129

    
130
# create the window installer
131
wininstaller: all install
132
	makensis ffinstall.nsi
133

    
134
# install man from source dir if available
135
install-man:
136
ifneq ($(CONFIG_WIN32),yes)
137
	if [ -f $(SRC_PATH)/doc/ffmpeg.1 ] ; then \
138
	    install -d $(mandir)/man1 ; \
139
	    install -m 644 $(MANPAGE) $(mandir)/man1 ; \
140
	fi
141
endif
142

    
143
install-vhook: $(prefix)/lib/vhook
144
	$(MAKE) -C vhook install INSTDIR=$(prefix)/lib/vhook
145

    
146
$(prefix)/lib/vhook:
147
	install -d $@
148

    
149
installlib:
150
	$(MAKE) -C libavcodec installlib
151
	$(MAKE) -C libavformat installlib
152

    
153
dep:	depend
154

    
155
depend: .depend
156
	make -C libavcodec depend
157
	make -C libavformat depend
158
ifeq ($(BUILD_VHOOK),yes)
159
	make -C vhook depend
160
endif
161

    
162
.depend: $(SRCS)
163
	$(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $^ 1>.depend
164

    
165
.libs: lib
166
	@test -f .libs || touch .libs
167
	@for i in $(DEP_LIBS) ; do if $(TEST) $$i -nt .libs ; then touch .libs; fi ; done
168

    
169
clean: $(CLEANVHOOK)
170
	$(MAKE) -C libavcodec clean
171
	$(MAKE) -C libavformat clean
172
	$(MAKE) -C tests clean
173
	rm -f *.o *.d *~ .libs .depend gmon.out TAGS ffmpeg_g$(EXESUF) ffplay_g$(EXESUF) $(PROG) $(PROGTEST)
174

    
175
clean-vhook:
176
	$(MAKE) -C vhook clean
177

    
178
distclean: clean
179
	$(MAKE) -C libavcodec distclean
180
	rm -f config.mak config.h
181

    
182
TAGS:
183
	etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
184

    
185
# regression tests
186

    
187
libavtest test mpeg4 mpeg test-server fulltest: ffmpeg$(EXESUF)
188
	$(MAKE) -C tests $@
189

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

    
194
tar:
195
	rm -rf /tmp/$(FILE)
196
	cp -r . /tmp/$(FILE)
197
	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
198
	rm -rf /tmp/$(FILE)
199

    
200
.PHONY: lib
201

    
202
ifneq ($(wildcard .depend),)
203
include .depend
204
endif