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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3349 - (view) (download)

1 : jhr 1538 # Common makerules for cleaning directory trees.
2 :     #
3 : jhr 3349 # 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 1538 # 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 :     # .o files, .so files, .a files, .dSYM directories
15 :     # and the $(TARGET).
16 :     # 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 : jhr 1656 CLEAN_FILES += bmark-seq.c bmark-par.c bmark-cl.c bmark-cl.cl \
22 :     $(wildcard *.o) \
23 :     $(wildcard *.txt) \
24 :     $(wildcard *.nrrd) \
25 :     $(TARGETS)
26 :    
27 : jhr 1538 DISTCLEAN_FILES += Makefile
28 :    
29 :     .PHONY: sub-clean local-clean clean
30 :     sub-clean:
31 :     dirs="$(CLEAN_SUBDIRS)"; \
32 :     if test -n "$$dirs" ; then \
33 :     for dir in $$dirs ; do \
34 :     (cd $$dir && $(MAKE) clean) \
35 :     done \
36 :     fi
37 :    
38 :     local-clean:
39 :     -rm -rf $(CLEAN_FILES)
40 :     find . \( -name .cm -exec rm -rf {} \; -prune -print \)
41 :    
42 :     clean: sub-clean local-clean
43 :    
44 :     .PHONY: sub-distclean local-distclean distclean
45 :     sub-distclean:
46 :     dirs="$(CLEAN_SUBDIRS)"; \
47 :     if test -n "$$dirs" ; then \
48 :     for dir in $$dirs ; do \
49 :     (cd $$dir && $(MAKE) distclean) \
50 :     done \
51 :     fi
52 :    
53 :     local-distclean: local-clean
54 :     -rm -rf $(DISTCLEAN_FILES)
55 :    
56 :     distclean: sub-distclean local-distclean
57 :    
58 :     .PHONY: sub-devclean local-devclean devclean
59 :     sub-devclean:
60 :     dirs="$(CLEAN_SUBDIRS)"; \
61 :     if test -n "$$dirs" ; then \
62 :     for dir in $$dirs ; do \
63 :     (cd $$dir && $(MAKE) devclean) \
64 :     done \
65 :     fi
66 :    
67 :     local-devclean: local-distclean
68 :     -rm -rf $(DEVCLEAN_FILES)
69 :    
70 :     devclean: sub-devclean local-devclean
71 :    

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