Tk Source Code

View Ticket
Login
Ticket UUID: 65c7412f49470543f2990060bc80e41748797eb3
Title: make distclean errors out the second time
Type: Bug Version: core-8-6-branch
Submitter: fvogel Created on: 2018-11-10 09:48:47
Subsystem: 84. Unix Build Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2026-10-22 17:22:39
Resolution: Invalid Closed By: serhiy.storchaka
    Closed on: 2026-10-20 14:08:06
Description:

make distclean errors out the second time:

francois@TM:~/Documents/tcltk/fossil/tk/unix$ make distclean
rm -f *.a *.o libtk* core errs *~ \#* TAGS *.E a.out \
        errors wish tktest lib.exp Tk *.rsrc
rm -rf Makefile config.status config.cache config.log tkConfig.sh \
        tkConfig.h *.plist Tk.framework tk.pc
francois@TM:~/Documents/tcltk/fossil/tk/unix$ make distclean
make: *** No rule to make target 'distclean'. ArrĂȘt.
francois@TM:~/Documents/tcltk/fossil/tk/unix$ 

Is this really expected? At least the error message looks unexpected.

In contrast, repeated incantations of "make clean" work well:

francois@TM:~/Documents/tcltk/fossil/tk/unix$ make clean
rm -f *.a *.o libtk* core errs *~ \#* TAGS *.E a.out \
        errors wish tktest lib.exp Tk *.rsrc
francois@TM:~/Documents/tcltk/fossil/tk/unix$ make clean
rm -f *.a *.o libtk* core errs *~ \#* TAGS *.E a.out \
        errors wish tktest lib.exp Tk *.rsrc
francois@TM:~/Documents/tcltk/fossil/tk/unix$

User Comments: serhiy.storchaka added on 2026-10-20 14:08:06:

This is expected: make distclean removes all files created by configure, including Makefile, as required by the GNU Coding Standards and as in Tcl and Automake-based packages. After that there is no Makefile, so make cannot know any target. Run configure again, or use make clean if the Makefile should be kept.


bll added on 2018-11-10 17:21:03:
If you will notice, 'make distclean' removes 'Makefile', as 
it is re-created by configure. 

I think this is a bit unusual.  
It's been a while since I have been building many packages manually (and
I've worked with hundreds), and I can't really recall that many packages
actually remove the Makefile, even when there is a Makefile.in.

It would be ideal to keep the Makefile around if possible so that 
'make distclean' would always work.  It is a bit annoying.