<commit_before>REBAR:=$(shell which rebar || echo `pwd`/rebar)
ELIXIRC:=bin/elixirc --ignore-module-conflict $(ELIXIRC_OPTS)
ERLC:=erlc -I lib/elixir/include
ERL:=erl -I lib/elixir/include -noshell -env ERL_LIBS $ERL_LIBS:lib
FULLFLAG:=.full
VERSION:=0.6.0.dev

.PHONY: 1
.NOTPARALLEL: compile

#==> Templates
define TASK_TEMPLATE
$(1): lib/$(1)/ebin/Elixir-$(2).beam

lib/$(1)/ebin/Elixir-$(2).beam: $(wildcard lib/$(1)/lib/*.ex) $(wildcard lib/$(1)/lib/*/*.ex) $(wildcard lib/$(1)/lib/*/*/*.ex) $$(FORCE)
	@ echo "==> $(1) (compile)"
	@ $$(ELIXIRC) "lib/$(1)/lib/**/*.ex" -o lib/$(1)/ebin
	@ cd lib/$(1) && ../../bin/mix compile.app

test_$(1): $(1)
	@ echo "==> $(1) (exunit)"
	@ cd lib/$(1) && time ../../bin/elixir -r "test/test_helper.exs" -pr "test/**/*_test.exs"
endef

#==> Compilation tasks
KERNEL:=lib/elixir/ebin/Elixir-Kernel.beam

compile: lib/elixir/src/elixir.app.src erlang elixir

lib/elixir/src/elixir.app.src: src/elixir.app.src
	@ rm -rf lib/elixir/src/elixir.app.src
	@ cp src/elixir.app.src lib/elixir/src/elixir.app.src

erlang:
	@ cd lib/elixir && $(REBAR) compile

elixir: kernel mix ex_unit eex

kernel: $(KERNEL)
$(KERNEL): lib/elixir/lib/*.ex lib/elixir/lib/*/*.ex $(FORCE)
	@ if [ -f $(KERNEL) ]; then                                 \
		echo "==> kernel (compile)";                            \
		$(ELIXIRC) "lib/elixir/lib/**/*.ex" -o lib/elixir/ebin; \
	else                                                        \
		echo "==> bootstrap (compile)";                         \
		$(ERL) -s elixir_compiler core -s erlang halt;          \
	fi
	@ rm -rf lib/elixir/ebin/elixir.app
	@ cd lib/elixir && $(REBAR) compile

$(eval $(call TASK_TEMPLATE,ex_unit,ExUnit))
$(eval $(call TASK_TEMPLATE,eex,EEx))
$(eval $(call TASK_TEMPLATE,mix,Mix))

clean:
	@ rm -rf .full
	@ rm -rf lib/*/ebin
	@ cd lib/elixir && $(REBAR) clean
<commit_msg>Solve conflicts in Makefile<commit_after>REBAR:=$(shell which rebar || echo `pwd`/rebar)
ELIXIRC:=bin/elixirc --ignore-module-conflict $(ELIXIRC_OPTS)
ERLC:=erlc -I lib/elixir/include
ERL:=erl -I lib/elixir/include -noshell -env ERL_LIBS $ERL_LIBS:lib
FULLFLAG:=.full
VERSION:=0.6.0.dev

.PHONY: 1
.NOTPARALLEL: compile

#==> Templates
define TASK_TEMPLATE
$(1): lib/$(1)/ebin/Elixir-$(2).beam lib/$(1)/ebin/$(1).app

lib/$(1)/ebin/$(1).app:
	@ cd lib/$(1) && ../../bin/mix compile.app

lib/$(1)/ebin/Elixir-$(2).beam: $(wildcard lib/$(1)/lib/*.ex) $(wildcard lib/$(1)/lib/*/*.ex) $(wildcard lib/$(1)/lib/*/*/*.ex) $$(FORCE)
	@ echo "==> $(1) (compile)"
	@ $$(ELIXIRC) "lib/$(1)/lib/**/*.ex" -o lib/$(1)/ebin

test_$(1): $(1)
	@ echo "==> $(1) (exunit)"
	@ cd lib/$(1) && time ../../bin/elixir -r "test/test_helper.exs" -pr "test/**/*_test.exs"
endef

#==> Compilation tasks
KERNEL:=lib/elixir/ebin/Elixir-Kernel.beam

compile: lib/elixir/src/elixir.app.src erlang elixir

lib/elixir/src/elixir.app.src: src/elixir.app.src
	@ rm -rf lib/elixir/src/elixir.app.src
	@ cp src/elixir.app.src lib/elixir/src/elixir.app.src

erlang:
	@ cd lib/elixir && $(REBAR) compile

# We need to compile only EEx (without the app)
# file so we can compile Mix
elixir: kernel lib/eex/ebin/Elixir-EEx.beam mix ex_unit eex

kernel: $(KERNEL)
$(KERNEL): lib/elixir/lib/*.ex lib/elixir/lib/*/*.ex $(FORCE)
	@ if [ -f $(KERNEL) ]; then                                 \
		echo "==> kernel (compile)";                            \
		$(ELIXIRC) "lib/elixir/lib/**/*.ex" -o lib/elixir/ebin; \
	else                                                        \
		echo "==> bootstrap (compile)";                         \
		$(ERL) -s elixir_compiler core -s erlang halt;          \
	fi
	@ rm -rf lib/elixir/ebin/elixir.app
	@ cd lib/elixir && $(REBAR) compile

$(eval $(call TASK_TEMPLATE,ex_unit,ExUnit))
$(eval $(call TASK_TEMPLATE,eex,EEx))
$(eval $(call TASK_TEMPLATE,mix,Mix))

clean:
	@ rm -rf .full
	@ rm -rf lib/*/ebin
	@ cd lib/elixir && $(REBAR) clean

{'fraction_non_alphanumeric': 0.212853470437018, 'fraction_numerical': 0.011311053984575836, 'mean_word_length': 2.6916508538899433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '543002', 'n_tokens_mistral': 1708, 'n_tokens_neox': 1647, 'n_words': 307}