X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Favformat%2FMakefile;h=d36d6c68d30ece14c00734674174cd85c6f8046d;hb=e0983d216bc8b3d34225d42761060940d6da4f3c;hp=66e57f83839bd343bd6a7bddca5ea1888523af13;hpb=a0a988c50fce047427b445d5e21d7354862e8e23;p=melted diff --git a/src/modules/avformat/Makefile b/src/modules/avformat/Makefile index 66e57f8..d36d6c6 100644 --- a/src/modules/avformat/Makefile +++ b/src/modules/avformat/Makefile @@ -1,32 +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 +CFLAGS+=-I../.. -CFLAGS = -O3 -I../../ -Wall -g -D_FILE_OFFSET_BITS=64 +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