summaryrefslogtreecommitdiff
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
parent21b147f7caf8b558b00044f493cf9da392c7e30e (diff)
downloadscala-51f6f363f0bfbcbcb9aaabfffe29eed552cfe168.tar.gz
scala-51f6f363f0bfbcbcb9aaabfffe29eed552cfe168.tar.bz2
scala-51f6f363f0bfbcbcb9aaabfffe29eed552cfe168.zip
- Added grep.mk
-rw-r--r--Makefile11
-rw-r--r--support/make/grep.mk46
2 files changed, 54 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 1405130c2a..41cbf5ee25 100644
--- a/Makefile
+++ b/Makefile
@@ -82,10 +82,11 @@ PICO_FLAGS += -make -source 1.4
# Functions
RUN = echo $(1); $(1) || exit $$?
-MAKE += --no-print-directory
LOOKUP = $(if $($(source)_$(1)),$($(source)_$(1)),$($(1)))
READLIST = $(shell cat $(1) | grep -v "^\#")
+make += $(MAKE) MAKELEVEL=$(MAKELEVEL) --no-print-directory
+
##############################################################################
# Commands
@@ -93,7 +94,7 @@ all : compiler
force :
$(RM) -f .latest-compiler
- @$(MAKE) all
+ @$(make) all
clean :
$(RM) -f .latest-compiler
@@ -114,10 +115,14 @@ compiler : .latest-compiler
# Targets
.latest-compiler : $(COMPILER_SOURCES)
- @$(MAKE) .do-jc source=COMPILER JC_FILES='$?'
+ @$(make) .do-jc source=COMPILER JC_FILES='$?'
touch $@
##############################################################################
+
+include $(ROOT)/support/make/grep.mk
+
+##############################################################################
# JC - compile java files
##############################################################################
#
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
+
+##############################################################################