summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-02-14 15:21:51 +0000
committerpaltherr <paltherr@epfl.ch>2003-02-14 15:21:51 +0000
commit51f6f363f0bfbcbcb9aaabfffe29eed552cfe168 (patch)
treea965d064a8bb3e67cc45efdb05901ab3d10125c1 /support
parent21b147f7caf8b558b00044f493cf9da392c7e30e (diff)
downloadscala-51f6f363f0bfbcbcb9aaabfffe29eed552cfe168.tar.gz
scala-51f6f363f0bfbcbcb9aaabfffe29eed552cfe168.tar.bz2
scala-51f6f363f0bfbcbcb9aaabfffe29eed552cfe168.zip
- Added grep.mk
Diffstat (limited to 'support')
-rw-r--r--support/make/grep.mk46
1 files changed, 46 insertions, 0 deletions
diff --git a/support/make/grep.mk b/support/make/grep.mk
new file mode 100644
index 0000000000..e6a78a61f5
--- /dev/null
+++ b/support/make/grep.mk
@@ -0,0 +1,46 @@
+############################################################-*-Makefile-*-####
+# GREP - search regular expressions
+##############################################################################
+# $Id$
+
+##############################################################################
+# Usage
+#
+# make grep [FLAGS=<flags>] REGEXP=<regexp> [FILES=<files>]"
+#
+##############################################################################
+# Examples
+#
+# Search for "runtime" in all source files:
+#
+# make grep REGEXP=runtime
+#
+#
+# Search for "runtime" in the compiler source files:
+#
+# make grep REGEXP=runtime FILES=\$\(COMPILER_SOURCES\)
+#
+##############################################################################
+
+##############################################################################
+# Variables
+
+GREP_BINARY ?= $(GREP)
+GREP_FLAGS ?= $(FLAGS)
+GREP_REGEXP ?= $(REGEXP)
+GREP_FILES ?= $(if $(FILES),$(FILES),$(PROJECT_SOURCES))
+
+##############################################################################
+# Rules
+
+grep :
+ @if [ -z '$(GREP_REGEXP)' ]; then \
+ $(ECHO) "Usage:" \
+ "$(MAKE) grep [FLAGS=<flags>] REGEXP=<regexp> [FILES=<files>]";\
+ exit 1; \
+ fi
+ @$(GREP_BINARY) $(GREP_FLAGS) '$(GREP_REGEXP)' $(GREP_FILES)
+
+.PHONY : grep
+
+##############################################################################