<commit_before>UNAME := $(shell uname)
RUBY_PLATFORM := $(shell ruby -e "puts RUBY_PLATFORM")
BISON_VERSION := $(shell bison --version | grep ^bison | sed 's/^.* //')
# Keep in sync with c/Makefile
REQUIRED_BISON_VERSION = 2.7
PATH := $(shell pwd)/bison-$(REQUIRED_BISON_VERSION)/tests:$(PATH)

all: c javascript ruby winruby jruby

c: bison
	cd c && make

java: bison
	cd java && mvn package

javascript:
	cd javascript && make

ruby: bison
	cd ruby && rake

clangruby: bison
	cd ruby && CC=clang rake clean compile

gccruby: bison
	cd ruby && CC=gcc rake clean compile

jruby: bison
	cd ruby && jruby -S rake

winruby: mingw bison
	cd ruby && rake cross compile

clean:
	cd c          && make clean
	cd java       && mvn clean
	cd javascript && make clean
	cd ruby       && rake clean

clobber: clean
	rm -Rf mingw

ifeq ($(UNAME), Darwin)
mingw: mingw/bin/i686-w64-mingw32-gcc

mingw/bin/i686-w64-mingw32-gcc:
	mkdir -p mingw
	# Don't attempt any of the newer versions - they don't work (gcc 4.7.0)
	cd mingw && curl --silent --location http://downloads.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Automated%20Builds/mingw-w32-1.0-bin_i686-darwin_20110819.tar.bz2 | tar xvj
endif

ifneq ($(BISON_VERSION), $(REQUIRED_BISON_VERSION))
bison: bison-$(REQUIRED_BISON_VERSION)/src/bison

bison-$(REQUIRED_BISON_VERSION)/src/bison:
	curl --silent --location http://ftp.gnu.org/gnu/bison/bison-$(REQUIRED_BISON_VERSION).tar.gz | tar xvz
	cd bison-$(REQUIRED_BISON_VERSION) && ./configure && make
endif

ifeq ($(RUBY_PLATFORM), java)
travis: ruby
else
travis: c javascript clangruby gccruby winruby
endif

.PHONY: all c java javascript ruby clangruby gccruby jruby winruby mingw travis bison clean
<commit_msg>clobber should remove custom bison and node_modules<commit_after>UNAME := $(shell uname)
RUBY_PLATFORM := $(shell ruby -e "puts RUBY_PLATFORM")
BISON_VERSION := $(shell bison --version | grep ^bison | sed 's/^.* //')
# Keep in sync with c/Makefile
REQUIRED_BISON_VERSION = 2.7
PATH := $(shell pwd)/bison-$(REQUIRED_BISON_VERSION)/tests:$(PATH)

all: c javascript ruby winruby jruby

c: bison
	cd c && make

java: bison
	cd java && mvn package

javascript:
	cd javascript && make

ruby: bison
	cd ruby && rake

clangruby: bison
	cd ruby && CC=clang rake clean compile

gccruby: bison
	cd ruby && CC=gcc rake clean compile

jruby: bison
	cd ruby && jruby -S rake

winruby: mingw bison
	cd ruby && rake cross compile

clean:
	cd c          && make clean
	cd java       && mvn clean
	cd javascript && make clean
	cd ruby       && rake clean

clobber: clean
	rm -Rf mingw
	rm -Rf javascript/node_modules
ifneq ($(BISON_VERSION), $(REQUIRED_BISON_VERSION))
	rm -Rf bison-$(REQUIRED_BISON_VERSION)
endif

ifeq ($(UNAME), Darwin)
mingw: mingw/bin/i686-w64-mingw32-gcc

mingw/bin/i686-w64-mingw32-gcc:
	mkdir -p mingw
	# Don't attempt any of the newer versions - they don't work (gcc 4.7.0)
	cd mingw && curl --silent --location http://downloads.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Automated%20Builds/mingw-w32-1.0-bin_i686-darwin_20110819.tar.bz2 | tar xvj
endif

ifneq ($(BISON_VERSION), $(REQUIRED_BISON_VERSION))
bison: bison-$(REQUIRED_BISON_VERSION)/src/bison

bison-$(REQUIRED_BISON_VERSION)/src/bison:
	curl --silent --location http://ftp.gnu.org/gnu/bison/bison-$(REQUIRED_BISON_VERSION).tar.gz | tar xvz
	cd bison-$(REQUIRED_BISON_VERSION) && ./configure && make
endif

ifeq ($(RUBY_PLATFORM), java)
travis: ruby
else
travis: c javascript clangruby gccruby winruby
endif

.PHONY: all c java javascript ruby clangruby gccruby jruby winruby mingw travis bison clean

{'fraction_non_alphanumeric': 0.11982330204307012, 'fraction_numerical': 0.02484815019326339, 'mean_word_length': 4.197991391678623, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '688660', 'n_tokens_mistral': 1555, 'n_tokens_neox': 1374, 'n_words': 376}