Added an automatic computation of the revision number (which is
[selector.git] / Makefile
index 0c875d6..9838c51 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,9 @@
+
 #
 #  selector is a simple shell command for selection of strings with a
 #  dynamic pattern-matching.
 #
-#  Copyright (c) 2008 Francois Fleuret
+#  Copyright (c) 2009 Francois Fleuret
 #  Written by Francois Fleuret <francois.fleuret@idiap.ch>
 #
 #  This file is part of selector.
 
 LDFLAGS=-lcurses
 
+REVISION_NUMBER=$(shell git log | grep ^commit | wc -l)
+
 ifeq ($(DEBUG),yes)
   OPTIMIZE_FLAG = -ggdb3 -DDEBUG
 else
   OPTIMIZE_FLAG = -ggdb3 -O3
 endif
 
-CXXFLAGS = -Wall $(OPTIMIZE_FLAG) $(PROFILE_FLAG) $(CXXGLPK)
+CXXFLAGS = -DREVISION_NUMBER=$(REVISION_NUMBER) -Wall $(OPTIMIZE_FLAG)
 
 all: selector