<commit_before>all: extractor dbscheme

ifeq ($(OS),Windows_NT)
EXE = .exe
CODEQL_PLATFORM = win64
else
EXE =
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
CODEQL_PLATFORM = linux64
endif
ifeq ($(UNAME_S),Darwin)
CODEQL_PLATFORM = osx64
endif
endif

FILES=codeql-extractor.yml\
      tools/qltest.cmd\
      tools/index-files.sh\
      tools/index-files.cmd\
      tools/autobuild.sh\
      tools/qltest.sh\
      tools/autobuild.cmd\
      ql/src/ruby.dbscheme.stats\
      ql/src/ruby.dbscheme

BIN_FILES=target/release/ruby-extractor$(EXE) target/release/ruby-autobuilder$(EXE)

extractor-common:
	rm -rf build/codeql-extractor-ruby
	mkdir -p build/codeql-extractor-ruby
	cp codeql-extractor.yml ql/src/ruby.dbscheme ql/src/ruby.dbscheme.stats build/codeql-extractor-ruby
	cp -r tools build/codeql-extractor-ruby/

.PHONY:	tools
tools: $(BIN_FILES)
	mkdir -p tools/bin
	cp -r target/release/ruby-autobuilder$(EXE) tools/bin/autobuilder$(EXE)
	cp -r target/release/ruby-extractor$(EXE) tools/bin/extractor$(EXE)	

target/release/%$(EXE):
	cargo build --release --bin $(basename $(notdir $@))

dbscheme:
	cargo build --bin ruby-generator
	cargo run -p ruby-generator
	codeql query format -i ql/src/codeql_ruby/ast/internal/TreeSitter.qll

.PHONY:	extractor
extractor:	$(FILES) $(BIN_FILES)
	rm -rf extractor-pack
	mkdir -p extractor-pack/tools/$(CODEQL_PLATFORM)
	cp codeql-extractor.yml extractor-pack/codeql-extractor.yml
	cp tools/qltest.cmd extractor-pack/tools/qltest.cmd
	cp tools/index-files.sh extractor-pack/tools/index-files.sh
	cp tools/index-files.cmd extractor-pack/tools/index-files.cmd
	cp tools/autobuild.sh extractor-pack/tools/autobuild.sh<commit_msg>Address comments<commit_after>all: extractor dbscheme

ifeq ($(OS),Windows_NT)
EXE = .exe
CODEQL_PLATFORM = win64
else
EXE =
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
CODEQL_PLATFORM = linux64
endif
ifeq ($(UNAME_S),Darwin)
CODEQL_PLATFORM = osx64
endif
endif

FILES=codeql-extractor.yml\
      tools/qltest.cmd\
      tools/index-files.sh\
      tools/index-files.cmd\
      tools/autobuild.sh\
      tools/qltest.sh\
      tools/autobuild.cmd\
      ql/src/ruby.dbscheme.stats\
      ql/src/ruby.dbscheme

BIN_FILES=target/release/ruby-extractor$(EXE) target/release/ruby-autobuilder$(EXE)

extractor-common:
	rm -rf build
	mkdir build
	mkdir build/codeql-extractor-ruby
	cp codeql-extractor.yml ql/src/ruby.dbscheme ql/src/ruby.dbscheme.stats build/codeql-extractor-ruby
	cp -r tools build/codeql-extractor-ruby/

.PHONY:	tools
tools: $(BIN_FILES)
	mkdir tools
	mkdir bin
	cp -r target/release/ruby-autobuilder$(EXE) tools/bin/autobuilder$(EXE)
	cp -r target/release/ruby-extractor$(EXE) tools/bin/extractor$(EXE)	

target/release/%$(EXE):
	cargo build --release --bin $(basename $(notdir $@))

dbscheme:
	cargo build --bin ruby-generator
	cargo run -p ruby-generator
	codeql query format -i ql/src/codeql_ruby/ast/internal/TreeSitter.qll

.PHONY:	extractor
extractor:	$(FILES) $(BIN_FILES)
	rm -rf extractor-pack
	mkdir extractor-pack
	mkdir extractor-pack/tools
	mkdir extractor-pack/tools/$(CODEQL_PLATFORM)
	cp codeql-extractor.yml extractor-pack/codeql-extractor.yml
	cp tools/qltest.cmd extractor-pack/tools/qltest.cmd
	cp tools/index-files.sh extractor-pack/tools/index-files.sh
	cp tools/index-files.cmd extractor-pack/tools/index-files.cmd
	cp tools/autobuild.sh extractor-pack/tools/autobuild.sh
{'fraction_non_alphanumeric': 0.12956419316843346, 'fraction_numerical': 0.0035335689045936395, 'mean_word_length': 4.017725258493353, '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': '2506073', 'n_tokens_mistral': 1405, 'n_tokens_neox': 1307, 'n_words': 235}