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

SCM Repository

[diderot] Annotation of /trunk/mk/clean-rules.gmk
ViewVC logotype

Annotation of /trunk/mk/clean-rules.gmk

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1113 - (view) (download)

1 : jhr 123 # Common makerules for cleaning directory trees.
2 :     #
3 : jhr 1113 # COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)
4 : jhr 123 # 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 : jhr 1113 # .o files, .so files, .a files, .dSYM directories
13 :     # and the $(TARGET).
14 : jhr 123 # DISTCLEAN_FILES -- extra files to remove for distclean target
15 :     # The default is to remove Makefile.
16 :     # DEVCLEAN_FILES -- extra files to remove for devclean target
17 :     #
18 :    
19 :     CLEAN_FILES += $(wildcard *.o) \
20 :     $(wildcard *.so) \
21 :     $(wildcard *.a) \
22 : jhr 1113 $(wildcard *.dSYM) \
23 : jhr 123 $(TARGET)
24 :     DISTCLEAN_FILES += Makefile
25 :    
26 :     .PHONY: sub-clean local-clean clean
27 :     sub-clean:
28 :     dirs="$(CLEAN_SUBDIRS)"; \
29 :     if test -n "$$dirs" ; then \
30 :     for dir in $$dirs ; do \
31 :     (cd $$dir && $(MAKE) clean) \
32 :     done \
33 :     fi
34 :    
35 :     local-clean:
36 : jhr 1113 -rm -rf $(CLEAN_FILES)
37 : jhr 123 find . \( -name .cm -exec rm -rf {} \; -prune -print \)
38 :    
39 :     clean: sub-clean local-clean
40 :    
41 :     .PHONY: sub-distclean local-distclean distclean
42 :     sub-distclean:
43 :     dirs="$(CLEAN_SUBDIRS)"; \
44 :     if test -n "$$dirs" ; then \
45 :     for dir in $$dirs ; do \
46 :     (cd $$dir && $(MAKE) distclean) \
47 :     done \
48 :     fi
49 :    
50 :     local-distclean: local-clean
51 :     -rm -rf $(DISTCLEAN_FILES)
52 :    
53 :     distclean: sub-distclean local-distclean
54 :    
55 :     .PHONY: sub-devclean local-devclean devclean
56 :     sub-devclean:
57 :     dirs="$(CLEAN_SUBDIRS)"; \
58 :     if test -n "$$dirs" ; then \
59 :     for dir in $$dirs ; do \
60 :     (cd $$dir && $(MAKE) devclean) \
61 :     done \
62 :     fi
63 :    
64 :     local-devclean: local-distclean
65 :     -rm -rf $(DEVCLEAN_FILES)
66 :    
67 :     devclean: sub-devclean local-devclean
68 :    

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