[FFmpeg-devel] [PATCH 1/2] Revert "build: move basic rules and variables to main Makefile"

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri Jun 24 09:11:21 CEST 2011


This reverts commit bb5249244ddb22df1cfb8dee1c369e6cd653d00d.
This is necessary to allow running "make" in subdirs again.

Conflicts:

	Makefile
---
 Makefile   |   35 -----------------------------------
 common.mak |   40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 35 deletions(-)

diff --git a/Makefile b/Makefile
index 9eff02d..d3a56de 100644
--- a/Makefile
+++ b/Makefile
@@ -7,41 +7,6 @@ vpath %.asm  $(SRC_PATH)
 vpath %.v    $(SRC_PATH)
 vpath %.texi $(SRC_PATH)
 
-ifndef V
-Q      = @
-ECHO   = printf "$(1)\t%s\n" $(2)
-BRIEF  = CC AS YASM AR LD HOSTCC STRIP CP
-SILENT = DEPCC YASMDEP RM RANLIB
-MSG    = $@
-M      = @$(call ECHO,$(TAG),$@);
-$(foreach VAR,$(BRIEF), \
-    $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
-$(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
-$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_PATH)/%=%)); $(INSTALL))
-endif
-
-IFLAGS     := -I. -I$(SRC_PATH)
-CPPFLAGS   := $(IFLAGS) $(CPPFLAGS)
-CFLAGS     += $(ECFLAGS)
-YASMFLAGS  += $(IFLAGS) -Pconfig.asm
-HOSTCFLAGS += $(IFLAGS)
-
-%.o: %.c
-	$(CCDEP)
-	$(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $<
-
-%.o: %.S
-	$(ASDEP)
-	$(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) -c -o $@ $<
-
-%.ho: %.h
-	$(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
-
-%.ver: %.v
-	$(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
-
-%.c %.h: TAG = GEN
-
 # Do not delete intermediate files from chains of implicit rules
 $(OBJS):
 
diff --git a/common.mak b/common.mak
index e2eaa39..8d21d15 100644
--- a/common.mak
+++ b/common.mak
@@ -5,6 +5,46 @@
 # first so "all" becomes default target
 all: all-yes
 
+ifndef SUBDIR
+
+ifndef V
+Q      = @
+ECHO   = printf "$(1)\t%s\n" $(2)
+BRIEF  = CC AS YASM AR LD HOSTCC
+SILENT = DEPCC YASMDEP RM RANLIB
+MSG    = $@
+M      = @$(call ECHO,$(TAG),$@);
+$(foreach VAR,$(BRIEF), \
+    $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
+$(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
+$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_DIR)/%=%)); $(INSTALL))
+endif
+
+IFLAGS   := -I. -I$(SRC_PATH)
+CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
+CFLAGS   += $(ECFLAGS)
+YASMFLAGS += $(IFLAGS) -Pconfig.asm
+
+HOSTCFLAGS += $(IFLAGS)
+
+%.o: %.c
+	$(CCDEP)
+	$(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $<
+
+%.o: %.S
+	$(ASDEP)
+	$(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) -c -o $@ $<
+
+%.ho: %.h
+	$(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
+
+%.ver: %.v
+	$(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
+
+%.c %.h: TAG = GEN
+
+endif
+
 OBJS-$(HAVE_MMX) +=  $(MMX-OBJS-yes)
 
 OBJS      += $(OBJS-yes)
-- 
1.7.5.4



More information about the ffmpeg-devel mailing list