]> git.sesse.net Git - ffmpeg/blobdiff - Makefile
Merge branch 'sws_32bit_integration'
[ffmpeg] / Makefile
index d3a56de712d5faf0e02f3c9cb9b37b23c90486fd..5bc9c25b089de98dcb8298301491b78ccccdc97b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,4 @@
+MAIN_MAKEFILE=1
 include config.mak
 
 vpath %.c    $(SRC_PATH)
@@ -7,9 +8,6 @@ vpath %.asm  $(SRC_PATH)
 vpath %.v    $(SRC_PATH)
 vpath %.texi $(SRC_PATH)
 
-# Do not delete intermediate files from chains of implicit rules
-$(OBJS):
-
 PROGS-$(CONFIG_FFMPEG)   += ffmpeg
 PROGS-$(CONFIG_FFPLAY)   += ffplay
 PROGS-$(CONFIG_FFPROBE)  += ffprobe
@@ -18,7 +16,6 @@ PROGS-$(CONFIG_FFSERVER) += ffserver
 PROGS      := $(PROGS-yes:%=%$(EXESUF))
 PROGS_G     = $(PROGS-yes:%=%_g$(EXESUF))
 OBJS        = $(PROGS-yes:%=%.o) cmdutils.o
-TOOLS       = $(addprefix tools/, $(addsuffix $(EXESUF), cws2fws graph2dot lavfi-showfiltfmts pktdumper probetest qt-faststart trasher))
 TESTTOOLS   = audiogen videogen rotozoom tiny_psnr base64
 HOSTPROGS  := $(TESTTOOLS:%=tests/%)
 
@@ -42,7 +39,7 @@ DATA_FILES := $(wildcard $(SRC_PATH)/ffpresets/*.ffpreset)
 
 SKIPHEADERS = cmdutils_common_opts.h
 
-include common.mak
+include $(SRC_PATH)/common.mak
 
 FF_LDFLAGS   := $(FFLDFLAGS)
 FF_EXTRALIBS := $(FFEXTRALIBS)
@@ -72,7 +69,7 @@ endef
 define DOSUBDIR
 $(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
 SUBDIR := $(1)/
-include $(1)/Makefile
+include $(SRC_PATH)/$(1)/Makefile
 endef
 
 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
@@ -84,14 +81,20 @@ ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
 %_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
        $(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
 
+TOOLS     = cws2fws graph2dot lavfi-showfiltfmts pktdumper probetest qt-faststart trasher
+TOOLOBJS := $(TOOLS:%=tools/%.o)
+TOOLS    := $(TOOLS:%=tools/%$(EXESUF))
+
 alltools: $(TOOLS)
 
 tools/%$(EXESUF): tools/%.o
        $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
 
-tools/%.o: tools/%.c
+$(TOOLOBJS): %.o: %.c | tools
        $(CC) $(CPPFLAGS) $(CFLAGS) -c $(CC_O) $<
 
+OBJDIRS += tools
+
 -include $(wildcard tools/*.d)
 
 VERSION_SH  = $(SRC_PATH)/version.sh
@@ -147,10 +150,11 @@ distclean::
 config:
        $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
 
-check: test
+include $(SRC_PATH)/doc/Makefile
+include $(SRC_PATH)/tests/Makefile
 
-include doc/Makefile
-include tests/Makefile
+$(sort $(OBJDIRS)):
+       $(Q)mkdir -p $@
 
 # Dummy rule to stop make trying to rebuild removed or renamed headers
 %.h:
@@ -160,5 +164,5 @@ include tests/Makefile
 # so this saves some time on slow systems.
 .SUFFIXES:
 
-.PHONY: all alltools *clean check config examples install*
+.PHONY: all all-yes alltools *clean config examples install*
 .PHONY: testprogs uninstall*