<commit_before>UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
    CXX=g++
    FUSE=fuse
else
    CXX=clang++
    FUSE=osxfuse
endif
BOOST_LIBS=/usr/local/lib
LDFLAGS= -v -L/usr/local/lib $(BOOST_LIBS)/libboost_filesystem.a \
                             $(BOOST_LIBS)/libboost_system.a \
                             $(BOOST_LIBS)/libboost_program_options.a \
                             $(BOOST_LIBS)/libboost_random.a 
CXXFLAGS_FUSE= -v -I/usr/local/include/$(FUSE)  -DFUSE_USE_VERSION=26
CXXFLAGS= -v -ggdb -std=c++11 -Os -ffast-math -funroll-loops -Wno-ctor-dtor-privacy -I/usr/local/include/boost -Iinclude -D_FILE_OFFSET_BITS=64
SOURCES := $(wildcard src/teasafe/*.cpp)
MAKE_TeaSafe_SRC := $(wildcard src/maketeasafe/*.cpp)
TEST_SRC := $(wildcard src/test/*.cpp)
FUSE_SRC := $(wildcard src/fuse/*.cpp)
CIPHER_SRC := $(wildcard src/cipher/*.cpp)
OBJECTS := $(addprefix obj/,$(notdir $(SOURCES:.cpp=.o)))
OBJECTS_UTIL := $(addprefix obj-maketeasafe/,$(notdir $(MAKE_TeaSafe_SRC:.cpp=.o)))
OBJECTS_TEST := $(addprefix obj-test/,$(notdir $(TEST_SRC:.cpp=.o)))
OBJECTS_FUSE := $(addprefix obj-fuse/,$(notdir $(FUSE_SRC:.cpp=.o)))
OBJECTS_CIPHER := $(addprefix obj-cipher/,$(notdir $(CIPHER_SRC:.cpp=.o)))
TEST_EXECUTABLE=test
MAKETeaSafe_EXECUTABLE=maketeasafe
FUSE_LAYER=teasafe

obj/%.o: src/teasafe/%.cpp
	$(CXX) $(CXXFLAGS) -c -o $@ $<
	
obj-test/%.o: src/test/%.cpp
	$(CXX) $(CXXFLAGS) -c -o $@ $<
	
obj-maketeasafe/%.o: src/maketeasafe/%.cpp
	$(CXX) $(CXXFLAGS) -c -o $@ $<
	
obj-fuse/%.o: src/fuse/%.cpp
	$(CXX) $(CXXFLAGS) $(CXXFLAGS_FUSE) -c -o $@ $<
	
obj-cipher/%.o: src/cipher/%.cpp
	$(CXX) $(CXXFLAGS) $(CXXFLAGS_FUSE) -c -o $@ $<

all: $(SOURCES) $(TEST_SRC) $(CIPHER_SRC) $(TEST_EXECUTABLE) $(FUSE_LAYER) $(MAKETeaSafe_EXECUTABLE)

$(TEST_EXECUTABLE): directoryObj directoryObjTest directoryObjCipher $(OBJECTS) $(OBJECTS_TEST) $(OBJECTS_CIPHER)
	$(CXX) $(LDFLAGS) $(OBJECTS) $(OBJECTS_TEST) $(OBJECTS_CIPHER) -o $@ 
	
$(MAKETeaSafe_EXECUTABLE): directoryObj directoryObjMakeBfs directoryObjCipher $(OBJECTS) $(OBJECTS_UTIL) $(OBJECTS_CIPHER)
	$(CXX) $(LDFLAGS) $(OBJECTS) $(OBJECTS_UTIL) $(OBJECTS_CIPHER) -o $@

$(FUSE_LAYER): directoryObj directoryObjFuse directoryObjCipher $(OBJECTS) $(OBJECTS_FUSE) $(OBJECTS_CIPHER)
	$(CXX) $(LDFLAGS) -l$(FUSE) $(OBJECTS) $(OBJECTS_FUSE) $(OBJECTS_CIPHER) -o $@
	
clean:
	/bin/rm -fr obj obj-maketeasafe obj-test obj-fuse test maketeasafe teasafe obj-cipher
	
directoryObj: 
	/bin/mkdir -p obj
	
directoryObjTest: 
	/bin/mkdir -p obj-test
	
directoryObjMakeBfs: 
	/bin/mkdir -p obj-maketeasafe
	
directoryObjFuse:
	/bin/mkdir -p obj-fuse
	
directoryObjCipher:
	/bin/mkdir -p obj-cipher<commit_msg>moving to lib archive build for ease of future GUI compilation<commit_after>UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
    CXX=g++
    FUSE=fuse
else
    CXX=clang++
    FUSE=osxfuse
endif
BOOST_LIBS=/usr/local/lib
LDFLAGS= -v -L/usr/local/lib $(BOOST_LIBS)/libboost_filesystem.a \
                             $(BOOST_LIBS)/libboost_system.a \
                             $(BOOST_LIBS)/libboost_program_options.a \
                             $(BOOST_LIBS)/libboost_random.a 
CXXFLAGS_FUSE= -v -I/usr/local/include/$(FUSE)  -DFUSE_USE_VERSION=26
CXXFLAGS= -v -ggdb -std=c++11 -Os -ffast-math -funroll-loops -Wno-ctor-dtor-privacy -I/usr/local/include/boost -Iinclude -D_FILE_OFFSET_BITS=64
SOURCES := $(wildcard src/teasafe/*.cpp)
MAKE_TeaSafe_SRC := $(wildcard src/maketeasafe/*.cpp)
TEST_SRC := $(wildcard src/test/*.cpp)
FUSE_SRC := $(wildcard src/fuse/*.cpp)
CIPHER_SRC := $(wildcard src/cipher/*.cpp)
OBJECTS := $(addprefix obj/,$(notdir $(SOURCES:.cpp=.o)))
OBJECTS_UTIL := $(addprefix obj-maketeasafe/,$(notdir $(MAKE_TeaSafe_SRC:.cpp=.o)))
OBJECTS_TEST := $(addprefix obj-test/,$(notdir $(TEST_SRC:.cpp=.o)))
OBJECTS_FUSE := $(addprefix obj-fuse/,$(notdir $(FUSE_SRC:.cpp=.o)))
OBJECTS_CIPHER := $(addprefix obj-cipher/,$(notdir $(CIPHER_SRC:.cpp=.o)))
TEST_EXECUTABLE=test
MAKETeaSafe_EXECUTABLE=maketeasafe
FUSE_LAYER=teasafe

obj/%.o: src/teasafe/%.cpp
	$(CXX) $(CXXFLAGS) -c -o $@ $<
	
obj-test/%.o: src/test/%.cpp
	$(CXX) $(CXXFLAGS) -c -o $@ $<
	
obj-maketeasafe/%.o: src/maketeasafe/%.cpp
	$(CXX) $(CXXFLAGS) -c -o $@ $<
	
obj-fuse/%.o: src/fuse/%.cpp
	$(CXX) $(CXXFLAGS) $(CXXFLAGS_FUSE) -c -o $@ $<
	
obj-cipher/%.o: src/cipher/%.cpp
	$(CXX) $(CXXFLAGS) $(CXXFLAGS_FUSE) -c -o $@ $<

all: $(SOURCES) $(CIPHER_SRC) directoryObj directoryObjCipher $(OBJECTS) $(OBJECTS_CIPHER) libBuilder $(TEST_SRC) $(TEST_EXECUTABLE) $(FUSE_LAYER) $(MAKETeaSafe_EXECUTABLE)

lib: $(SOURCES) $(CIPHER_SRC) directoryObj directoryObjCipher $(OBJECTS) $(OBJECTS_CIPHER) libBuilder 

$(TEST_EXECUTABLE): directoryObjTest $(OBJECTS_TEST)
	$(CXX) $(LDFLAGS) ./libteasafe.a $(OBJECTS_TEST) -o $@ 
	
$(MAKETeaSafe_EXECUTABLE): directoryObjMakeBfs $(OBJECTS_UTIL)
	$(CXX) $(LDFLAGS) ./libteasafe.a $(OBJECTS_UTIL) -o $@

$(FUSE_LAYER): directoryObjFuse $(OBJECTS_FUSE) 
	$(CXX) $(LDFLAGS) ./libteasafe.a -l$(FUSE) $(OBJECTS_FUSE) -o $@
	
clean:
	/bin/rm -fr obj obj-maketeasafe obj-test obj-fuse test maketeasafe teasafe obj-cipher libteasafe.a
	
directoryObj: 
	/bin/mkdir -p obj
	
directoryObjTest: 
	/bin/mkdir -p obj-test
	
directoryObjMakeBfs: 
	/bin/mkdir -p obj-maketeasafe
	
directoryObjFuse:
	/bin/mkdir -p obj-fuse
	
directoryObjCipher:
	/bin/mkdir -p obj-cipher

libBuilder:
	/usr/bin/ar rcs libteasafe.a obj/* obj-cipher/*
{'fraction_non_alphanumeric': 0.18102487931674713, 'fraction_numerical': 0.0022279985146676567, 'mean_word_length': 4.13047619047619, 'pattern_counts': {'":': 0, '<': 13, '<?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': '4237827', 'n_tokens_mistral': 2343, 'n_tokens_neox': 2137, 'n_words': 380}