<commit_before>SRCS := \
	main.go \
	ast/node.go \
	ast/printer.go \
	ast/visitor.go \
	driver/driver.go \
	syntax/lexer.go \
	syntax/grammar.go \
	syntax/parser.go \
	token/token.go \
	types/builtins.go \
	types/env.go \
	types/type.go \
	sema/unify.go \
	sema/deref.go \
	sema/infer.go \
	sema/node_to_type.go \
	sema/semantics_check.go \
	sema/to_mir.go \
	sema/alpha_transform.go \
	sema/scope.go \
	mir/val.go \
	mir/block.go \
	mir/printer.go \
	mir/elim_ref.go \
	mir/program.go \
	closure/transform.go \
	closure/freevars.go \
	closure/fix_apps.go \
	codegen/emitter.go \
	codegen/module_builder.go \
	codegen/type_builder.go \
	codegen/block_builder.go \
	codegen/debug_info_builder.go \
	codegen/linker.go \
	codegen/targets.go \
	common/ordinal.go \

TESTS := \
	ast/example_test.go \
	ast/visitor_test.go \
	ast/printer_test.go \
	closure/example_test.go \
	closure/transform_test.go \
	driver/example_test.go \
	syntax/lexer_test.go \
	syntax/example_test.go \
	syntax/parser_test.go \
	token/token_test.go \
	types/env_test.go \
	types/type_test.go \
	sema/example_test.go \
	sema/infer_test.go \
	sema/deref_test.go \
	sema/node_to_type_test.go \
	sema/to_mir_test.go \
	sema/semantics_check_test.go \
	sema/scope_test.go \
	sema/alpha_transform_test.go \
	mir/block_test.go \
	mir/elim_ref_test.go \
	mir/program_test.go \
	codegen/example_test.go \
	codegen/executable_test.go \
	codegen/linker_test.go \
	codegen/targets_test.go \
	common/ordinal_test.go \

all: build test

build: gocaml runtime/gocamlrt.a

gocaml: $(SRCS)
	./scripts/install_llvmgo.sh
	go get -t -d ./...
	if which time > /dev/null; then time go build; else go build; fi

syntax/grammar.go: syntax/grammar.go.y
	go get golang.org/x/tools/cmd/goyacc<commit_msg>fix a compilation error after Go 1.9.4<commit_after>SRCS := \
	main.go \
	ast/node.go \
	ast/printer.go \
	ast/visitor.go \
	driver/driver.go \
	syntax/lexer.go \
	syntax/grammar.go \
	syntax/parser.go \
	token/token.go \
	types/builtins.go \
	types/env.go \
	types/type.go \
	sema/unify.go \
	sema/deref.go \
	sema/infer.go \
	sema/node_to_type.go \
	sema/semantics_check.go \
	sema/to_mir.go \
	sema/alpha_transform.go \
	sema/scope.go \
	mir/val.go \
	mir/block.go \
	mir/printer.go \
	mir/elim_ref.go \
	mir/program.go \
	closure/transform.go \
	closure/freevars.go \
	closure/fix_apps.go \
	codegen/emitter.go \
	codegen/module_builder.go \
	codegen/type_builder.go \
	codegen/block_builder.go \
	codegen/debug_info_builder.go \
	codegen/linker.go \
	codegen/targets.go \
	common/ordinal.go \

TESTS := \
	ast/example_test.go \
	ast/visitor_test.go \
	ast/printer_test.go \
	closure/example_test.go \
	closure/transform_test.go \
	driver/example_test.go \
	syntax/lexer_test.go \
	syntax/example_test.go \
	syntax/parser_test.go \
	token/token_test.go \
	types/env_test.go \
	types/type_test.go \
	sema/example_test.go \
	sema/infer_test.go \
	sema/deref_test.go \
	sema/node_to_type_test.go \
	sema/to_mir_test.go \
	sema/semantics_check_test.go \
	sema/scope_test.go \
	sema/alpha_transform_test.go \
	mir/block_test.go \
	mir/elim_ref_test.go \
	mir/program_test.go \
	codegen/example_test.go \
	codegen/executable_test.go \
	codegen/linker_test.go \
	codegen/targets_test.go \
	common/ordinal_test.go \

all: build test

build: gocaml runtime/gocamlrt.a

gocaml: $(SRCS)
	./scripts/install_llvmgo.sh
	go get -t -d ./...
	if which time > /dev/null; then\
		CGO_LDFLAGS_ALLOW='-Wl,(-search_paths_first|-headerpad_max_install_names)' time go build;\
	else\
		CGO_LDFLAGS_ALLOW='-Wl,(-search_paths_first|-headerpad_max_install_names)' go build;\
	fi

syntax/grammar.go: syntax/grammar.go.y
	go get golang.org/x/tools/cmd/goyacc
{'fraction_non_alphanumeric': 0.1353628703452025, 'fraction_numerical': 0.0008154389779831476, 'mean_word_length': 2.919062832800852, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '149876', 'n_tokens_mistral': 1648, 'n_tokens_neox': 1632, 'n_words': 199}