summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/make/wc.mk40
1 files changed, 40 insertions, 0 deletions
diff --git a/support/make/wc.mk b/support/make/wc.mk
new file mode 100644
index 0000000000..476502f2b1
--- /dev/null
+++ b/support/make/wc.mk
@@ -0,0 +1,40 @@
+############################################################-*-Makefile-*-####
+# WC - Count Bytes, Words and Lines
+##############################################################################
+# $Id$
+
+##############################################################################
+# Usage
+#
+# make wc [FLAGS=<flags>] [FILES=<files>]"
+#
+##############################################################################
+# Examples
+#
+# Count lines in all source files:
+#
+# make wc
+#
+#
+# Count lines in the compiler source files:
+#
+# make wc FILES='$(COMPILER_SOURCES)'
+#
+##############################################################################
+
+##############################################################################
+# Variables
+
+WC_BINARY ?= $(WC)
+WC_FLAGS ?= $(FLAGS)
+WC_FILES ?= $(if $(FILES),$(FILES),$(PROJECT_SOURCES))
+
+##############################################################################
+# Rules
+
+wc :
+ @$(WC_BINARY) $(WC_FLAGS) $(WC_FILES)
+
+.PHONY : wc
+
+##############################################################################