use pkg-config for getting CFLAGS and LDLIBS

May 5, 2015 · View on GitHub

FFMPEG_LIBS= libavdevice
libavformat
libavfilter
libavcodec
libswresample
libswscale
libavutil \

CFLAGS += -Wall -g CFLAGS := (shellpkgconfigcflags(shell pkg-config --cflags (FFMPEG_LIBS)) (CFLAGS)LDLIBS:=(CFLAGS) LDLIBS := (shell pkg-config --libs (FFMPEGLIBS))(FFMPEG_LIBS)) (LDLIBS)

EXAMPLES= vq

OBJS=(addsuffix.o,(addsuffix .o,(EXAMPLES))

the following examples make explicit use of the math library

avcodec: LDLIBS += -lm decoding_encoding: LDLIBS += -lm muxing: LDLIBS += -lm resampling_audio: LDLIBS += -lm

.phony: all clean-test clean

all: (OBJS)(OBJS) (EXAMPLES)

clean-test: $(RM) test*.pgm test.h264 test.mp2 test.sw test.mpg

clean: clean-test (RM)(RM) (EXAMPLES) $(OBJS)