Statistics
| Branch: | Revision:

ffmpeg / Makefile @ bbec50d7

History | View | Annotate | Download (4.23 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
OBJS = ffmpeg.o ffserver.o cmdutils.o ffplay.o
74
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
75
FFLIBS = -L./libavformat -lavformat -L./libavcodec -lavcodec
76

    
77
all: lib $(PROG) $(PROGTEST) $(VHOOK) $(QTFASTSTART)
78

    
79
lib:
80
	$(MAKE) -C libavcodec all
81
	$(MAKE) -C libavformat all
82

    
83
ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
84
	$(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(FFLIBS) $(EXTRALIBS)
85

    
86
ffmpeg$(EXESUF): ffmpeg_g$(EXESUF)
87
	cp -p $< $@
88
	$(STRIP) $@
89

    
90
ffserver$(EXESUF): ffserver.o .libs
91
	$(CC) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS) 
92

    
93
ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
94
	$(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(FFLIBS) $(EXTRALIBS) $(SDL_LIBS)
95

    
96
ffplay$(EXESUF): ffplay_g$(EXESUF)
97
	cp -p $< $@
98
	$(STRIP) $@
99

    
100
output_example$(EXESUF): output_example.o .libs
101
	$(CC) $(LDFLAGS) -o $@ output_example.o $(FFLIBS) $(EXTRALIBS)
102

    
103
qt-faststart$(EXESUF): qt-faststart.c
104
	$(CC) qt-faststart.c -o qt-faststart$(EXESUF)
105

    
106
ffplay.o: ffplay.c
107
	$(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $< 
108

    
109
%.o: %.c
110
	$(CC) $(CFLAGS) -c -o $@ $< 
111

    
112
videohook: .libs
113
	$(MAKE) -C vhook all
114

    
115
.PHONY: install
116

    
117
install: all install-man $(INSTALLVHOOK)
118
	$(MAKE) -C libavcodec install
119
	$(MAKE) -C libavformat install
120
	install -d "$(bindir)"
121
	install -c -s -m 755 $(PROG) "$(bindir)"
122

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

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

    
136
install-vhook: $(prefix)/lib/vhook
137
	$(MAKE) -C vhook install INSTDIR=$(prefix)/lib/vhook
138

    
139
$(prefix)/lib/vhook:
140
	install -d $@
141

    
142
installlib:
143
	$(MAKE) -C libavcodec installlib
144
	$(MAKE) -C libavformat installlib
145

    
146
dep:	depend
147

    
148
depend: .depend
149
	make -C libavcodec depend
150
	make -C libavformat depend
151
ifeq ($(BUILD_VHOOK),yes)
152
	make -C vhook depend
153
endif
154

    
155
.depend: $(SRCS)
156
	$(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $^ 1>.depend
157

    
158
.libs: lib
159
	@test -f .libs || touch .libs
160
	@for i in $(DEP_LIBS) ; do if $(TEST) $$i -nt .libs ; then touch .libs; fi ; done
161

    
162
clean: $(CLEANVHOOK)
163
	$(MAKE) -C libavcodec clean
164
	$(MAKE) -C libavformat clean
165
	$(MAKE) -C tests clean
166
	rm -f *.o *.d *~ .libs .depend gmon.out TAGS ffmpeg_g$(EXESUF) ffplay_g$(EXESUF) $(PROG) $(PROGTEST)
167

    
168
clean-vhook:
169
	$(MAKE) -C vhook clean
170

    
171
distclean: clean
172
	$(MAKE) -C libavcodec distclean
173
	rm -f config.mak config.h
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