<commit_before>HWNUM = 2
NEXERCISE = 7

ifeq (,$(MAKECMDGOALS))
  EX :=
else
  ifeq (test, $(firstword $(MAKECMDGOALS)))
  EX := $(word 2,$(MAKECMDGOALS))
  $(eval $(EX):;@:)
  endif
endif

ifneq (,$(EX))
  CORRECT_EX := $(shell echo "$(EX)>=1 && $(EX)<=$(NEXERCISE)" | bc)
endif

SRCS=$(shell srcs=""; num=1 ; while [[ $$num -le $(NEXERCISE) ]] ; do \
	srcs=$$srcs\ ex$$num.ml\ test$$num.ml;((num = num + 1)); \
	done; \
	echo $$srcs)

.PHONY: test clean

all: test

test:
ifeq (, $(EX))
	@echo "# Compiling Every Exercises"
	@ocamlc -I ../lib/ -o hw$(HWNUM).out ../lib/testlib.ml $(SRCS)
	@./hw$(HWNUM).out total
else
  ifeq (1, $(CORRECT_EX))
	@echo "# Compiling Exercise $(EX)"
	@ocamlc -I ../lib/ -o ex$(EX).out ../lib/testlib.ml ex$(EX).ml test$(EX).ml
	@./ex$(EX).out
  else
	@echo "Exercise $(EX) not found."
  endif
endif
	@make clean

clean:
	@rm -f *.cmo *.cmi *.out *.o *.cmx<commit_msg>Fix makefile<commit_after>SHELL := /bin/bash
HWNUM = 2
NEXERCISE = 7

ifeq (,$(MAKECMDGOALS))
  EX :=
else
  ifeq (test, $(firstword $(MAKECMDGOALS)))
  EX := $(word 2,$(MAKECMDGOALS))
  $(eval $(EX):;@:)
  endif
endif

ifneq (,$(EX))
  CORRECT_EX := $(shell echo "$(EX)>=1 && $(EX)<=$(NEXERCISE)" | bc)
endif

SRCS=$(shell srcs=""; num=1 ; while [[ $$num -le $(NEXERCISE) ]] ; do \
	srcs=$$srcs\ ex$$num.ml\ test$$num.ml;((num = num + 1)); \
	done; \
	echo $$srcs)

.PHONY: test clean

all: test

test:
ifeq (, $(EX))
	@echo "# Compiling Every Exercises"
	@ocamlc -I ../lib/ -o hw$(HWNUM).out ../lib/testlib.ml $(SRCS)
	@./hw$(HWNUM).out total
else
  ifeq (1, $(CORRECT_EX))
	@echo "# Compiling Exercise $(EX)"
	@ocamlc -I ../lib/ -o ex$(EX).out ../lib/testlib.ml ex$(EX).ml test$(EX).ml
	@./ex$(EX).out
  else
	@echo "Exercise $(EX) not found."
  endif
endif

clean:
	@rm -f *.cmo *.cmi *.out *.o *.cmx
{'fraction_non_alphanumeric': 0.24681087077093733, 'fraction_numerical': 0.00776483638380477, 'mean_word_length': 3.4, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1008613', 'n_tokens_mistral': 856, 'n_tokens_neox': 794, 'n_words': 200}