]> git.sesse.net Git - mlt/blobdiff - src/modules/avformat/Makefile
Fix setting muxer-specific options (SF-197).
[mlt] / src / modules / avformat / Makefile
index 5ca36627a01aa72e714b0fb0a4d30dba59f467c8..0d26b04b8aeaa6d4bd34de3931340ad12eb155bb 100644 (file)
@@ -1,33 +1,73 @@
+CFLAGS += -I../..
+LDFLAGS += -L../../framework -lmlt -lpthread
+
 include ../../../config.mak
+include config.mak
+
+LDFLAGS += -lavformat$(AVFORMAT_SUFFIX)
+LDFLAGS += -lavcodec$(AVFORMAT_SUFFIX)
+LDFLAGS += -lavutil$(AVFORMAT_SUFFIX)
+LDFLAGS += -lswscale$(AVFORMAT_SUFFIX)
+LDFLAGS += $(EXTRA_LIBS)
 
-TARGET = ../libmltavformat.so
+ifndef CODECS
+TARGET = ../libmltffmpeg$(LIBSUF)
+else
+TARGET = ../libmltavformat$(LIBSUF)
+endif
 
-OBJS = factory.o \
-          producer_avformat.o \
-          consumer_avformat.o
+OBJS = factory.o
 
-CFLAGS += -I../..
+ifdef FILTERS
+OBJS += filter_avcolour_space.o \
+           filter_avresample.o \
+           filter_avdeinterlace.o \
+           filter_swscale.o
+CFLAGS += -DFILTERS
+endif
 
-LDFLAGS = -lavformat -lavcodec
+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 DEVICES
+CFLAGS += -DAVDEVICE
+LDFLAGS += -lavdevice$(AVFORMAT_SUFFIX)
+endif
 
 SRCS := $(OBJS:.o=.c)
 
 all:   $(TARGET)
 
 $(TARGET): $(OBJS)
-               $(CC) -shared -o $@ $(OBJS) $(LDFLAGS)
+       $(CC) $(SHFLAGS) -o $@ $(OBJS) $(LDFLAGS)
 
 depend:        $(SRCS)
-               $(CC) -MM $(CFLAGS) $^ 1>.depend
+       $(CC) -MM $(CFLAGS) $^ 1>.depend
 
-dist-clean:    clean
-               rm -f .depend
+distclean:     clean
+       rm -f .depend
 
 clean: 
-               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)$(moduledir)"
+       install -d "$(DESTDIR)$(mltdatadir)/avformat"
+       install -m 644 producer_avformat.yml "$(DESTDIR)$(mltdatadir)/avformat"
+       install -m 644 consumer_avformat.yml "$(DESTDIR)$(mltdatadir)/avformat"
+
+uninstall:
+       rm "$(DESTDIR)$(moduledir)/libmltavformat$(LIBSUF)" 2> /dev/null || true
+       rm "$(DESTDIR)$(moduledir)/libmltffmpeg$(LIBSUF)" 2> /dev/null || true
+       rm -rf "$(DESTDIR)$(mltdatadir)/avformat"
 
 ifneq ($(wildcard .depend),)
 include .depend