]> rtime.felk.cvut.cz Git - frescor/demo.git/blobdiff - build/config.target
Fix simultaneous building of ffmpeg with and w/o FRSH
[frescor/demo.git] / build / config.target
index ff22b5856fc70a68a0e18663d9ca41976f367ab3..7c88240796c3d6a13186734e8db631c771e81c8a 100644 (file)
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 # Config file for compilation by OMK for AQuoSA/Linux OS target
 
 OMIT_KERNEL_PASSES=y
@@ -8,34 +8,42 @@ ifndef RELATIVE_DIR
 RELATIVE_DIR := $(SOURCES_DIR:$(OUTPUT_DIR)%=%)
 endif
 
-ifeq ($(RELATIVE_DIR:ffmpeg%=ffmpeg),ffmpeg)
+FFMPEG_BUILD_DIR=$(OUTPUT_DIR)/_build/user/ffmpeg
 
 # Allow building ffmpeg by OMK
-define FFMPEG_OMKIZE
-lib_LIBRARIES:=$(NAME)
-$(NAME)_SOURCES:=$(OBJS:%.o=%.c) $(OBJS-y:%.o=%.c) $(OBJS-yes:%.o=%.c)
-renamed_include_HEADERS:=$(foreach h,$(HEADERS),$(h)->lib$(NAME)/$(h) )
-INCLUDES += -I $(srcdir)/..
-endef
-
-$(SOURCES_DIR)/Makefile.omk: $(SOURCES_DIR)/Makefile $(MAKERULES_DIR)/ffmpeg/libswscale $(MAKERULES_DIR)/Makefile.omk.ffmpeg
+ifeq ($(RELATIVE_DIR:ffmpeg%=ffmpeg),ffmpeg)
+$(SOURCES_DIR)/Makefile.omk: $(MAKERULES_DIR)/ffmpeg/libswscale \
+                            $(MAKERULES_DIR)/Makefile.omk.ffmpeg \
+                            $(FFMPEG_BUILD_DIR)/config.mak \
+                            $(FFMPEG_BUILD_DIR)/version.h \
+                            $(OUTPUT_DIR)/_build/user/$(RELATIVE_DIR)/Makefile
        @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" > $@
-#      echo '$(value FFMPEG_OMKIZE)' >> $@ # There is a bug in make
        $(Q)echo "FFMPEG_SUBDIR=$(RELATIVE_DIR:ffmpeg/%=%)" >> $@
        $(Q)cat $(MAKERULES_DIR)/Makefile.omk.ffmpeg >> $@
        $(Q)echo 'CFLAGS := $(CFLAGS) $$(CFLAGS)' >> $@
 
+$(OUTPUT_DIR)/_build/user/$(RELATIVE_DIR)/Makefile.inc.ffmpeg: $(OUTPUT_DIR)/_build/user/$(RELATIVE_DIR)/Makefile
+       @echo "  SCRIPT  $@"
+       $(Q)make DEPS="" -C $(OUTPUT_DIR)/_build/user/$(RELATIVE_DIR) -rqp \
+               | sed -ne '/# Pattern-specific Variable Values/,$$ d' -e '/# makefile/,+1 p' \
+               | sed -e /^define/d -e "/^#/d" -e "/^MAKE/d" > $@
 
-$(MAKERULES_DIR)/ffmpeg/tools/Makefile:
+$(FFMPEG_BUILD_DIR)/tools/Makefile:
        touch $@
 
-$(MAKERULES_DIR)/ffmpeg/libavcodec/x86/Makefile:
+$(FFMPEG_BUILD_DIR)/libavcodec/x86/Makefile:
        touch $@
 
 $(MAKERULES_DIR)/ffmpeg/libswscale:
        ln -sf ../../src/libswscale $@
+
+$(FFMPEG_BUILD_DIR)/config.mak: \
+               $(MAKERULES_DIR)/ffmpeg/configure \
+               $(MAKERULES_DIR)/../build/config.target # this file
+       cd $(dir $@) && $(MAKERULES_DIR)/ffmpeg/configure $(if $(CONFIG_FFMPEG_WITH_FRSH:y=),--disable-protocol=frsh)
+
+$(FFMPEG_BUILD_DIR)/version.h:
+       cd $(dir $@) && $(MAKERULES_DIR)/ffmpeg/version.sh $(PWD) $@
 endif