X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Favformat%2FMakefile;h=7d889435ca1d23d7aded41a845039c9eaa7c2009;hb=e89b21b07607ae485f56b32f3e67f83f528f2ae6;hp=9354339a00b42a13d54459f0545001bae69f7d09;hpb=db7368b4d5da5086d80c5004ee38d5e4ecc84c8b;p=melted diff --git a/src/modules/avformat/Makefile b/src/modules/avformat/Makefile index 9354339..7d88943 100644 --- a/src/modules/avformat/Makefile +++ b/src/modules/avformat/Makefile @@ -1,58 +1,85 @@ include ../../../config.mak + +CFLAGS += -I../.. + +LDFLAGS += -L../../framework -lmlt + include config.mak +LDFLAGS += -lavformat$(AVFORMAT_SUFFIX) +LDFLAGS += -lavcodec$(AVFORMAT_SUFFIX) +LDFLAGS += -lavutil$(AVFORMAT_SUFFIX) +LDFLAGS += -lavdevice$(AVFORMAT_SUFFIX) $(EXTRA_LIBS) + +ifndef CODECS TARGET = ../libmltffmpeg$(LIBSUF) +else +TARGET = ../libmltavformat$(LIBSUF) +endif -OBJS = factory.o \ - producer_avformat.o \ - consumer_avformat.o \ - filter_avcolour_space.o \ - filter_avresample.o +OBJS = factory.o -ifdef MMX_FLAGS - OBJS += filter_avdeinterlace.o +ifdef FILTERS +OBJS += filter_avcolour_space.o \ + filter_avresample.o \ + filter_avdeinterlace.o +ifdef SWSCALE +OBJS += filter_swscale.o +endif +CFLAGS += -DFILTERS endif -CFLAGS+=-I../.. +ifdef CODECS +OBJS += producer_avformat.o \ + consumer_avformat.o +CFLAGS += -DCODECS +endif -LDFLAGS+=-L../../framework +ifdef SWSCALE +CFLAGS += -DSWSCALE +LDFLAGS += -lswscale$(AVFORMAT_SUFFIX) +endif -ifdef LOCAL_FFMPEG - LDFLAGS+=-lmltavformat -lmltavcodec $(EXTRA_LIBS) -lmlt -else - LDFLAGS+=-lavformat -lavcodec $(EXTRA_LIBS) -lmlt +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) - if [ $(LOCAL_FFMPEG) ] ; then \ - $(MAKE) -C ffmpeg all ; \ - cp -f ffmpeg/libavcodec/libavcodec$(LIBSUF) ../../framework/libmltavcodec$(LIBSUF) ; \ - cp -f ffmpeg/libavformat/libavformat$(LIBSUF) ../../framework/libmltavformat$(LIBSUF) ; \ - fi - $(CC) $(SHFLAGS) -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) - if [ $(LOCAL_FFMPEG) ] ; then $(MAKE) -C ffmpeg dep ; fi - $(CC) -MM $(CFLAGS) $^ 1>.depend + if [ $(LOCAL_FFMPEG) ] ; then $(MAKE) -C ffmpeg dep ; fi + $(CC) -MM $(CFLAGS) $^ 1>.depend -dist-clean: clean - if [ $(LOCAL_FFMPEG) ] ; then $(MAKE) -C ffmpeg dist-clean ; fi - rm -f .depend +distclean: clean + if [ $(LOCAL_FFMPEG) ] ; then $(MAKE) -C ffmpeg distclean ; fi + rm -f .depend clean: - #if [ $(LOCAL_FFMPEG) ] ; then $(MAKE) -C ffmpeg clean ; fi - 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" - if [ $(LOCAL_FFMPEG) ] ; then \ - install -m 755 ../../framework/libmltavcodec$(LIBSUF) "$(prefix)/share/mlt/modules" ; \ - install -m 755 ../../framework/libmltavformat$(LIBSUF) "$(prefix)/share/mlt/modules" ; \ - fi + 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