Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/pure-cfg/mk/clean-rules.gmk
ViewVC logotype

Annotation of /branches/pure-cfg/mk/clean-rules.gmk

Parent Directory Parent Directory | Revision Log Revision Log


Revision 123 - (view) (download)
Original Path: trunk/mk/clean-rules.gmk

1 : jhr 123 # Common makerules for cleaning directory trees.
2 :     #
3 :     # COPYRIGHT (c) 2007 The Manticore Project (manticore.cs.uchicago.edu)
4 :     # All rights reserved.
5 :     #
6 :     # This file defines standard rules for the clean, distclean, and devclean
7 :     # targets. To use, define the following make variables:
8 :     #
9 :     # CLEAN_SUBDIRS -- subdirectories to recursively clean
10 :     # CLEAN_FILES -- extra files to remove for clean target
11 :     # The default is to remove CM subdirectories,
12 :     # .o files, .mbi files, and the $(TARGET).
13 :     # DISTCLEAN_FILES -- extra files to remove for distclean target
14 :     # The default is to remove Makefile.
15 :     # DEVCLEAN_FILES -- extra files to remove for devclean target
16 :     #
17 :    
18 :     CLEAN_FILES += $(wildcard *.o) \
19 :     $(wildcard *.so) \
20 :     $(wildcard *.a) \
21 :     $(wildcard *.mbi) \
22 :     $(TARGET)
23 :     DISTCLEAN_FILES += Makefile
24 :    
25 :     .PHONY: sub-clean local-clean clean
26 :     sub-clean:
27 :     dirs="$(CLEAN_SUBDIRS)"; \
28 :     if test -n "$$dirs" ; then \
29 :     for dir in $$dirs ; do \
30 :     (cd $$dir && $(MAKE) clean) \
31 :     done \
32 :     fi
33 :    
34 :     local-clean:
35 :     -rm -f $(CLEAN_FILES)
36 :     find . \( -name .cm -exec rm -rf {} \; -prune -print \)
37 :    
38 :     clean: sub-clean local-clean
39 :    
40 :     .PHONY: sub-distclean local-distclean distclean
41 :     sub-distclean:
42 :     dirs="$(CLEAN_SUBDIRS)"; \
43 :     if test -n "$$dirs" ; then \
44 :     for dir in $$dirs ; do \
45 :     (cd $$dir && $(MAKE) distclean) \
46 :     done \
47 :     fi
48 :    
49 :     local-distclean: local-clean
50 :     -rm -rf $(DISTCLEAN_FILES)
51 :    
52 :     distclean: sub-distclean local-distclean
53 :    
54 :     .PHONY: sub-devclean local-devclean devclean
55 :     sub-devclean:
56 :     dirs="$(CLEAN_SUBDIRS)"; \
57 :     if test -n "$$dirs" ; then \
58 :     for dir in $$dirs ; do \
59 :     (cd $$dir && $(MAKE) devclean) \
60 :     done \
61 :     fi
62 :    
63 :     local-devclean: local-distclean
64 :     -rm -rf $(DEVCLEAN_FILES)
65 :    
66 :     devclean: sub-devclean local-devclean
67 :    

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0