Bug #19336 make clean removes sql/sql_yacc files
Submitted: 25 Apr 2006 14:57 Modified: 1 Jul 2006 10:36
Reporter: CRAIG ARNOLD Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:5.0.x OS:Solaris (Solaris 8)
Assigned to: CPU Architecture:Any

[25 Apr 2006 14:57] CRAIG ARNOLD
Description:
This isn't a mysql bug, but I didn't see any other category for reporting.

When I extract the source and perform the configure, make, make test and make install, everything works as expected.  The problem occurs when I perform a make clean - any subsequent build will fail in sql/sql_yacc.yy because my system doesn't have bison and the Solaris yacc doesn't quite do the trick.  

This isn't that difficult to work around, but I don't know enough about make to fix the makefile.  I would expect that it would restore the directory to the distribution configuration, or perhaps check for bison before removing the files that need it.

How to repeat:
make clean
make install
(fails on sql/sql_yacc.yy line 116)

Suggested fix:
Change configure to build the makefile clean procedures with a check for bison before removing files that depend on it.
[17 May 2006 10:34] Sergei Golubchik
I think 'make clean' should remove it. automake manual says:

"As the GNU Standards aren't always explicit as to which files should be removed by which rule, we've adopted a heuristic that we believe was first formulated by François Pinard:

    * If make built it, and it is commonly something that one would want to rebuild (for instance, a .o file), then mostlyclean should delete it.
    * Otherwise, if make built it, then clean should delete it.
    * If configure built it, then distclean should delete it.
    * If the maintainer built it (for instance, a .info file), then maintainer-clean should delete it. However maintainer-clean should not delete anything that needs to exist in order to run ./configure && make. 

We recommend that you follow this same set of heuristics in your Makefile.am."

As sql_yacc.cc is built by make, it should be deleted by 'make clean'. It means you need to use 'make mostlyclean' to delete .o files but keep sql_yacc.cc.
[17 May 2006 16:49] CRAIG ARNOLD
I agree - OK to close this item.  I found that make distclean cleans the way that I need, so there is a way to safely clean.  The real problem is on my side with sys admin that won't fix Solaris bugs.
[1 Jul 2006 10:36] Valeriy Kravchuk
Closed as there is a solution: make distclean.