This unclutters the top-level directory and groups related files together.
---

I'm tempted to also move config.h and config.asm. For the former, it would
make the #include name less generic, which would be a good thing.

 .gitignore                       |  3 ++-
 Makefile                         | 19 ++++++++++---------
 build/.gitignore                 |  4 ++++
 arch.mak => build/arch.mak       |  0
 common.mak => build/common.mak   |  2 +-
 library.mak => build/library.mak |  2 +-
 version.sh => build/version.sh   |  0
 configure                        | 23 ++++++++++++-----------
 tests/fate.sh                    |  2 +-
 9 files changed, 31 insertions(+), 24 deletions(-)
 create mode 100644 build/.gitignore
 rename arch.mak => build/arch.mak (100%)
 rename common.mak => build/common.mak (98%)
 rename library.mak => build/library.mak (98%)
 rename version.sh => build/version.sh (100%)

diff --git a/.gitignore b/.gitignore
index e71246c..f6d97b0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,7 +23,8 @@
 /avplay
 /avprobe
 /avversion.h
-/config.*
+/config.asm
+/config.h
 /coverage.info
 /lcov/
 /mapfile
diff --git a/Makefile b/Makefile
index 22235b3..f1f0b93 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-include config.mak
+include build/config.mak
 
 vpath %.c    $(SRC_PATH)
 vpath %.m    $(SRC_PATH)
@@ -110,7 +110,7 @@ SKIPHEADERS = cmdutils_common_opts.h                        
            \
 all: all-yes
 
 include $(SRC_PATH)/tools/Makefile
-include $(SRC_PATH)/common.mak
+include $(SRC_PATH)/build/common.mak
 
 FF_EXTRALIBS := $(FFEXTRALIBS)
 FF_DEP_LIBS  := $(DEP_LIBS)
@@ -127,8 +127,8 @@ CONFIGURABLE_COMPONENTS =                                   
        \
     $(SRC_PATH)/libavcodec/bitstream_filters.c                      \
     $(SRC_PATH)/libavformat/protocols.c                             \
 
-config.h: .config
-.config: $(CONFIGURABLE_COMPONENTS)
+config.h: build/.config
+build/.config: $(CONFIGURABLE_COMPONENTS)
        @-tput bold 2>/dev/null
        @-printf '\nWARNING: $(?) newer than config.h, rerun configure\n\n'
        @-tput sgr0 2>/dev/null
@@ -150,7 +150,7 @@ SUBDIR := $(1)/
 include $(SRC_PATH)/$(1)/Makefile
 -include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
 -include $(SRC_PATH)/$(1)/$(INTRINSICS)/Makefile
-include $(SRC_PATH)/library.mak
+include $(SRC_PATH)/build/library.mak
 endef
 
 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
@@ -171,10 +171,10 @@ $(foreach P,$(PROGS),$(eval $(call 
DOPROG,$(P:$(EXESUF)=))))
 $(PROGS): %$(EXESUF): %.o $(FF_DEP_LIBS)
        $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
 
-VERSION_SH  = $(SRC_PATH)/version.sh
+VERSION_SH  = $(SRC_PATH)/build/version.sh
 GIT_LOG     = $(SRC_PATH)/.git/logs/HEAD
 
-.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
+.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) build/config.mak
 .version: M=@
 
 cmdutils.o libavutil/utils.o: avversion.h
@@ -219,8 +219,9 @@ clean::
 
 distclean::
        $(RM) $(DISTCLEANSUFFIXES)
-       $(RM) config.* .config libavutil/avconfig.h .version avversion.h \
-            mapfile libavcodec/bsf_list.c libavformat/protocol_list.c
+       $(RM) .version avversion.h config.asm config.h mapfile \
+            build/.config build/config.* libavutil/avconfig.h \
+            libavcodec/bsf_list.c libavformat/protocol_list.c
 
 config:
        $(SRC_PATH)/configure $(value LIBAV_CONFIGURATION)
diff --git a/build/.gitignore b/build/.gitignore
new file mode 100644
index 0000000..693b7aa
--- /dev/null
+++ b/build/.gitignore
@@ -0,0 +1,4 @@
+/.config
+/config.fate
+/config.log
+/config.mak
diff --git a/arch.mak b/build/arch.mak
similarity index 100%
rename from arch.mak
rename to build/arch.mak
diff --git a/common.mak b/build/common.mak
similarity index 98%
rename from common.mak
rename to build/common.mak
index 730b561..efbf4a2 100644
--- a/common.mak
+++ b/build/common.mak
@@ -2,7 +2,7 @@
 # common bits used by all libraries
 #
 
-include $(SRC_PATH)/arch.mak
+include $(SRC_PATH)/build/arch.mak
 
 OBJS      += $(OBJS-yes)
 FFLIBS    := $($(NAME)_FFLIBS) $(FFLIBS-yes) $(FFLIBS)
diff --git a/library.mak b/build/library.mak
similarity index 98%
rename from library.mak
rename to build/library.mak
index fdb8a5d..692b6fb 100644
--- a/library.mak
+++ b/build/library.mak
@@ -1,4 +1,4 @@
-include $(SRC_PATH)/common.mak
+include $(SRC_PATH)/build/common.mak
 
 LIBVERSION := $(lib$(NAME)_VERSION)
 LIBMAJOR   := $(lib$(NAME)_VERSION_MAJOR)
diff --git a/version.sh b/build/version.sh
similarity index 100%
rename from version.sh
rename to build/version.sh
diff --git a/configure b/configure
index b208e2f..0a8cb4a 100755
--- a/configure
+++ b/configure
@@ -77,7 +77,7 @@ Help options:
   --list-filters           show all available filters
 
 Standard options:
-  --logfile=FILE           log tests and output to FILE [config.log]
+  --logfile=FILE           log tests and output to FILE [build/config.log]
   --disable-logging        do not log configure debug information
   --prefix=PREFIX          install in PREFIX [$prefix_default]
   --bindir=DIR             install binaries in DIR [PREFIX/bin]
@@ -2666,7 +2666,7 @@ texi2html_deps="doc"
 
 # default parameters
 
-logfile="config.log"
+logfile="build/config.log"
 
 # installation paths
 prefix_default="/usr/local"
@@ -2982,6 +2982,7 @@ disable_components(){
 
 map 'disable_components $v' $LIBRARY_LIST
 
+mkdir -p build
 echo "# $0 $LIBAV_CONFIGURATION" > $logfile
 set >> $logfile
 
@@ -4297,7 +4298,7 @@ esc(){
     echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
 }
 
-echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc 
$LIBAV_CONFIGURATION)" >config.fate
+echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc 
$LIBAV_CONFIGURATION)" > build/config.fate
 
 check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || 
defined(PIC)" && enable_weak pic
 
@@ -5398,9 +5399,9 @@ fi # test "$quiet" != "yes"
 
 test -e Makefile || echo "include $source_path/Makefile" > Makefile
 
-config_files="$TMPH config.mak"
+config_files="$TMPH build/config.mak"
 
-cat > config.mak <<EOF
+cat > build/config.mak <<EOF
 # Automatically generated by configure - do not modify!
 LIBAV_CONFIGURATION=$LIBAV_CONFIGURATION
 prefix=$prefix
@@ -5510,17 +5511,17 @@ get_version(){
     file=$source_path/$lcname/version.h
     eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
     eval 
${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
-    eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
-    eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
-    eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> config.mak
+    eval echo "${lcname}_VERSION=\$${name}_VERSION" >> build/config.mak
+    eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> 
build/config.mak
+    eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> 
build/config.mak
 }
 
 map 'get_version $v' $LIBRARY_LIST
 
-map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> config.mak' $LIBRARY_LIST
+map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> build/config.mak' $LIBRARY_LIST
 
 for entry in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
-    eval echo "EXTRALIBS-${entry}=\$extralibs_${entry}" >> config.mak
+    eval echo "EXTRALIBS-${entry}=\$extralibs_${entry}" >> build/config.mak
 done
 
 cat > $TMPH <<EOF
@@ -5557,7 +5558,7 @@ echo "#endif /* LIBAV_CONFIG_H */" >> $TMPH
 
 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
 cp_if_changed $TMPH config.h
-touch .config
+touch build/.config
 
 enabled yasm && cp_if_changed $TMPASM config.asm
 
diff --git a/tests/fate.sh b/tests/fate.sh
index f7ca891..942de6b 100755
--- a/tests/fate.sh
+++ b/tests/fate.sh
@@ -83,7 +83,7 @@ clean(){
 report(){
     date=$(date -u +%Y%m%d%H%M%S)
     echo "fate:1:${date}:${slot}:${version}:$1:$2:${branch}:${comment}" >report
-    cat ${build}/config.fate ${build}/tests/data/fate/*.rep >>report 
2>/dev/null
+    cat ${build}/build/config.fate ${build}/tests/data/fate/*.rep >> report 2> 
/dev/null
     test -n "$fate_recv" && $tar report *.log | gzip | $fate_recv
 }
 
-- 
2.1.4

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to