X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Favformat%2FMakefile;h=7d889435ca1d23d7aded41a845039c9eaa7c2009;hb=e89b21b07607ae485f56b32f3e67f83f528f2ae6;hp=51adb42d1c9609c5d9ca3813070ec2913844dc39;hpb=907432010c7c37857794c8b764e60205f816533a;p=melted diff --git a/src/modules/avformat/Makefile b/src/modules/avformat/Makefile index 51adb42..7d88943 100644 --- a/src/modules/avformat/Makefile +++ b/src/modules/avformat/Makefile @@ -1,56 +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 -LDFLAGS+=-lavformat$(AVFORMAT_SUFFIX) -lavcodec$(AVFORMAT_SUFFIX) -lavutil$(AVFORMAT_SUFFIX) $(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$(AVFORMAT_SUFFIX)$(LIBSUF) ../../framework/libavcodec$(AVFORMAT_SUFFIX)$(LIBSUF) ; \ - cp -f ffmpeg/libavformat/libavformat$(AVFORMAT_SUFFIX)$(LIBSUF) ../../framework/libavformat$(AVFORMAT_SUFFIX)$(LIBSUF) ; \ - cp -f ffmpeg/libavutil/libavutil$(AVFORMAT_SUFFIX)$(LIBSUF) ../../framework/libavutil$(AVFORMAT_SUFFIX)$(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 ../../framework/libavcodec$(AVFORMAT_SUFFIX)$(LIBSUF) ../../framework/libavformat$(AVFORMAT_SUFFIX)$(LIBSUF) ../../framework/libavutil$(AVFORMAT_SUFFIX)$(LIBSUF) $(OBJS) $(TARGET) + #if [ $(LOCAL_FFMPEG) ] ; then $(MAKE) -C ffmpeg clean ; fi + rm -f $(OBJS) ../libmltffmpeg$(LIBSUF) ../libmltavformat$(LIBSUF) install: all - install -m 755 $(TARGET) "$(DESTDIR)$(prefix)/share/mlt/modules" - if [ $(LOCAL_FFMPEG) ] ; then \ - install -m 755 ../../framework/libavcodec$(AVFORMAT_SUFFIX)$(LIBSUF) "$(DESTDIR)$(libdir)" ; \ - install -m 755 ../../framework/libavformat$(AVFORMAT_SUFFIX)$(LIBSUF) "$(DESTDIR)$(libdir)" ; \ - install -m 755 ../../framework/libavutil$(AVFORMAT_SUFFIX)$(LIBSUF) "$(DESTDIR)$(libdir)" ; \ - 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