<commit_before>
CC = gcc
CXX = g++

MATLABROOT = $(strip $(shell cat ../.matlabroot))
MEX = $(MATLABROOT)/bin/mex
MEXEXT = $(shell $(MATLABROOT)/bin/mexext)    
MATLABBIN = $(MATLABROOT)/bin/$(strip $(shell cat ../.matlabcpu))
MATLABFLAGS = -I$(MATLABROOT)/extern/include -L$(MATLABBIN) -lmat -lmx -Wl,-rpath,$(MATLABBIN) -DMX_COMPAT_32

MEX_CPP_FILES = realtime.cpp deleteMexPointer.cpp
MEXFILES = $(MEX_CPP_FILES:%.cpp=%.$(MEXEXT))

# for mac:
LIBEXT = dylib
LIBFLAGS = -dynamiclib -flat_namespace
# for everyone else:
#LIBEXT = so
#LIBFLAGS = -shared

EXES = debugMex libDrakeDebugMex.$(LIBEXT)

BINDIR = ../bin
BINEXES = $(EXES:%=$(BINDIR)/%)


SUBDIRS = test

all: MEX += -O
all: CXX += -O3
all : drakeUtil.o $(MEXFILES) $(BINEXES)
	@for subdir in $(SUBDIRS); do \
		echo "\n-------------------------------------------"; \
		echo "-- $$subdir"; \
		echo "-------------------------------------------"; \
		$(MAKE) -C $$subdir all || exit 2; \
	done

debug: MEX += -g
debug: CXX += -g
debug: drakeUtil.o $(MEXFILES) $(BINEXES)
	@for subdir in $(SUBDIRS); do \
		echo "\n-------------------------------------------"; \
		echo "-- $$subdir"; \
		echo "-------------------------------------------"; \
		$(MAKE) -C $$subdir debug || exit 2; \
	done

drakeUtil.o : drakeUtil.cpp drakeUtil.h
	$(MEX) $< -c $(CFLAGS) # -fPIC

$(BINDIR)/libDrakeDebugMex.$(LIBEXT) : libDrakeDebugMex.cpp
	$(CXX) $(LIBFLAGS) -o $@ $^ $(MATLABFLAGS)

deleteMexPointer.$(MEXEXT) : deleteMexPointer.cpp drakeUtil.o

$(MEXFILES): %.$(MEXEXT) : %.cpp
	$(MEX) $^ $(CFLAGS)

$(BINDIR)/debugMex: debugMex.cpp
	$(CXX) -o $(BINDIR)/debugMex debugMex.cpp $(MATLABFLAGS)

clean:
	-rm -f *.o
	-rm -f *.$(MEXEXT)
	-rm -f $(BINEXES)
<commit_msg>makefile patch from Andres<commit_after>
CC = gcc
CXX = g++

MATLABROOT = $(strip $(shell cat ../.matlabroot))
MEX = $(MATLABROOT)/bin/mex
MEXEXT = $(shell $(MATLABROOT)/bin/mexext)    
MATLABBIN = $(MATLABROOT)/bin/$(strip $(shell cat ../.matlabcpu))
MATLABFLAGS = -I$(MATLABROOT)/extern/include -L$(MATLABBIN) -lmat -lmx -Wl,-rpath,$(MATLABBIN) -DMX_COMPAT_32

MEX_CPP_FILES = realtime.cpp deleteMexPointer.cpp
MEXFILES = $(MEX_CPP_FILES:%.cpp=%.$(MEXEXT))

UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
  # for mac:
  LIBEXT = dylib
  LIBFLAGS = -dynamiclib -flat_namespace
else
  # for everyone else:
  LIBEXT = so
  LIBFLAGS = -shared -fPIC
endif

EXES = debugMex libDrakeDebugMex.$(LIBEXT)

BINDIR = ../bin
BINEXES = $(EXES:%=$(BINDIR)/%)


SUBDIRS = test

all: MEX += -O
all: CXX += -O3
all : drakeUtil.o $(MEXFILES) $(BINEXES)
	@for subdir in $(SUBDIRS); do \
		echo "\n-------------------------------------------"; \
		echo "-- $$subdir"; \
		echo "-------------------------------------------"; \
		$(MAKE) -C $$subdir all || exit 2; \
	done

debug: MEX += -g
debug: CXX += -g
debug: drakeUtil.o $(MEXFILES) $(BINEXES)
	@for subdir in $(SUBDIRS); do \
		echo "\n-------------------------------------------"; \
		echo "-- $$subdir"; \
		echo "-------------------------------------------"; \
		$(MAKE) -C $$subdir debug || exit 2; \
	done

drakeUtil.o : drakeUtil.cpp drakeUtil.h
	$(MEX) $< -c $(CFLAGS) # -fPIC

$(BINDIR)/libDrakeDebugMex.$(LIBEXT) : libDrakeDebugMex.cpp
	$(CXX) $(LIBFLAGS) -o $@ $^ $(MATLABFLAGS)

deleteMexPointer.$(MEXEXT) : deleteMexPointer.cpp drakeUtil.o

$(MEXFILES): %.$(MEXEXT) : %.cpp
	$(MEX) $^ $(CFLAGS)

$(BINDIR)/debugMex: debugMex.cpp
	$(CXX) -o $(BINDIR)/debugMex debugMex.cpp $(MATLABFLAGS)

clean:
	-rm -f *.o
	-rm -f *.$(MEXEXT)
	-rm -f $(BINEXES)

{'fraction_non_alphanumeric': 0.2836374002280502, 'fraction_numerical': 0.0028506271379703536, 'mean_word_length': 2.4134241245136185, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2827147', 'n_tokens_mistral': 1433, 'n_tokens_neox': 1346, 'n_words': 306}