mirror of https://git.ffmpeg.org/ffmpeg.git
build: move basic rules and variables to main Makefile
Signed-off-by: Mans Rullgard <mans@mansr.com>
This commit is contained in:
parent
8d853efe53
commit
bb5249244d
35
Makefile
35
Makefile
|
@ -9,6 +9,41 @@ vpath %.asm $(SRC_DIR)
|
|||
vpath %.v $(SRC_DIR)
|
||||
vpath %.texi $(SRC_PATH_BARE)
|
||||
|
||||
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
|
||||
|
||||
PROGS-$(CONFIG_FFMPEG) += ffmpeg
|
||||
PROGS-$(CONFIG_FFPLAY) += ffplay
|
||||
PROGS-$(CONFIG_FFPROBE) += ffprobe
|
||||
|
|
40
common.mak
40
common.mak
|
@ -5,46 +5,6 @@
|
|||
# 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)
|
||||
|
|
Loading…
Reference in New Issue