What does make distclean do?

Generally the files that can be cleaned are determined automatically by Automake. Of course, Automake also recognizes some variables that can be defined to specify additional files to clean. These variables are MOSTLYCLEANFILES, CLEANFILES, DISTCLEANFILES, and MAINTAINERCLEANFILES.

Editing your automake.am to specify what gets deleted.

If configure built it, then distclean should delete it.

Source

Short answer make distclean (does not work on ALL programs but most) will remove ALL files made by ./configure and ALL files made by make


According to GNU.org,

‘distclean’

Delete all files in the current directory (or created by this makefile) that are created by configuring or building the program. If you have unpacked the source and built the program without creating any other files, ‘make distclean’ should leave only the files that were in the distribution. However, there is no need to delete parent directories that were created with ‘mkdir -p’, since they could have existed anyway.