28.11 Cleaning up

For the moment we do not clean everything but leave out some directories of the old MyAlps tree so that we do not need to re-get those files from a remote CVS repository in case we need them.

The idea is, remove everything that does not have extension .nw. There are, however, some exceptions listed at the beginning of the FIND command below, in particular we do not remove .tex and .bib files in the PROJECTROOT directory.

There are several files in a directory that are precious which should not be removed. Typically, one would not like to remove the directories related to the version control system.

The variable FINDCLEAN is used to filter out the files that should be kept. If need arises I could be adapted in Makefile.def.nw through

myclean:  
        make FINDCLEAN="! -name ’*.pamphlet’ ... " clean

400cleanup 400  (346)  401a
FINDCLEAN=! -name ’GPL’ \
          ! -name ’README’ \
          ! -name ’ChangeLog’ \
          ! -regex ’\./Makefile’ \
          ! -name ’.cvsignore’ \
          ! -regex ’.*/CVS/.*’ \
          ! -regex ’.*/\.svn/.*’ \
          ! -regex ’.*/\{arch\}/.*’ \
          ! -regex ’.*/\.arch-ids/.*’ \
          ! -regex ’.*/\.arch-inventory’ \
          ! -regex ’.*/\+\+.*’ \
          ! -regex ’.*/_darcs/.*’ \
          ! -name ’*.nw’

Defines:
FINDCLEAN, used in chunk 401.

While distclean removes almost to a state as it was after unpacking the original distribution, clean also keeps compiled libraries and compiled documentation.

401acleanup 400+   (346)  400  401b
clean:
        @echo =============== CLEAN ===============
        ($(FIND) . -type f \
          ! -name ’lib*.al’ \
          ! -name ’lib*.a’ \
          ! -regex ’\./doc/.*’ \
          $(FINDCLEAN) -print -exec $(RM) {} \;)

Defines:
clean, never used.

Uses FIND 428 and FINDCLEAN 400.

Produce the directory as it was after distribution.

401bcleanup 400+   (346)  401a
distclean:
        @echo =============== DISTCLEAN ===============
        -$(RMrecursive) lib doc
        ($(FIND) . -type f $(FINDCLEAN) -print -exec $(RM) {} \;)

Defines:
distclean, used in chunks 408 and 418.

Uses FIND 428, FINDCLEAN 400, and RMrecursive 428.