<commit_before>#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////

# Utilities
REMOVE = rm -rf
LINK = ln -sf
COPY = cp -f

# For GNU make:
OS_VER := $(shell uname -s | sed -e s/\[\.\ \]/_/g)
# For other make (like Sun's) you can try:
# OS_VER:sh =uname -sr | sed -e s/\[\.\ \]/_/g

# C++ compiler
CXX = gcc
# preprocessor
CPP = gcc -E
# linker
LD = gcc
# archiver
AR = ar r

ifeq ($(OS_VER),SunOS)
CXXFLAGS = -Wall -pthreads -fpic
else
CXXFLAGS += -Wall
endif

LDFLAGS = -shared 

# Uncomment for optimisations
CXXFLAGS += -O2
LDFLAGS  += -O2

# edit for your parser choice - may include more than one USE_*
PARSER_CONFIG = -DUSE_EXPAT -DARABICA_NO_WCHAR_T
#PARSER_CONFIG = -DUSE_EXPAT -DUSE_LIBXML2 -DUSE_XERCES -DUSE_GARDEN

# Includes and library directories 
INCS_DIRS = -I.. 
#INCS_DIRS = -I.. 
LIBS_DIRS = 

STATIC_LIBS =
DYNAMIC_LIBS = -lstdc++

CXXFLAGS += $(INCS_DIRS)
LDFLAGS += $(LIBS_DIRS)
LDFLAGS += $(STATIC_LIBS)
LDFLAGS += $(DYNAMIC_LIBS)

#/////////////////////////////////////////////////////////////////////////
#//////////////////////////////////////////////

SRCS =  saxlib.cpp \
	helpers/InputSourceResolver.cpp \
	../Utils/base64codecvt.cpp \
	../Utils/iso88591utf8codecvt.cpp \
	../Utils/rot13codecvt.cpp \
	../Utils/utf16beucs2codecvt.cpp \
	../Utils/utf16leucs2codecvt.cpp \
	../Utils/utf16utf8codecvt.cpp \
	../Utils/utf8iso88591codecvt.cpp \
	../Utils/utf8ucs2codecvt.cpp \
	../Utils/impl/iso88591_utf8.cpp \
	../Utils/impl/ucs2_utf16.cpp \
	../Utils/impl/ucs2_utf8.cpp \
	../XML/XMLCharacterClasses.cpp

HDRS = $(patsubst %.c,%.h,$(patsubst %.cpp,%.h,$(SRCS)))
OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SRCS)))


##########################
# High level rules
all : libArabica.so.1 libArabica.a 

libArabica.so.1 : $(OBJS) 
	$(LD) $(LDFLAGS) -o $@ $(OBJS)
	$(COPY) libArabica.so.1 ../bin
	(cd ../bin; $(REMOVE) libArabica.so; $(LINK) libArabica.so.1 libArabica.so)

libArabica.a : $(OBJS)
	$(AR) $@ $(OBJS)
	$(COPY) libArabica.a ../bin

######################
# Compile rules
####
# the .S files depends on symbols defined in this Makefile, hence
# this slightly wacky rule
saxlib.cpp : Makefile ParserConfig.h ArabicaConfig.h
	$(CPP) $(PARSER_CONFIG) -o saxlib.cpp saxlib.S 

ParserConfig.h : Makefile
	$(CPP) $(PARSER_CONFIG) -o ParserConfig.h ParserConfig.S

ArabicaConfig.h : Makefile
	$(CPP) $(PARSER_CONFIG) -o ArabicaConfig.h ArabicaConfig.S

%.o : %.cpp
	$(CXX) $(CXXFLAGS) -c -o $@ $<

%.cpp : ArabicaConfig.h ParserConfig.h

#############################################
# Cleaning up
clean :
	$(REMOVE) *.o helpers/*.o wrappers/*.o ../Utils/*.o ../Utils/impl/*.o ../XML/*.o libArabica*  ../bin/libArabica* saxlib.cpp ParserConfig.h ArabicaConfig.h

# End of File<commit_msg>*** empty log message ***<commit_after>####################################
# Arabica Makefile
#
# I wrote this for GNU Make + GNU tools on Linux.
# You may have to jiggle it for your own environment.
# Platforms specific build files gratefully received 
# at <EMAIL>  Thanks :)
#
# $Id$
####################################


####################################
# ARABICA CONFIG
# edit for your parser choice - may include more than one USE_*
PARSER_CONFIG = -DUSE_EXPAT -DARABICA_NO_WCHAR_T
#PARSER_CONFIG = -DUSE_EXPAT -DUSE_LIBXML2 -DUSE_XERCES -DUSE_GARDEN

####################################
# TOOLS
#####
# C++ compiler
CXX = gcc
# preprocessor
CPP = gcc -E
# linker
LD = gcc
# archiver
AR = ar r

###########
# Utilities
REMOVE = rm -rf
LINK = ln -sf
COPY = cp -f

######################################
# BUILD FLAGS
CXXFLAGS += -Wall 
LDFLAGS += -shared

# Uncomment for optimisations
CXXFLAGS += -O2
LDFLAGS  += 

# Includes and library directories 
INCS_DIRS = -I.. 
LIBS_DIRS = 

STATIC_LIBS =
DYNAMIC_LIBS =

CXXFLAGS += $(INCS_DIRS)
LDFLAGS += $(LIBS_DIRS)
LDFLAGS += $(STATIC_LIBS)
LDFLAGS += $(DYNAMIC_LIBS)

######################################
# SOURCE FILES
SRCS =  saxlib.cpp \
	helpers/InputSourceResolver.cpp \
	../Utils/base64codecvt.cpp \
	../Utils/iso88591utf8codecvt.cpp \
	../Utils/rot13codecvt.cpp \
	../Utils/utf16beucs2codecvt.cpp \
	../Utils/utf16leucs2codecvt.cpp \
	../Utils/utf16utf8codecvt.cpp \
	../Utils/utf8iso88591codecvt.cpp \
	../Utils/utf8ucs2codecvt.cpp \
	../Utils/impl/iso88591_utf8.cpp \
	../Utils/impl/ucs2_utf16.cpp \
	../Utils/impl/ucs2_utf8.cpp \
	../XML/XMLCharacterClasses.cpp

HDRS = $(patsubst %.c,%.h,$(patsubst %.cpp,%.h,$(SRCS)))
OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SRCS)))

##########################
# High level rules
all : libArabica.so.1 libArabica.a 

libArabica.so.1 : $(OBJS) 
	$(LD) $(LDFLAGS) -o $@ $(OBJS)
	$(COPY) libArabica.so.1 ../bin
	(cd ../bin; $(REMOVE) libArabica.so; $(LINK) libArabica.so.1 libArabica.so)

libArabica.a : $(OBJS)
	$(AR) $@ $(OBJS)
	$(COPY) libArabica.a ../bin

######################
# Compile rules
####
# the .S files depends on symbols defined in this Makefile, hence
# this slightly wacky rule
saxlib.cpp : Makefile ParserConfig.h ArabicaConfig.h
	$(CPP) $(PARSER_CONFIG) -o saxlib.cpp saxlib.S 

ParserConfig.h : Makefile
	$(CPP) $(PARSER_CONFIG) -o ParserConfig.h ParserConfig.S

ArabicaConfig.h : Makefile
	$(CPP) $(PARSER_CONFIG) -o ArabicaConfig.h ArabicaConfig.S

%.o : %.cpp
	$(CXX) $(CXXFLAGS) -c -o $@ $<

%.cpp : ArabicaConfig.h ParserConfig.h

#############################################
# Cleaning up
clean :
	$(REMOVE) *.o helpers/*.o wrappers/*.o ../Utils/*.o ../Utils/impl/*.o ../XML/*.o libArabica*  ../bin/libArabica* saxlib.cpp ParserConfig.h ArabicaConfig.h

# End of File






{'fraction_non_alphanumeric': 0.26676176890156916, 'fraction_numerical': 0.01587018544935806, 'mean_word_length': 3.0792727272727274, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, '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': '1487404', 'n_tokens_mistral': 2234, 'n_tokens_neox': 2101, 'n_words': 462}