summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rw-r--r--cacount.cpp6
2 files changed, 9 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 221f015..e6660ee 100644
--- a/Makefile
+++ b/Makefile
@@ -2,5 +2,8 @@ CXX=g++ -std=c++0x -O3 -Wall -Wextra -Werror -lpthread
all: cacount
+cacount_%: cacount.cpp
+ $(CXX) -DBIT_WIDTH=$(shell echo $@ | egrep -o '[^_]*$$') -fwhole-program $< -o $@
+
clean:
- -rm cacount *~ \ No newline at end of file
+ -rm cacount *~
diff --git a/cacount.cpp b/cacount.cpp
index 07863ca..26b2069 100644
--- a/cacount.cpp
+++ b/cacount.cpp
@@ -15,8 +15,12 @@
using namespace std;
+#ifndef BIT_WIDTH
+#define BIT_WIDTH 31
+#endif
+
typedef uint32_t State;
-const State logState = 31;
+const State logState = BIT_WIDTH;
const State maxState = 1 << logState;
bitset<8> rule(110);
contact: Jan Huwald // Impressum