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

SCM Repository

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

Annotation of /branches/vis15/mk/clean-rules.gmk

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3348 - (view) (download)

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

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