[Moved to Automake List] On Jul 31, 2013, at 8:00 AM, Peng Yu <pengyu...@gmail.com> wrote:
> On Tue, Jul 30, 2013 at 7:25 PM, Gary V. Vaughan <g...@vaughan.pe> wrote: >> >> On Jul 31, 2013, at 5:15 AM, Peng Yu <pengyu...@gmail.com> wrote: >>> http://www.gnu.org/software/automake/manual/html_node/Creating-amhello.html >>> >>> I followed the above instructions to create amhello. After running >>> `autoreconf -i` and `make`, it generated a lot of files. I tried to >>> remove all newly generated files by `make distclean`. But this did not >>> remove all the newly generated files. Could anybody let me know how to >>> remove the newly generated files? Thanks. >> >> >> $ make maintainer-clean > > No. if maintainer-clean is not removing files that were generated by running make; then MAINTAINERCLEANFILES is not set up properly, add the unexpected file droppings with: MAINTAINERCLEANFILES = list of make generated files for maintainer cleanup else if maintainer-clean is not removing files that you created by other means; then that is to be expected - how can Automake know where they came from, and whether you want them removed or not? else if you are feeling especially brave; then you can list just the files you want to keep and nuke the rest with a custom rule: ## untested, so make sure you have a backup if you intend to actually run this! MYPRECIOUSFILES = list of files not to remove .PHONY: nuke nuke: for file in `find . -type f -print`; do \ case ' $(MYPRECIOUSFILES) ' in \ *" $$file "*) ;; \ *) rm -f $$file ;; \ esac; \ done else if you put the project in git; then you can remove all the non-version controlled files with: $ git clean -dfx else exit 1 fi # ;) HTH, -- Gary V. Vaughan (gary AT gnu DOT org)