X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmodules%2Favformat%2FMakefile;h=14ecbb84235da5c05d7e432bdcca343c542740de;hb=cb67f739b1ccfc555566ed1aa23226303e1a5ea4;hp=aba87afffb7462ac2939eaf13de7c47c13e243ed;hpb=8cf0f77981284b7549c811b67283eb73d0c520d6;p=mlt diff --git a/src/modules/avformat/Makefile b/src/modules/avformat/Makefile index aba87aff..14ecbb84 100644 --- a/src/modules/avformat/Makefile +++ b/src/modules/avformat/Makefile @@ -1,42 +1,79 @@ +CFLAGS += -I../.. +LDFLAGS += -L../../framework -lmlt -lpthread + include ../../../config.mak include config.mak -TARGET = ../libmltavformat.so +LDFLAGS += -lavformat$(AVFORMAT_SUFFIX) +LDFLAGS += -lavcodec$(AVFORMAT_SUFFIX) +LDFLAGS += -lavutil$(AVFORMAT_SUFFIX) +LDFLAGS += $(EXTRA_LIBS) -OBJS = factory.o \ - producer_avformat.o \ - consumer_avformat.o \ - filter_avcolour_space.o \ - filter_avdeinterlace.o \ - filter_avresample.o +ifndef CODECS +TARGET = ../libmltffmpeg$(LIBSUF) +else +TARGET = ../libmltavformat$(LIBSUF) +endif -CFLAGS+=-I../.. +OBJS = factory.o -LDFLAGS+=-lavformat -lavcodec $(EXTRA_LIBS) -LDFLAGS+=-L../../framework -lmlt +ifdef FILTERS +OBJS += filter_avcolour_space.o \ + filter_avresample.o \ + filter_avdeinterlace.o +ifdef SWSCALE +OBJS += filter_swscale.o +endif +CFLAGS += -DFILTERS +endif + +ifdef VDPAU +CFLAGS += -DVDPAU `pkg-config --cflags x11` +LDFLAGS += $(LIBDL) `pkg-config --libs x11` +endif + +ifdef CODECS +OBJS += producer_avformat.o \ + consumer_avformat.o +CFLAGS += -DCODECS +endif + +ifdef SWSCALE +CFLAGS += -DSWSCALE +LDFLAGS += -lswscale$(AVFORMAT_SUFFIX) +endif + +ifdef DEVICES +CFLAGS += -DAVDEVICE +LDFLAGS += -lavdevice$(AVFORMAT_SUFFIX) +endif SRCS := $(OBJS:.o=.c) all: $(TARGET) $(TARGET): $(OBJS) - if [ $(LOCAL_FFMPEG) ] ; then $(MAKE) -C ffmpeg all ; fi - $(CC) -shared -o $@ $(OBJS) $(LDFLAGS) + $(CC) $(SHFLAGS) -o $@ $(OBJS) $(LDFLAGS) depend: $(SRCS) - if [ $(LOCAL_FFMPEG) ] ; then $(MAKE) -C ffmpeg dep ; fi - $(CC) -MM $(CFLAGS) $^ 1>.depend + $(CC) -MM $(CFLAGS) $^ 1>.depend -dist-clean: clean - if [ $(LOCAL_FFMPEG) ] ; then $(MAKE) -C ffmpeg dist-clean ; fi - rm -f .depend +distclean: clean + rm -f .depend clean: - if [ $(LOCAL_FFMPEG) ] ; then $(MAKE) -C ffmpeg clean ; fi - rm -f $(OBJS) $(TARGET) + rm -f $(OBJS) ../libmltffmpeg$(LIBSUF) ../libmltavformat$(LIBSUF) install: all - install -m 755 $(TARGET) "$(prefix)/share/mlt/modules" + install -m 755 $(TARGET) "$(DESTDIR)$(libdir)/mlt" + install -d "$(DESTDIR)$(datadir)/mlt/avformat" + install -m 644 producer_avformat.yml "$(DESTDIR)$(datadir)/mlt/avformat" + install -m 644 consumer_avformat.yml "$(DESTDIR)$(datadir)/mlt/avformat" + +uninstall: + rm "$(DESTDIR)$(libdir)/mlt/libmltavformat$(LIBSUF)" 2> /dev/null || true + rm "$(DESTDIR)$(libdir)/mlt/libmltffmpeg$(LIBSUF)" 2> /dev/null || true + rm -rf "$(DESTDIR)$(datadir)/mlt/avformat" ifneq ($(wildcard .depend),) include .depend