From: Benjamin Mako Hill Date: Mon, 2 May 2011 23:55:37 +0000 (-0400) Subject: made changes necessary to build a static version X-Git-Url: https://projects.mako.cc/source/wikiq/commitdiff_plain/f697a134d5d82dbc79638cd625f15c0252cd5afe made changes necessary to build a static version 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. --- diff --git a/Makefile b/Makefile index 12459ed..cc0e56f 100644 --- a/Makefile +++ b/Makefile @@ -1,21 +1,21 @@ -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 diff --git a/disorder.h b/disorder.h index 3458774..91ec47d 100644 --- a/disorder.h +++ b/disorder.h @@ -24,6 +24,10 @@ #ifndef __DISORDER_H_ #define __DISORDER_H_ +#ifdef __cplusplus +extern "C" { +#endif + /** Max number of bytes (i.e., tokens) */ #define LIBDO_MAX_BYTES 256 @@ -59,4 +63,8 @@ float get_max_entropy(void); /** Returns the ratio of entropy to maxentropy */ float get_entropy_ratio(void); +#ifdef __cplusplus +}; +#endif + #endif