<commit_before>CXX := $(CXX)
BOOST_LIBS = -lboost_timer -lboost_system -lboost_chrono
CXXFLAGS := $(CXXFLAGS) -O3 -Wall -Wsign-compare -DNDEBUG -Wsign-conversion -Wshadow -Wunused-parameter -Wshorten-64-to-32 -pedantic -finline-functions -fvisibility-inlines-hidden -std=c++11
LDFLAGS := $(LDFLAGS)

OS:=$(shell uname -s)
ifeq ($(OS),Darwin)
	CXXFLAGS += -stdlib=libc++
	LDFLAGS += -stdlib=libc++
endif

ifeq (sizes,$(firstword $(MAKECMDGOALS)))
  RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
  $(eval $(RUN_ARGS):;@:)
  ifndef RUN_ARGS
  $(error sizes target requires you pass full path to boost variant.hpp)
  endif
  .PHONY: $(RUN_ARGS)
endif

all: test-variant

test-variant: Makefile main.cpp variant.hpp
	$(CXX) -o test-variant main.cpp -I./ $(COMMON_FLAGS) $(CXXFLAGS) $(LDFLAGS) $(BOOST_LIBS)

sizes: Makefile variant.hpp
	@$(CXX) -o /tmp/variant.out variant.hpp $(COMMON_FLAGS) $(CXXFLAGS) &&  du -h /tmp/variant.out
	@$(CXX) -o /tmp/boost-variant.out $(RUN_ARGS) $(COMMON_FLAGS) $(CXXFLAGS) &&  du -h /tmp/boost-variant.out
	@$(CXX) -o ./test/variant ./test/variant.cpp -I./ $(COMMON_FLAGS) $(CXXFLAGS) &&  du -h ./test/variant
	@$(CXX) -o ./test/boost-variant ./test/boost-variant.cpp -I./ $(COMMON_FLAGS) $(CXXFLAGS) &&  du -h ./test/boost-variant

test: test-variant
	./test-variant 5000000

clean:
	rm -f ./test-variant
	rm -f ./test/variant
	rm -f ./test/boost-variant

.PHONY: sizes
<commit_msg>fix build on ubuntu/g++-4.8<commit_after>CXX := $(CXX)
BOOST_LIBS = -lboost_timer -lboost_system -lboost_chrono
CXXFLAGS := $(CXXFLAGS) -O3 -Wall -Wsign-compare -DNDEBUG -Wsign-conversion -Wshadow -Wunused-parameter -pedantic -finline-functions -fvisibility-inlines-hidden -std=c++11
LDFLAGS := $(LDFLAGS)

OS:=$(shell uname -s)
ifeq ($(OS),Darwin)
	CXXFLAGS += -stdlib=libc++
	LDFLAGS += -stdlib=libc++
else
    BOOST_LIBS += -lrt
endif

ifeq (sizes,$(firstword $(MAKECMDGOALS)))
  RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
  $(eval $(RUN_ARGS):;@:)
  ifndef RUN_ARGS
  $(error sizes target requires you pass full path to boost variant.hpp)
  endif
  .PHONY: $(RUN_ARGS)
endif

all: test-variant

test-variant: Makefile main.cpp variant.hpp
	$(CXX) -o test-variant main.cpp -I./ $(COMMON_FLAGS) $(CXXFLAGS) $(LDFLAGS) $(BOOST_LIBS)

sizes: Makefile variant.hpp
	@$(CXX) -o /tmp/variant.out variant.hpp $(COMMON_FLAGS) $(CXXFLAGS) &&  du -h /tmp/variant.out
	@$(CXX) -o /tmp/boost-variant.out $(RUN_ARGS) $(COMMON_FLAGS) $(CXXFLAGS) &&  du -h /tmp/boost-variant.out
	@$(CXX) -o ./test/variant ./test/variant.cpp -I./ $(COMMON_FLAGS) $(CXXFLAGS) &&  du -h ./test/variant
	@$(CXX) -o ./test/boost-variant ./test/boost-variant.cpp -I./ $(COMMON_FLAGS) $(CXXFLAGS) &&  du -h ./test/boost-variant

test: test-variant
	./test-variant 5000000

clean:
	rm -f ./test-variant
	rm -f ./test/variant
	rm -f ./test/boost-variant

.PHONY: sizes

{'fraction_non_alphanumeric': 0.18622360678435446, 'fraction_numerical': 0.009691934925579786, 'mean_word_length': 3.9571183533447685, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3641555', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1100, 'n_words': 265}