From f697a134d5d82dbc79638cd625f15c0252cd5afe Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Mon, 2 May 2011 19:55:37 -0400 Subject: [PATCH] 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. --- Makefile | 20 ++++++++++---------- disorder.h | 8 ++++++++ 2 files changed, 18 insertions(+), 10 deletions(-) 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 -- 2.30.2