doc/examples: add -O2 in CFLAGS.
[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 -O2
10 CFLAGS += $(shell pkg-config --cflags $(FFMPEG_LIBS))
11 LDLIBS += $(shell pkg-config --libs $(FFMPEG_LIBS))
12
13 EXAMPLES=       decoding_encoding                  \
14                 filtering_video                    \
15                 filtering_audio                    \
16                 metadata                           \
17                 muxing                             \
18
19 OBJS=$(addsuffix .o,$(EXAMPLES))
20
21 # the following examples make explicit use of the math library
22 decoding_encoding: LDLIBS += -lm
23 muxing:            LDLIBS += -lm
24
25 %: %.o
26         $(CC) $< $(LDLIBS) -o $@
27
28 %.o: %.c
29         $(CC) $< $(CFLAGS) -c -o $@
30
31 .phony: all clean
32
33 all: $(OBJS) $(EXAMPLES)
34
35 clean:
36         rm -rf $(EXAMPLES) $(OBJS)