Statistics
| Branch: | Revision:

ffmpeg / Makefile @ ea937d01

History | View | Annotate | Download (2.79 KB)

1 a1b63811 Fabrice Bellard
#
2 85f07f22 Fabrice Bellard
# Main ffmpeg Makefile
3 a1b63811 Fabrice Bellard
# (c) 2000, 2001, 2002 Fabrice Bellard
4 85f07f22 Fabrice Bellard
#
5 980fc7b8 Fabrice Bellard
include config.mak
6 85f07f22 Fabrice Bellard
7 dd9ca370 Fabrice Bellard
VPATH=$(SRC_PATH)
8
9 abac6175 Fabrice Bellard
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 4baca069 Philip Gladstone
LDFLAGS+= -g 
11 37736979 Fabrice Bellard
12 980fc7b8 Fabrice Bellard
ifeq ($(TARGET_GPROF),yes)
13 85f07f22 Fabrice Bellard
CFLAGS+=-p
14
LDFLAGS+=-p
15
endif
16
17 daf8e955 Fabrice Bellard
ifeq ($(CONFIG_WIN32),yes)
18
EXE=.exe
19
PROG=ffmpeg$(EXE)
20
else
21 f3ec2d46 Slavik Gnatenko
ifeq ($(CONFIG_OS2),yes)
22
EXE=.exe
23
PROG=ffmpeg$(EXE)
24
else
25
EXE=
26 8154d2e0 Fabrice Bellard
PROG=ffmpeg ffplay
27
ifeq ($(CONFIG_FFSERVER),yes)
28
PROG+=ffserver
29
endif
30 daf8e955 Fabrice Bellard
endif
31 f3ec2d46 Slavik Gnatenko
endif
32 85f07f22 Fabrice Bellard
33 dfdfa47c Fran├žois Revol
ifeq ($(CONFIG_AUDIO_BEOS),yes)
34
EXTRALIBS+=-lmedia -lbe
35
endif
36 a1b63811 Fabrice Bellard
37 0fd94442 Nick Kurshev
ifeq ($(BUILD_SHARED),yes)
38 f3ec2d46 Slavik Gnatenko
DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
39 0fd94442 Nick Kurshev
else
40 f3ec2d46 Slavik Gnatenko
DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
41 a6741398 Juanjo
ifeq ($(CONFIG_MP3LAME),yes)
42
EXTRALIBS+=-lmp3lame
43
endif
44 81e0d0b4 Mark Hills
ifeq ($(CONFIG_VORBIS),yes)
45
EXTRALIBS+=-logg -lvorbis -lvorbisenc
46
endif
47 0fd94442 Nick Kurshev
endif
48
49 142fc6b9 Philip Gladstone
ifeq ($(BUILD_VHOOK),yes)
50
VHOOK=videohook
51
INSTALLVHOOK=install-vhook
52
CLEANVHOOK=clean-vhook
53 47930f09 Philip Gladstone
endif
54 142fc6b9 Philip Gladstone
55 57514323 Zdenek Kabelac
OBJS = ffmpeg.o ffserver.o
56
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
57
58 142fc6b9 Philip Gladstone
all: lib $(PROG) $(VHOOK)
59 85f07f22 Fabrice Bellard
60
lib:
61 2cc8ae96 Fabrice Bellard
	$(MAKE) -C libavcodec all
62 abac6175 Fabrice Bellard
	$(MAKE) -C libavformat all
63 85f07f22 Fabrice Bellard
64 4b8b2edb Fabrice Bellard
ffmpeg_g$(EXE): .depend ffmpeg.o $(DEP_LIBS)
65 abac6175 Fabrice Bellard
	$(CC) $(LDFLAGS) -o $@ ffmpeg.o -L./libavcodec -L./libavformat \
66 a1b63811 Fabrice Bellard
              -lavformat -lavcodec $(EXTRALIBS)
67 85f07f22 Fabrice Bellard
68 37736979 Fabrice Bellard
ffmpeg$(EXE): ffmpeg_g$(EXE)
69 f3ec2d46 Slavik Gnatenko
	cp -p $< $@
70
	$(STRIP) $@
71 37736979 Fabrice Bellard
72 a1b63811 Fabrice Bellard
ffserver$(EXE): ffserver.o $(DEP_LIBS)
73 a43bd1d7 Heliodoro Tammaro
	$(CC) $(LDFLAGS) $(FFSLDFLAGS) \
74 abac6175 Fabrice Bellard
		-o $@ ffserver.o -L./libavcodec -L./libavformat \
75 9c938e77 Philip Gladstone
              -lavformat -lavcodec $(EXTRALIBS) 
76 85f07f22 Fabrice Bellard
77 2744a37f Fabrice Bellard
ffplay: ffmpeg$(EXE)
78
	ln -sf $< $@
79
80 85f07f22 Fabrice Bellard
%.o: %.c
81 daf8e955 Fabrice Bellard
	$(CC) $(CFLAGS) -c -o $@ $< 
82 85f07f22 Fabrice Bellard
83 142fc6b9 Philip Gladstone
videohook:
84
	$(MAKE) -C vhook all
85
86
install: all $(INSTALLVHOOK)
87 0fd94442 Nick Kurshev
	$(MAKE) -C libavcodec install
88 c1325d18 Volker Moell
	install -d $(prefix)/bin
89 fbd8bb7e Steven M. Schultz
	install -c -s -m 755 $(PROG) $(prefix)/bin
90 2744a37f Fabrice Bellard
	ln -sf ffmpeg $(prefix)/bin/ffplay 
91 85f07f22 Fabrice Bellard
92 142fc6b9 Philip Gladstone
install-vhook: $(prefix)/lib/vhook
93
	$(MAKE) -C vhook install INSTDIR=$(prefix)/lib/vhook
94
95
$(prefix)/lib/vhook:
96 4baca069 Philip Gladstone
	install -d $@
97 142fc6b9 Philip Gladstone
98 37736979 Fabrice Bellard
installlib:
99
	$(MAKE) -C libavcodec installlib
100 abac6175 Fabrice Bellard
	$(MAKE) -C libavformat installlib
101 37736979 Fabrice Bellard
102 57514323 Zdenek Kabelac
dep:	depend
103
104 4b8b2edb Fabrice Bellard
depend: .depend
105
106
.depend: $(SRCS)
107
	$(CC) -MM $(CFLAGS) $^ 1>.depend
108 57514323 Zdenek Kabelac
109 142fc6b9 Philip Gladstone
clean: $(CLEANVHOOK)
110 2cc8ae96 Fabrice Bellard
	$(MAKE) -C libavcodec clean
111 abac6175 Fabrice Bellard
	$(MAKE) -C libavformat clean
112 dd9ca370 Fabrice Bellard
	$(MAKE) -C tests clean
113 77b71ddc Philip Gladstone
	rm -f *.o *.d *~ .depend gmon.out TAGS ffmpeg_g$(EXE) $(PROG) 
114 85f07f22 Fabrice Bellard
115 142fc6b9 Philip Gladstone
clean-vhook:
116
	$(MAKE) -C vhook clean
117
118 85f07f22 Fabrice Bellard
distclean: clean
119 c72c6d2d Fabrice Bellard
	$(MAKE) -C libavcodec distclean
120 980fc7b8 Fabrice Bellard
	rm -f config.mak config.h
121 85f07f22 Fabrice Bellard
122
TAGS:
123 abac6175 Fabrice Bellard
	etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
124 57514323 Zdenek Kabelac
125 dd9ca370 Fabrice Bellard
# regression tests
126
127 4c41db9a Fabrice Bellard
libavtest test mpeg4 mpeg: ffmpeg$(EXE)
128 9c938e77 Philip Gladstone
	$(MAKE) -C tests $@
129 dd9ca370 Fabrice Bellard
130 ac977341 Fabrice Bellard
# tar release (use 'make -k tar' on a checkouted tree)
131
FILE=ffmpeg-$(shell cat VERSION)
132
133
tar:
134
	rm -rf /tmp/$(FILE)
135
	cp -r . /tmp/$(FILE)
136
	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
137
	rm -rf /tmp/$(FILE)
138
139 57514323 Zdenek Kabelac
ifneq ($(wildcard .depend),)
140
include .depend
141
endif