+MAIN_MAKEFILE=1
include config.mak
vpath %.c $(SRC_PATH)
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/%)
SKIPHEADERS = cmdutils_common_opts.h
-MAIN_MAKEFILE=1
-include common.mak
+include $(SRC_PATH)/common.mak
FF_LDFLAGS := $(FFLDFLAGS)
FF_EXTRALIBS := $(FFEXTRALIBS)
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))))
%_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
config:
$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
-check: test
+include $(SRC_PATH)/doc/Makefile
+include $(SRC_PATH)/tests/Makefile
+
+$(sort $(OBJDIRS)):
+ $(Q)mkdir -p $@
+
+# Dummy rule to stop make trying to rebuild removed or renamed headers
+%.h:
+ @:
-include doc/Makefile
-include tests/Makefile
+# Disable suffix rules. Most of the builtin rules are suffix rules,
+# 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*