Wireshark-dev: Re: [Wireshark-dev] Any reason GENERATED_C_FILES isn't cleaned in epan/dissector
From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Mon, 20 Aug 2007 14:45:33 -0700
Stephen Fisher wrote:
Is there any reason that under Unix in epan/dissectors/ the target
GENERATED_C_FILES is not included when doing make clean?

Because we include some generated files with the distribution, so that, if the user doesn't have certain tools, they can still at least compile Wireshark from the source tarball.

The way to clean up *all* generated files is "make maintainerclean".

automake attempts to generate Makefile.in files that will generate Makefiles that follow the GNU Makefile conventions:

	http://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html

The standard targets:

	http://www.gnu.org/prep/standards/html_node/Standard-Targets.html#Standard-Targets

include, to quote that page:

‘clean’
Delete all files in the current directory that are normally created by building the program. Also delete files in other directories if they are created by this makefile. However, don't delete the files that record the configuration. Also preserve files that could be made by building, but normally aren't because the distribution comes with them. There is no need to delete parent directories that were created with ‘mkdir -p’, since they could have existed anyway.

Delete .dvi files here if they are not part of the distribution.

‘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.
‘mostlyclean’
Like ‘clean’, but may refrain from deleting a few files that people normally don't want to recompile. For example, the ‘mostlyclean’ target for GCC does not delete libgcc.a, because recompiling it is rarely necessary and takes a lot of time.
‘maintainer-clean’
Delete almost everything that can be reconstructed with this Makefile. This typically includes everything deleted by distclean, plus more: C source files produced by Bison, tags tables, Info files, and so on.

The reason we say “almost everything” is that running the command ‘make maintainer-clean’ should not delete configure even if configure can be remade using a rule in the Makefile. More generally, ‘make maintainer-clean’ should not delete anything that needs to exist in order to run configure and then begin to build the program. Also, there is no need to delete parent directories that were created with ‘mkdir -p’, since they could have existed anyway. These are the only exceptions; maintainer-clean should delete everything else that can be rebuilt.

The ‘maintainer-clean’ target is intended to be used by a maintainer of the package, not by ordinary users. You may need special tools to reconstruct some of the files that ‘make maintainer-clean’ deletes. Since these files are normally included in the distribution, we don't take care to make them easy to reconstruct. If you find you need to unpack the full distribution again, don't blame us.

To help make users aware of this, the commands for the special maintainer-clean target should start with these two:

          @echo 'This command is intended for maintainers to use; it'
          @echo 'deletes files that may need special tools to rebuild.'