Description:
The "distclean" target (and probably others, too) is broken as DIST_SUBDIRS
in the toplevel Makefile.am and storage/Makefile.am contain directories that
are only configured coinditionally so that there might be no Makefile in them.
As the toplevel "distclean" target recursively dives into all DIST_SUBDIR
entries this leads to errors as there is no Makefile in some of these that
would define a "distclean" target.
How to repeat:
Simple testcases:
5.1 > configure && make distclean
...
Making distclean in tools
make[1]: Entering directory `/home/hartmut/projects/mysql/dev/5.1/tools'
make[1]: *** No rule to make target `distclean'. Stop.
make[1]: Leaving directory `/home/hartmut/projects/mysql/dev/5.1/tools'
make: *** [distclean-recursive] Error 1
Full testcase
5.1 > configure && make -k distclean
...make[1]: Entering directory `/home/hartmut/projects/mysql/dev/5.1/tools'
make[1]: *** No rule to make target `distclean'.
make[1]: Leaving directory `/home/hartmut/projects/mysql/dev/5.1/tools'
...
make[1]: Entering directory `/home/hartmut/projects/mysql/dev/5.1/libmysql_r'
make[1]: *** No rule to make target `distclean'.
make[1]: Leaving directory `/home/hartmut/projects/mysql/dev/5.1/libmysql_r'
...
make[2]: Entering directory `/home/hartmut/projects/mysql/dev/5.1/storage/ndb'
make[2]: *** No rule to make target `distclean'.
make[2]: Leaving directory `/home/hartmut/projects/mysql/dev/5.1/storage/ndb'
...
make[2]: Entering directory `/home/hartmut/projects/mysql/dev/5.1/storage/innobase'
make[2]: *** No rule to make target `distclean'.
make[2]: Leaving directory `/home/hartmut/projects/mysql/dev/5.1/storage/innobase'
...
make[2]: Entering directory `/home/hartmut/projects/mysql/dev/5.1/storage/bdb'
make[2]: *** No rule to make target `distclean'.
make[2]: Leaving directory `/home/hartmut/projects/mysql/dev/5.1/storage/bdb'
...
Suggested fix:
For the tools dir just change the last line of the DIST_SUBDIRS assignment
in Makefile.am back from
@bench_dirs@ support-files server-tools tools
to
@bench_dirs@ support-files @tools_dirs@
as it used to be in previous releases?
For libmysql_r -> add and use a @libmysql_r_dir@ variable that is only
set when --enable-thread-safe-client is requested?
For storage/Makefile.am make the MYSQL_STORAGE_ENGINE in
config/ac-macros/storage.m4 maintain the DIST_SUBDIRS list based
on the actual configuration