2012-05-12 16:08:26 +00:00
|
|
|
# use pkg-config for getting CFLAGS and LDLIBS
|
2012-05-08 16:22:28 +00:00
|
|
|
FFMPEG_LIBS= libavdevice \
|
|
|
|
libavformat \
|
|
|
|
libavfilter \
|
|
|
|
libavcodec \
|
|
|
|
libswscale \
|
|
|
|
libavutil \
|
|
|
|
|
2012-05-09 21:08:17 +00:00
|
|
|
CFLAGS += -Wall -O2
|
|
|
|
CFLAGS += $(shell pkg-config --cflags $(FFMPEG_LIBS))
|
|
|
|
LDLIBS += $(shell pkg-config --libs $(FFMPEG_LIBS))
|
2011-05-29 10:47:40 +00:00
|
|
|
|
2012-05-08 16:22:28 +00:00
|
|
|
EXAMPLES= decoding_encoding \
|
|
|
|
filtering_video \
|
|
|
|
filtering_audio \
|
|
|
|
metadata \
|
|
|
|
muxing \
|
2011-05-29 10:47:40 +00:00
|
|
|
|
|
|
|
OBJS=$(addsuffix .o,$(EXAMPLES))
|
|
|
|
|
2012-05-09 21:06:43 +00:00
|
|
|
# the following examples make explicit use of the math library
|
|
|
|
decoding_encoding: LDLIBS += -lm
|
|
|
|
muxing: LDLIBS += -lm
|
|
|
|
|
2011-05-29 10:47:40 +00:00
|
|
|
%: %.o
|
2012-05-09 21:05:12 +00:00
|
|
|
$(CC) $< $(LDLIBS) -o $@
|
2011-05-29 10:47:40 +00:00
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $< $(CFLAGS) -c -o $@
|
|
|
|
|
|
|
|
.phony: all clean
|
|
|
|
|
|
|
|
all: $(OBJS) $(EXAMPLES)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(EXAMPLES) $(OBJS)
|