Commit 56f5a431 authored by mru's avatar mru

Generate dependencies while compiling if supported by compiler

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19609 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 0568fc11
...@@ -21,12 +21,12 @@ ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale ...@@ -21,12 +21,12 @@ ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
CPPFLAGS := -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(CPPFLAGS) CPPFLAGS := -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(CPPFLAGS)
%.o: %.c %.o: %.c
$(DEPEND_CMD) $(CCDEP)
$(CC) $(CPPFLAGS) $(CFLAGS) $(LIBOBJFLAGS) -c $(CC_O) $< $(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) $(LIBOBJFLAGS) -c $(CC_O) $<
%.o: %.S %.o: %.S
$(DEPEND_CMD) $(ASDEP)
$(AS) $(CPPFLAGS) $(ASFLAGS) $(LIBOBJFLAGS) -c -o $@ $< $(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
%.ho: %.h %.ho: %.h
$(CC) $(CPPFLAGS) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $< $(CC) $(CPPFLAGS) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $<
......
...@@ -1510,8 +1510,12 @@ filter_asflags=echo ...@@ -1510,8 +1510,12 @@ filter_asflags=echo
if $cc --version 2>/dev/null | grep -qi gcc; then if $cc --version 2>/dev/null | grep -qi gcc; then
cc_type=gcc cc_type=gcc
CC_DEPFLAGS='-MMD'
AS_DEPFLAGS='-MMD'
elif $cc --version 2>/dev/null | grep -q Intel; then elif $cc --version 2>/dev/null | grep -q Intel; then
cc_type=icc cc_type=icc
CC_DEPFLAGS='-MMD'
AS_DEPFLAGS='-MMD'
elif $cc -v 2>&1 | grep -q xlc; then elif $cc -v 2>&1 | grep -q xlc; then
cc_type=xlc cc_type=xlc
elif $cc -V 2>/dev/null | grep -q Compaq; then elif $cc -V 2>/dev/null | grep -q Compaq; then
...@@ -1530,17 +1534,19 @@ elif $cc --vsn 2>/dev/null | grep -q RVCT; then ...@@ -1530,17 +1534,19 @@ elif $cc --vsn 2>/dev/null | grep -q RVCT; then
die "Error creating armcc configuration file." die "Error creating armcc configuration file."
cc="$cc --arm_linux_config_file=$armcc_conf --translate_gcc" cc="$cc --arm_linux_config_file=$armcc_conf --translate_gcc"
as_default="${cross_prefix}gcc" as_default="${cross_prefix}gcc"
CC_DEPFLAGS='-MMD'
AS_DEPFLAGS='-MMD'
elif $cc -version 2>/dev/null | grep -q TMS470; then elif $cc -version 2>/dev/null | grep -q TMS470; then
cc_type=tms470 cc_type=tms470
cc="$cc --gcc --abi=eabi -eo=.o -mc -me" cc="$cc --gcc --abi=eabi -eo=.o -mc -me"
CC_O='-fr=$(@D)' CC_O='-fr=$(@D)'
as_default="${cross_prefix}gcc" as_default="${cross_prefix}gcc"
ld_default="${cross_prefix}gcc" ld_default="${cross_prefix}gcc"
dep_cc_default="${cross_prefix}gcc"
TMPO=$(basename $TMPC .c).o TMPO=$(basename $TMPC .c).o
append TMPFILES $TMPO append TMPFILES $TMPO
add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__= add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__=
DEPFLAGS='$(CPPFLAGS) -MM' CC_DEPFLAGS='-ppa -ppd=$(@:.o=.d)'
AS_DEPFLAGS='-MMD'
filter_cflags=tms470_flags filter_cflags=tms470_flags
tms470_flags(){ tms470_flags(){
for flag; do for flag; do
...@@ -1574,6 +1580,9 @@ test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc" ...@@ -1574,6 +1580,9 @@ test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc"
: ${ld_default:=$cc} : ${ld_default:=$cc}
set_default as dep_cc ld set_default as dep_cc ld
test -n "$CC_DEPFLAGS" || CCDEP=$DEPEND_CMD
test -n "$AS_DEPFLAGS" || ASDEP=$DEPEND_CMD
add_cflags $extra_cflags add_cflags $extra_cflags
add_asflags $extra_cflags add_asflags $extra_cflags
...@@ -2611,8 +2620,11 @@ echo "SLIBPREF=$SLIBPREF" >> config.mak ...@@ -2611,8 +2620,11 @@ echo "SLIBPREF=$SLIBPREF" >> config.mak
echo "SLIBSUF=$SLIBSUF" >> config.mak echo "SLIBSUF=$SLIBSUF" >> config.mak
echo "EXESUF=$EXESUF" >> config.mak echo "EXESUF=$EXESUF" >> config.mak
echo "EXTRA_VERSION=$extra_version" >> config.mak echo "EXTRA_VERSION=$extra_version" >> config.mak
echo "DEPEND_CMD=$DEPEND_CMD" >> config.mak
echo "DEPFLAGS=$DEPFLAGS" >> config.mak echo "DEPFLAGS=$DEPFLAGS" >> config.mak
echo "CCDEP=$CCDEP" >> config.mak
echo "ASDEP=$ASDEP" >> config.mak
echo "CC_DEPFLAGS=$CC_DEPFLAGS" >> config.mak
echo "AS_DEPFLAGS=$AS_DEPFLAGS" >> config.mak
echo "HOSTCC=$host_cc" >> config.mak echo "HOSTCC=$host_cc" >> config.mak
echo "HOSTCFLAGS=$host_cflags" >> config.mak echo "HOSTCFLAGS=$host_cflags" >> config.mak
echo "HOSTEXESUF=$HOSTEXESUF" >> config.mak echo "HOSTEXESUF=$HOSTEXESUF" >> config.mak
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment