<commit_before>#########################################################################
#                                                                       #
#                                 OCaml                                 #
#                                                                       #
#            <NAME>, EPI Gallium, INRIA Rocquencourt            #
#                                                                       #
#   Copyright 2013 Institut National de Recherche en Informatique et    #
#   en Automatique.  All rights reserved.  This file is distributed     #
#   under the terms of the Q Public License version 1.0.                #
#                                                                       #
#########################################################################

BASEDIR=../..
MAIN_MODULE=debuggee
ADD_COMPFLAGS=-g -custom
LD_PATH=$(TOPDIR)/otherlibs/$(UNIXLIBVAR)unix

.PHONY: default
default:
	@$(MAKE) compile
	@$(SET_LD_PATH) OCAMLLIB=. $(MAKE) run

.PHONY: compile
compile: $(ML_FILES) $(CMO_FILES) $(MAIN_MODULE).cmo
	@rm -f program.byte program.byte.exe
	@$(OCAMLC) $(ADD_COMPFLAGS) $(ADD_CFLAGS) -o program.byte$(EXE) \
	           $(O_FILES) $(CMA_FILES) $(CMO_FILES) $(ADD_CMO_FILES) \
	           $(MAIN_MODULE).cmo
	@mkdir -p compiler-libs
	@cp $(TOPDIR)/toplevel/topdirs.cmi compiler-libs/

.PHONY: run
run:
	@printf " ... testing with ocamlc"
	@rm -f $(MAIN_MODULE).result
	@echo 'source input_script' | \
	 $(OCAMLRUN) `$(CYGPATH) $(TOPDIR)/debugger/ocamldebug$(EXE)` \
	             program.byte$(EXE) >$(MAIN_MODULE).raw.result 2>&1 \
	 && sed -e '/Debugger version/d' -e '/^Time:/d' -e '$$d' \
	        $(MAIN_MODULE).raw.result >$(MAIN_MODULE).result \
	 && $(DIFF) $(MAIN_MODULE).reference $(MAIN_MODULE).result >/dev/null \<commit_msg>skip debugger test when dynlink is not available<commit_after>#########################################################################
#                                                                       #
#                                 OCaml                                 #
#                                                                       #
#            <NAME>, EPI Gallium, INRIA Rocquencourt            #
#                                                                       #
#   Copyright 2013 Institut National de Recherche en Informatique et    #
#   en Automatique.  All rights reserved.  This file is distributed     #
#   under the terms of the Q Public License version 1.0.                #
#                                                                       #
#########################################################################

BASEDIR=../..
MAIN_MODULE=debuggee
ADD_COMPFLAGS=-g -custom
LD_PATH=$(TOPDIR)/otherlibs/$(UNIXLIBVAR)unix

.PHONY: default
default:
	@if ! $(SUPPORTS_SHARED_LIBRARIES); then \
	  echo 'skipped (shared libraries not available)'; \
	else \
	  $(MAKE) compile; \
	  $(SET_LD_PATH) OCAMLLIB=. $(MAKE) run; \
	fi

.PHONY: compile
compile: $(ML_FILES) $(CMO_FILES) $(MAIN_MODULE).cmo
	@rm -f program.byte program.byte.exe
	@$(OCAMLC) $(ADD_COMPFLAGS) $(ADD_CFLAGS) -o program.byte$(EXE) \
	           $(O_FILES) $(CMA_FILES) $(CMO_FILES) $(ADD_CMO_FILES) \
	           $(MAIN_MODULE).cmo
	@mkdir -p compiler-libs
	@cp $(TOPDIR)/toplevel/topdirs.cmi compiler-libs/

.PHONY: run
run:
	@printf " ... testing with ocamlc"
	@rm -f $(MAIN_MODULE).result
	@echo 'source input_script' | \
	 $(OCAMLRUN) `$(CYGPATH) $(TOPDIR)/debugger/ocamldebug$(EXE)` \
	             program.byte$(EXE) >$(MAIN_MODULE).raw.result 2>&1 \
	 && sed -e '/Debugger version/d' -e '/^Time:/d' -e '$$d' \
	        $(MAIN_MODULE).raw.result >$(MAIN_MODULE).result \
	 && $(DIFF) $(MAIN_MODULE).reference $(MAIN_MODULE).result >/dev/null \
{'fraction_non_alphanumeric': 0.20037007665873646, 'fraction_numerical': 0.0042294475284166, 'mean_word_length': 1.762043795620438, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4137935', 'n_tokens_mistral': 1126, 'n_tokens_neox': 1062, 'n_words': 234}