<commit_before>CPP_SOURCES=ksp_plugin/plugin.cpp ksp_plugin/physics_bubble.cpp
CC_SOURCES=$(wildcard serialization/*.cc)
#$(wildcard *.cpp) $(wildcard quantities/*.cpp) $(wildcard base/*.cpp) $(wildcard integrators/*.cpp) $(wildcard ksp_plugin/*.cpp) $(wildcard geometry/*.cpp) $(wildcard physics/*.cpp) $(wildcard benchmarks/*.cpp)
PROTO_SOURCES=$(wildcard */*.proto)

OBJECTS=$(CPP_SOURCES:.cpp=.o) $(CC_SOURCES:.cc=.o)
VERSION_HEADER=base/version.hpp
PROTO_HEADERS=$(PROTO_SOURCES:.proto=.pb.h)

LIB_DIR=lib
LIB=$(LIB_DIR)/principia.so

INCLUDE=-I. -I../glog/src -I../protobuf-2.6.1/src -I../benchmark/include -I../gmock-1.7.0/gtest/include -I../gmock-1.7.0/include

CPPC=clang++
SHARED_ARGS=-std=c++1y -stdlib=libc++ -O3 -g -ggdb -m64 -mmmx -msse -msse2 -m3dnow -fPIC -fexceptions -ferror-limit=0 # -Wall -Wpedantic 
COMPILE_ARGS=-c $(SHARED_ARGS) $(INCLUDE)
LINK_ARGS=-shared $(SHARED_ARGS) 
LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):/opt/principa/glog/.libs:/opt/principa/benchmark/src/:/opt/principa/protobuf/src/.libs:/opt/principa/gmock-1.7.0/lib/.libs/
LIBS=-lprotobuf -lprotoc -lglog -lpthread 

$(LIB): $(VERSION_HEADER) $(PROTO_HEADERS) $(OBJECTS) Makefile $(LIB_DIR)
	$(CPPC) $(LINK_ARGS) $(OBJECTS) $(INCLUDE) $(LIBS) -o $(LIB)

$(LIB_DIR):
	mkdir -p $(LIB_DIR)

$(VERSION_HEADER): .git
	./generate_version_header.sh

%.pb.h: %.proto
	../protobuf/src/protoc $< --cpp_out=.

%.o: %.cpp Makefile
	$(CPPC) $(COMPILE_ARGS) $< -o $@ 

%.o: %.cc Makefile
	$(CPPC) $(COMPILE_ARGS) $< -o $@ 

clean:
	rm $(LIB) $(PROTO_HEADERS) $(OBJECTS); true<commit_msg>Not quite working attempt at making statically linked shared library.<commit_after>CPP_SOURCES=ksp_plugin/plugin.cpp ksp_plugin/physics_bubble.cpp
CC_SOURCES=$(wildcard serialization/*.cc)
#$(wildcard *.cpp) $(wildcard quantities/*.cpp) $(wildcard base/*.cpp) $(wildcard integrators/*.cpp) $(wildcard ksp_plugin/*.cpp) $(wildcard geometry/*.cpp) $(wildcard physics/*.cpp) $(wildcard benchmarks/*.cpp)
PROTO_SOURCES=$(wildcard */*.proto)

OBJECTS=$(CPP_SOURCES:.cpp=.o) $(CC_SOURCES:.cc=.o)
VERSION_HEADER=base/version.hpp
PROTO_HEADERS=$(PROTO_SOURCES:.proto=.pb.h)

LIB_DIR=lib
LIB=$(LIB_DIR)/principia.so

INCLUDE=-I. -I../glog/src -I../protobuf-2.6.1/src -I../benchmark/include -I../gmock-1.7.0/gtest/include -I../gmock-1.7.0/include

CPPC=clang++
SHARED_ARGS=-std=c++1y -stdlib=libc++ -O3 -g -ggdb -m64 -mmmx -msse -msse2 -m3dnow -fPIC -fexceptions -ferror-limit=0 # -Wall -Wpedantic 
COMPILE_ARGS=-c $(SHARED_ARGS) $(INCLUDE)
LINK_ARGS=-shared -static $(SHARED_ARGS) 
LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):/opt/principa/glog/.libs:/opt/principa/benchmark/src/:/opt/principa/protobuf/src/.libs:/opt/principa/gmock-1.7.0/lib/.libs/
LIBS=-lc++ -lprotobuf -lprotoc -lglog -lpthread 

$(LIB): $(VERSION_HEADER) $(PROTO_HEADERS) $(OBJECTS) Makefile $(LIB_DIR)
	$(CPPC) $(LINK_ARGS) $(OBJECTS) $(INCLUDE) $(LIBS) -o $(LIB)

$(LIB_DIR):
	mkdir -p $(LIB_DIR)

$(VERSION_HEADER): .git
	./generate_version_header.sh

%.pb.h: %.proto
	../protobuf/src/protoc $< --cpp_out=.

%.o: %.cpp Makefile
	$(CPPC) $(COMPILE_ARGS) $< -o $@ 

%.o: %.cc Makefile
	$(CPPC) $(COMPILE_ARGS) $< -o $@ 

clean:
	rm $(LIB) $(PROTO_HEADERS) $(OBJECTS); true
{'fraction_non_alphanumeric': 0.2115021998742929, 'fraction_numerical': 0.011942174732872407, 'mean_word_length': 4.694096601073345, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4947740', 'n_tokens_mistral': 1398, 'n_tokens_neox': 1291, 'n_words': 214}