gdb/Makefile.in: move ALLDEPFILES earlier in Makefile.in
If I do 'make tags' in the gdb build directory, the tags target does
complete, but I see these warnings:
../../src/gdb/arm.c: No such file or directory
../../src/gdb/arm-get-next-pcs.c: No such file or directory
../../src/gdb/arm-linux.c: No such file or directory
The reason for this is the ordering of build rules and make variables
in gdb/Makefile.in, specifically, the placement of the tags related
rules, and the ALLDEPFILES variable. The ordering is like this:
TAGFILES_NO_SRCDIR = .... $(ALLDEPFILES) ....
TAGS: $(TAGFILES_NO_SRCDIR) ....
# Recipe uses $(TAGFILES_NO_SRCDIR)
tags: TAGS
ALLDEPFILES = .....
When the TAGS rule is parsed TAGFILES_NO_SRCDIR is expanded, which
then expands ALLDEPFILES, which, at that point in the Makefile is
undefined, and so expands to the empty string. As a result TAGS does
not depend on any file listed in ALLDEPFILES.
However, when the TAGS recipe is invoked ALLDEPFILES is now defined.
As a result, all the files in ALLDEPFILES are passed to the etags
program.
The ALLDEPFILES references three files, arm.c, arm-get-next-pcs.c, and
arm-linux.c, which are actually in the gdb/arch/ directory, but, in
ALLDEPFILES these files don't include the arch/ prefix. As a result,
the etags program ends up looking for these files in the wrong
location.
As ALLDEPFILES is only used by the TAGS rule, this mistake was not
previously noticed (the TAGS rule itself was broken until a recent
commit).
In this commit I make two changes, first, I move ALLDEPFILES to be
defined before TAGFILES_NO_SRCDIR, this means that the TAGS rule will
depend on all the files in ALLDEPFILES. With this change the TAGS
rule now breaks complaining that there's no rule to build the 3 files
mentioned above.
Next, I have added all *.c files in gdb/arch/ to ALLDEPFILES,
including their arch/ prefix, and removed the incorrect (missing arch/
prefix) references.
With these two changes the TAGS (or tags if you prefer) target now
builds without any errors or warnings.