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

405cleanup 405  (350)  406a
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 406.

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

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

Defines:
clean, never used.

Uses FIND 432 and FINDCLEAN 405.

Produce the directory as it was after distribution.

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

Defines:
distclean, used in chunks 413 and 423.

Uses FIND 432, FINDCLEAN 405, and RMrecursive 432.