]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Makefiles: Flatten and sort file lists
authorSimon Marchi <simon.marchi@polymtl.ca>
Tue, 22 Nov 2016 21:14:22 +0000 (16:14 -0500)
committerSimon Marchi <simon.marchi@ericsson.com>
Wed, 23 Nov 2016 14:45:22 +0000 (09:45 -0500)
commitb593ecca856860a8b38deb808493bba4beef3aee
tree243b9c409075f4b821f25a282cc89860f923d083
parent1a9ccd70f9a75dc6b48d340059f28ef3550c107b
Makefiles: Flatten and sort file lists

I find the big file lists in the Makefiles a bit ugly and not very
practical.  Since there are multiple filenames on each line (as much as
fits in 80 columns), it's not easy to add, remove or change a name in
the middle.  As a result, we have a mix of long and short lines in no
particular order (ALL_TARGET_OBS is a good example).

I therefore suggest flattening the lists (one name per line) and keeping
them in alphabetical order.  The diffs will be much clearer and merge
conflicts will be easier to resolve.

A nice (IMO) side-effect I observed is that the files are compiled
alphabetically by make, so it gives a rough idea of the progress of the
build.

I added a comment in gdb/Makefile.in to mention to keep the file lists
ordered, and gave the general guidelines on what order to respect.  I
added a comment in other Makefiles which refers to gdb/Makefile.in, to
avoid duplication.

Running the patch through the buildbot found that gdb.base/default.exp
started to fail.  The languages in the error message shown when typing
"set language" have changed order.  We could probably improve gdb so
that it prints them in a stable order, regardless of the order of the
object list passed to the linked, but just fixing the test is easier for
now.

New in v2:

 - Change ordering style, directories go at the end.
 - Cleanup gdbserver's and data-directory's Makefile as well.
 - Add comments at top of Makefiles about the ordering.
 - Remove wrong trailing backslahes.
 - Fix test gdb.base/default.exp.

gdb/ChangeLog:

* Makefile.in: Add comment about file lists ordering.
(SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_MI_OBS, SUBDIR_MI_SRCS,
SUBDIR_TUI_OBS, SUBDIR_TUI_SRCS, SUBDIR_GCC_COMPILE_OBS,
SUBDIR_GCC_COMPILE_SRCS, SUBDIR_GUILE_OBS, SUBDIR_GUILE_SRCS,
SUBDIR_PYTHON_OBS, SUBDIR_PYTHON_SRCS, SUBDIR_GDBTK_OBS,
SUBDIR_GDBTK_SRCS, XMLFILES, REMOTE_OBS, ALL_64_TARGET_OBS,
ALL_TARGET_OBS, SFILES, HFILES_NO_SRCDIR, HFILES_WITH_SRCDIR,
COMMON_OBS, YYFILES, YYOBJ, generated_files, ALLDEPFILES):
Flatten list and order alphabetically.
* data-directory/Makefile.in: Add comment about file lists
ordering.
(GEN_SYSCALLS_FILES, PYTHON_FILE_LIST): Flatten list and order
alphabetically.

gdb/gdbserver/ChangeLog:

* Makefile.in (SFILES, OBS): Flatten list and order
alphabetically.

gdb/testsuite/ChangeLog:

* gdb.base/default.exp: Fix output of "set language".
gdb/ChangeLog
gdb/Makefile.in
gdb/data-directory/Makefile.in
gdb/gdbserver/ChangeLog
gdb/gdbserver/Makefile.in
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/default.exp