summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--support/make/wc.mk40
2 files changed, 41 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index f5b6ee9218..aaa7ff40f6 100644
--- a/Makefile
+++ b/Makefile
@@ -122,6 +122,7 @@ compiler : .latest-compiler
include $(ROOT)/support/make/exec.mk
include $(ROOT)/support/make/grep.mk
+include $(ROOT)/support/make/wc.mk
##############################################################################
# JC - compile java files
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
+
+##############################################################################