-SUBDIRS=$(ALL_OMK_SUBDIRS)
+SUBDIRS=$(sort $(ALL_OMK_SUBDIRS) ffmpeg)
default_CONFIG=CONFIG_FFMPEG_WITH_FRSH=y
-
-SUBDIRS += ffmpeg/libavcodec ffmpeg/libavdevice ffmpeg/libavfilter \
- ffmpeg/libavformat ffmpeg/libavutil ffmpeg/libpostproc \
- ffmpeg/libswscale
renamed_include_HEADERS:=$(foreach h,$(HEADERS),$(h)->lib$(NAME)/$(h) )
INCLUDES += -I $(dir $(srcdir:%/=%)) # this should point to ffmpeg sources
+ifeq ($(FFMPEG_SUBDIR),ffmpeg)
+SUBDIRS = tools libavcodec libavdevice libavfilter libavformat \
+ libavutil libpostproc libswscale
+renamed_include_HEADERS=
+
+# bin_PROGRAMS = ffmpeg pktdumper
+# pktdumper_SOURCES = tools/pktdumper.c
+# pktdumper_LIBS = avformat
+
+ffmpeg_SOURCES = ffmpeg.c cmdutils.c
+lib_LOADLIBES = $(ALLFFLIBS) $(FFEXTRALIBS:-l%=%)
+endif
+
ifeq ($(FFMPEG_SUBDIR),libavcodec)
SUBDIRS=x86
endif
+ifeq ($(FFMPEG_SUBDIR),libavutil)
+renamed_include_HEADERS += internal.h->libavutil/internal.h
+renamed_include_HEADERS += timer.h->libavutil/timer.h
+renamed_include_HEADERS += x86/timer.h->libavutil/x86/timer.h
+endif
+
ifeq ($(FFMPEG_SUBDIR),libavformat)
ifeq ($(CONFIG_FFMPEG_WITH_FRSH),y)
$(NAME)_SOURCES := $(filter-out udp.c,$(NAME)_SOURCES) frsh.c
# -*- makefile -*-
# Config file for compilation by OMK for AQuoSA/Linux OS target
+# For the FFMPEG2OMK hack, we need RELATIVE_DIR earlier:
+ifndef RELATIVE_DIR
+RELATIVE_DIR := $(SOURCES_DIR:$(OUTPUT_DIR)%=%)
+endif
+
ifeq ($(RELATIVE_DIR:ffmpeg%=ffmpeg),ffmpeg)
+
# Allow building ffmpeg by OMK
define FFMPEG_OMKIZE
lib_LIBRARIES:=$(NAME)
INCLUDES += -I $(srcdir)/..
endef
-$(SOURCES_DIR)/Makefile.omk: $(SOURCES_DIR)/Makefile $(MAKERULES_DIR)/ffmpeg/libswscale
+
+$(SOURCES_DIR)/Makefile.omk: $(SOURCES_DIR)/Makefile $(MAKERULES_DIR)/ffmpeg/libswscale $(MAKERULES_DIR)/Makefile.omk.ffmpeg
@echo " FFOMK $@"
$(Q)make DEPS="" -C $(SOURCES_DIR) -qp -f $< |sed -ne '/# Pattern-specific Variable Values/,$$ d' -e '/# makefile/,+1 p'|\
sed -e /^define/d -e "/^#/d" -e "/^MAKE/d" > $@
$(Q)echo 'CFLAGS := $(CFLAGS) $$(CFLAGS)' >> $@
+$(MAKERULES_DIR)/ffmpeg/tools/Makefile:
+ touch $@
+
$(MAKERULES_DIR)/ffmpeg/libavcodec/x86/Makefile:
touch $@