summaryrefslogtreecommitdiff
path: root/support/make
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-02-15 00:55:49 +0000
committerpaltherr <paltherr@epfl.ch>2003-02-15 00:55:49 +0000
commit71da7497b07c384e38585fd18e21e0e58747d884 (patch)
treea6636249c052a15fdd893d97b21549197371a8e2 /support/make
parent413b4edac32ab0397d0bd3c9f4fd60728a6b9866 (diff)
downloadscala-71da7497b07c384e38585fd18e21e0e58747d884.tar.gz
scala-71da7497b07c384e38585fd18e21e0e58747d884.tar.bz2
scala-71da7497b07c384e38585fd18e21e0e58747d884.zip
- Added exec.mk
Diffstat (limited to 'support/make')
-rw-r--r--support/make/exec.mk42
1 files changed, 42 insertions, 0 deletions
diff --git a/support/make/exec.mk b/support/make/exec.mk
new file mode 100644
index 0000000000..b0f9c518a1
--- /dev/null
+++ b/support/make/exec.mk
@@ -0,0 +1,42 @@
+############################################################-*-Makefile-*-####
+# EXEC - Execute Command
+##############################################################################
+# $Id$
+
+##############################################################################
+# Usage
+#
+# make exec CMD=<command>
+#
+##############################################################################
+# Examples
+#
+# Print names of all source files:
+#
+# make exec CMD='echo $(PROJECT_SOURCES)'
+#
+#
+# Execute a java program with the project classpath:
+#
+# make exec CMD='java -cp $(PROJECT_CLASSPATH) scalac.Main'
+#
+##############################################################################
+
+##############################################################################
+# Variables
+
+EXEC_CMD ?= $(CMD)
+
+##############################################################################
+# Rules
+
+exec :
+ @if [ -z '$(EXEC_CMD)' ]; then \
+ $(ECHO) "Usage: $(MAKE) $@ CMD=<command>"; \
+ exit 1; \
+ fi
+ @$(EXEC_CMD)
+
+.PHONY : exec
+
+##############################################################################