9bb68ae894970a150ae54d761f98827dcff921d1
[ffmpeg.git] / doc / examples / Makefile
1 # use pkg-config for getting CFLAGS abd LDLIBS
2 FFMPEG_LIBS=    libavdevice                        \
3                 libavformat                        \
4                 libavfilter                        \
5                 libavcodec                         \
6                 libswscale                         \
7                 libavutil                          \
8
9 CFLAGS+=-Wall $(shell pkg-config  --cflags $(FFMPEG_LIBS))
10 LDLIBS+=$(shell pkg-config --libs $(FFMPEG_LIBS))
11
12 EXAMPLES=       decoding_encoding                  \
13                 filtering_video                    \
14                 filtering_audio                    \
15                 metadata                           \
16                 muxing                             \
17
18 OBJS=$(addsuffix .o,$(EXAMPLES))
19
20 # the following examples make explicit use of the math library
21 decoding_encoding: LDLIBS += -lm
22 muxing:            LDLIBS += -lm
23
24 %: %.o
25         $(CC) $< $(LDLIBS) -o $@
26
27 %.o: %.c
28         $(CC) $< $(CFLAGS) -c -o $@
29
30 .phony: all clean
31
32 all: $(OBJS) $(EXAMPLES)
33
34 clean:
35         rm -rf $(EXAMPLES) $(OBJS)