better separate 'main' targets
[k8jam.git] / defaults / Jambase.clean
blob5f620ce781e931d417fabfec4e47a86839fb12cc
1 # /Clean clean : targets ;
3 # Removes existing _targets_ when _clean_ is built. clean is not a dependency
4 # of all, and must be built explicitely for targets to be removed
7 actions piecemeal together existing Clean {
8 $(RM) $(>)
12 rule RmTemps {
13 Temporary $(>) ;
16 actions quietly updated piecemeal together RmTemps {
17 $(RM) $(>)
21 # convert 'target clean' to 'target_clean'
22 rule --normalize-cleans-- {
23 local _t _pt _nt ;
24 _pt = ; # prev target
25 _nt = ; # new JAM_TARGETS
26 for _t in $(JAM_TARGETS) {
27 if $(_t) = "clean" {
28 if $(_pt) {
29 # have previous target
30 _nt += $(_pt)_clean ;
31 } else {
32 _nt += $(_t) ;
34 _pt = ;
35 continue;
37 if $(_pt) { _nt += $(_pt) ; }
38 _pt = $(_t) ;
40 if $(_pt) { _nt += $(_pt) ; }
41 #Echo "new targets:" $(_nt) ;
42 JAM_TARGETS = $(_nt) ;
46 if "clean" in $(JAM_TARGETS) {
47 --normalize-cleans-- ;