chiark / gitweb /
generate: Mention suppressions when warning re VAR vs &VAR
[subdirmk.git] / clean.sd.mk
1 # subdirmk - useful rules for clean target
2 #  Copyright 2019 Mark Wooding
3 #  Copyright 2019 Ian Jackson
4 # SPDX-License-Identifier: LGPL-2.0-or-later
5
6 &# Usage:
7 &#   &:include subdirmk/clean.sd.mk
8 &# (probably in Suffix.sd.mk)
9 &#
10 &# Provides a per-directory `clean' target, which deletes all the files
11 &# in &CLEAN.  &OBJECTS, &DEPFILES and &TARGETS are automatically deleted.
12 &#
13 &# If you want to delete a directory, extend the target with
14 &#   &/clean::
15 &#      $(RM) -r somethingn
16 &# ($(RM) conventionally contains `-f'.)
17
18 &CLEAN += & *~ .*~ *.tmp
19 &CLEAN += $(&OBJECTS)
20 &CLEAN += $(&TARGETS)
21
22 &TARGETS_clean +=
23
24 &/clean::
25         $(RM) $(&CLEAN)