Statistics
| Branch: | Revision:

ffmpeg / Makefile @ 445ad18d

History | View | Annotate | Download (3.14 KB)

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

    
7
VPATH=$(SRC_PATH)
8

    
9
CFLAGS= $(OPTFLAGS) -Wall -g -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
ifeq ($(CONFIG_WIN32),yes)
18
EXE=.exe
19
PROG=ffmpeg$(EXE)
20
else
21
ifeq ($(CONFIG_OS2),yes)
22
EXE=.exe
23
PROG=ffmpeg$(EXE)
24
else
25
EXE=
26
PROG=ffmpeg ffplay
27
ifeq ($(CONFIG_FFSERVER),yes)
28
PROG+=ffserver
29
endif
30
endif
31
endif
32

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

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

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

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

    
58
ifeq ($(BUILD_VHOOK),yes)
59
VHOOK=videohook
60
INSTALLVHOOK=install-vhook
61
CLEANVHOOK=clean-vhook
62
endif
63

    
64
ifeq ($(TARGET_OS), SunOS)
65
TEST=/usr/bin/test
66
else
67
TEST=test
68
endif
69

    
70
OBJS = ffmpeg.o ffserver.o
71
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
72
FFLIBS = -L./libavformat -lavformat -L./libavcodec -lavcodec
73

    
74
all: lib $(PROG) $(VHOOK)
75

    
76
lib:
77
	$(MAKE) -C libavcodec all
78
	$(MAKE) -C libavformat all
79

    
80
ffmpeg_g$(EXE): ffmpeg.o .libs
81
	$(CC) $(LDFLAGS) -o $@ ffmpeg.o $(FFLIBS) $(EXTRALIBS)
82

    
83
ffmpeg$(EXE): ffmpeg_g$(EXE)
84
	cp -p $< $@
85
	$(STRIP) $@
86

    
87
ffserver$(EXE): ffserver.o .libs
88
	$(CC) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS) 
89

    
90
ffplay: ffmpeg$(EXE)
91
	ln -sf $< $@
92

    
93
%.o: %.c
94
	$(CC) $(CFLAGS) -c -o $@ $< 
95

    
96
videohook: .libs
97
	$(MAKE) -C vhook all
98

    
99
install: all $(INSTALLVHOOK)
100
	$(MAKE) -C libavcodec install
101
	install -d $(prefix)/bin
102
	install -c -s -m 755 $(PROG) $(prefix)/bin
103
	ln -sf ffmpeg $(prefix)/bin/ffplay 
104

    
105
install-vhook: $(prefix)/lib/vhook
106
	$(MAKE) -C vhook install INSTDIR=$(prefix)/lib/vhook
107

    
108
$(prefix)/lib/vhook:
109
	install -d $@
110

    
111
installlib:
112
	$(MAKE) -C libavcodec installlib
113
	$(MAKE) -C libavformat installlib
114

    
115
dep:	depend
116

    
117
depend: .depend
118
	make -C libavcodec depend
119
	make -C libavformat depend
120
ifeq ($(BUILD_VHOOK),yes)
121
	make -C vhook depend
122
endif
123

    
124
.depend: $(SRCS)
125
	$(CC) -MM $(CFLAGS) $^ 1>.depend
126

    
127
.libs: lib
128
	@test -f .libs || touch .libs
129
	@for i in $(DEP_LIBS) ; do if $(TEST) $$i -nt .libs ; then touch .libs; fi ; done
130

    
131
clean: $(CLEANVHOOK)
132
	$(MAKE) -C libavcodec clean
133
	$(MAKE) -C libavformat clean
134
	$(MAKE) -C tests clean
135
	rm -f *.o *.d *~ .libs .depend gmon.out TAGS ffmpeg_g$(EXE) $(PROG) 
136

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

    
140
distclean: clean
141
	$(MAKE) -C libavcodec distclean
142
	rm -f config.mak config.h
143

    
144
TAGS:
145
	etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
146

    
147
# regression tests
148

    
149
libavtest test mpeg4 mpeg: ffmpeg$(EXE)
150
	$(MAKE) all -C tests $@
151

    
152
# tar release (use 'make -k tar' on a checkouted tree)
153
FILE=ffmpeg-$(shell cat VERSION)
154

    
155
tar:
156
	rm -rf /tmp/$(FILE)
157
	cp -r . /tmp/$(FILE)
158
	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
159
	rm -rf /tmp/$(FILE)
160

    
161
.PHONY: lib
162

    
163
ifneq ($(wildcard .depend),)
164
include .depend
165
endif