X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Favformat%2FMakefile;h=d36d6c68d30ece14c00734674174cd85c6f8046d;hb=42eea21bf0c71036397cac39f19d537c9344081c;hp=e258004fb4e6f5ddde71c3c186b71b55aade1ce6;hpb=1f8135566477df29f2b62528f9bf18359c0ab971;p=melted diff --git a/src/modules/avformat/Makefile b/src/modules/avformat/Makefile index e258004..d36d6c6 100644 --- a/src/modules/avformat/Makefile +++ b/src/modules/avformat/Makefile @@ -1,35 +1,81 @@ include ../../../config.mak +include config.mak -TARGET = ../libmltavformat.so +ifndef CODECS +TARGET = ../libmltffmpeg$(LIBSUF) +else +TARGET = ../libmltavformat$(LIBSUF) +endif + +OBJS = factory.o + +ifdef FILTERS +OBJS += filter_avcolour_space.o \ + filter_avresample.o \ + filter_avdeinterlace.o +ifdef SWSCALE +OBJS += filter_swscale.o +endif +CFLAGS += -DFILTERS +endif + +ifdef CODECS +OBJS += producer_avformat.o \ + consumer_avformat.o +CFLAGS += -DCODECS +endif -OBJS = factory.o \ - producer_avformat.o \ - consumer_avformat.o \ - filter_avdeinterlace.o \ - filter_avresample.o +CFLAGS+=-I../.. -CFLAGS += -I../.. +LDFLAGS+=-L../../framework -LDFLAGS += -lavformat -lavcodec +LDFLAGS+=-lavformat$(AVFORMAT_SUFFIX) -lavcodec$(AVFORMAT_SUFFIX) -lavutil$(AVFORMAT_SUFFIX) -lavdevice$(AVFORMAT_SUFFIX) $(EXTRA_LIBS) -lmlt + +ifdef SWSCALE + CFLAGS+=-DSWSCALE + LDFLAGS+=-lswscale$(AVFORMAT_SUFFIX) +endif + +ifdef LOCAL_FFMPEG + LOCAL_FFMPEG_OBJS = ffmpeg/libavformat/libavformat$(AVFORMAT_SUFFIX) \ + ffmpeg/libavcodec/libavcodec$(AVFORMAT_SUFFIX) \ + ffmpeg/libavutil/libavutil$(AVFORMAT_SUFFIX) \ + ffmpeg/libavutil/libavdevice$(AVFORMAT_SUFFIX) +endif SRCS := $(OBJS:.o=.c) all: $(TARGET) -$(TARGET): $(OBJS) - $(CC) -shared -o $@ $(OBJS) $(LDFLAGS) +$(LOCAL_FFMPEG_OBJS): + if [ $(LOCAL_FFMPEG) ] ; then \ + $(MAKE) -C ffmpeg ffmpeg ; \ + fi + +$(TARGET): $(OBJS) $(LOCAL_FFMPEG_OBJS) + $(CC) $(SHFLAGS) -o $@ $(OBJS) $(LDFLAGS) depend: $(SRCS) - $(CC) -MM $(CFLAGS) $^ 1>.depend + if [ $(LOCAL_FFMPEG) ] ; then $(MAKE) -C ffmpeg dep ; fi + $(CC) -MM $(CFLAGS) $^ 1>.depend -dist-clean: clean - rm -f .depend +distclean: clean + if [ $(LOCAL_FFMPEG) ] ; then $(MAKE) -C ffmpeg distclean ; fi + rm -f .depend clean: - rm -f $(OBJS) $(TARGET) + #if [ $(LOCAL_FFMPEG) ] ; then $(MAKE) -C ffmpeg clean ; fi + 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)$(prefix)/share/mlt/avformat" + install -m 644 producer_avformat.yml "$(DESTDIR)$(prefix)/share/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)$(prefix)/share/mlt/avformat" ifneq ($(wildcard .depend),) include .depend