Working with Bernie Innocenti, I completely overhauled the Makefile with
the goal of having it be able to build static versions of the library
which I need to run it on my cluster. In general, this has simplified
the Makefile. I had to make one small change to the disorder file in the
process.
-CXX = g++
-CFLAGS = -O3
-OBJECTS = disorder.o md5.o
+CXXFLAGS = -O3
+CFLAGS = $(CXXFLAGS)
+OBJECTS = wikiq.o md5.o disorder.o
all: wikiq
-wikiq: wikiq.cpp $(OBJECTS)
- $(CXX) $(CFLAGS) -lpcrecpp -lexpat wikiq.cpp $(OBJECTS) -o wikiq
+wikiq: $(OBJECTS)
+ $(CXX) $(CXXFLAGS) $(OBJECTS) -lpcrecpp -lpcre -lexpat -o wikiq
-disorder.o: disorder.c disorder.h
- $(CXX) $(CFLAGS) -c disorder.c
-
-md5.o: md5.c md5.h
- $(CXX) $(CFLAGS) -c md5.c -lm
+disorder.o: disorder.h
+md5.o: md5.h
clean:
rm -f wikiq $(OBJECTS)
+static: $(OBJECTS)
+ $(CXX) $(CXXFLAGS) $(OBJECTS) -static -lpcrecpp -lpcre -lexpat -o wikiq
+
gprof:
$(MAKE) CFLAGS=-pg wikiq
#ifndef __DISORDER_H_
#define __DISORDER_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Max number of bytes (i.e., tokens) */
#define LIBDO_MAX_BYTES 256
/** Returns the ratio of entropy to maxentropy */
float get_entropy_ratio(void);
+#ifdef __cplusplus
+};
+#endif
+
#endif