<commit_before>
.SUFFIXES:
.SUFFIXES: .cpp .c .o

.PHONY: $(SUBDIRS)

ifeq ($(DEBUG_MAKE),)
SILENT=@
else
SILENT=
endif

# diretrios de destino de programas e bibliotecas
BINDIR = $(RALLY_ROOT)/bin
LIBDIR = $(RALLY_ROOT)/bin/lib
APPDIR = $(RALLY_ROOT)/bin/app
SRCDIR = $(RALLY_ROOT)/src
TSTDIR = $(RALLY_ROOT)/tst
TSTBIN = $(TSTDIR)/bin
MCKDIR = $(RALLY_ROOT)/mck
MCKBIN = $(MCKDIR)/bin

INCDIR =	\
			-I ./ \
			-I $(SRCDIR) \
			-I $(BOOST_ROOT) \

INCLIBDIR = -L$(LIBDIR) \

# miscellaneous OS-dependent stuff
SHELL = /bin/sh
# make
MAKE = make
# nome do seu compilador C
CC = gcc
# nome do compilador c++
CXX = g++
# nome link editor
LD = ld
# comando de criao de arquivo de biblioteca (.a)
AR = ar rc
# segundo passo na criao de uma biblioteca .a (use "touch" se no for necessrio)
AR2 = ranlib
# strip de biblioteca
STRIP = strip
# deleo de arquivo
RM = rm -f
# move de arquivo
MV = mv
# echo
ECHO = @echo

CFLAGS += -DRELEASE -DNDEBUG -Wall -Werror -Wparentheses -fpic -Os $(INCDIR)
CPPFLAGS = $(CFLAGS) -fno-enforce-eh-specs -pedantic-errors -Wno-long-long -std=c++11

.cpp.o:
	$(ECHO) "[C++   ] $< "
	$(SILENT)$(CXX) -c $(CPPFLAGS) $(LCPPFLAGS) $< -o $@

.c.o:
	$(ECHO) "[C     ] $< "
	$(SILENT)$(CC) -c $(CFLAGS) $(LCFLAGS) $< -o $@

ifneq ($(LIBA),)
$(LIBA): $(OBJS)
	$(ECHO) "[AR    ] $@ "
	$(SILENT)$(RM) $@
	$(SILENT)$(AR) $@ $(OBJS)
	$(SILENT)$(AR2) $@
ifneq ($(MOVE_TO_BINDIR),)
	$(SILENT)$(RM) $(DESTLIBDIR)/$@
	$(SILENT)$(MV) $@ $(DESTLIBDIR)
endif
endif

ifneq ($(LIBSO),)
$(LIBSO): $(OBJS)
	$(ECHO) "[SO    ] $@ "
	$(SILENT)$(RM) $@
ifdef  PROF
	$(SILENT)$(CXX) -pg -shared -o $@ $(OBJS) $(ARFILES) $(LIBFLAGS)
else
	$(SILENT)$(CXX) -shared -o $@ $(OBJS) $(ARFILES) $(LIBFLAGS)
endif
ifneq ($(MOVE_TO_BINDIR),)
	$(SILENT)$(RM) $(DESTLIBDIR)/$@
	$(SILENT)$(MV) $@ $(DESTLIBDIR)
endif
endif

exetarget: directory_message $(EXE) $(SUBDIRS)

ifneq ($(EXE),)
$(EXE): $(OBJS) $(OTHER_OBJS) $(LIBDIR) $(MAIN_CPP) $(OTHERLIBDIR)
	$(ECHO) "[EXE   ] $@ "
	$(SILENT)$(RM) $@
	$(SILENT)$(CXX) $(EXEFLAGS) -o $@ $(OBJS) $(OTHER_OBJS) $(INCLIBDIR) $(OTHERINCLIBDIR) $(OTHER_EXE_PARMS) $(LIBS)
ifneq ($(MOVE_TO_BINDIR),)
	$(SILENT)$(RM) $(APPDIR)/$(EXE)
	$(SILENT)$(MV) $@ $(APPDIR)
endif
endif

# if there are .o files to be created, create depend.mk
depend: warning_env depend_local $(SUBDIRS)

depend_local:
ifneq ($(strip $(OBJS)),)
	$(ECHO) "[DEPEND] $(subst $(RALLY_ROOT),,$(shell pwd)) "
	$(SILENT)$(CXX) -MM $(CPPFLAGS) $(LCFLAGS) $(subst .o,.c*,$(OBJS)) > depend.mk

-include depend.mk
endif

format: directory_message format_local $(SUBDIRS)

format_local:
ifneq ($(strip $(shell ls *.h 2>/dev/null)),)
	$(SILENT)astyle.sh *.h
endif
ifneq ($(strip $(shell ls *.cpp 2>/dev/null)),)
	$(SILENT)astyle.sh *.cpp
endif
ifneq ($(strip $(shell ls *.c 2>/dev/null)),)
	$(SILENT)astyle.sh *.c
endif

$(SUBDIRS):
	$(SILENT)$(MAKE) $(MAKECMDGOALS) --no-print-directory -C $@

warning_env:
	@if test "$(RALLY_ROOT)+set" = "+set" ;\
	then echo "==========================================================="     ;\
	echo "Error: the environment variable RALLY_ROOT is undefined"              ;\
	echo "       define it and then run the command make"                       ;\
	echo "       ex: export RALLY_ROOT=~/projects/rally-clone-game"             ;\
	echo "==========================================================="          ;\<commit_msg>eliminating the need to have a shell for astyle<commit_after>
.SUFFIXES:
.SUFFIXES: .cpp .c .o

.PHONY: $(SUBDIRS)

ifeq ($(DEBUG_MAKE),)
SILENT=@
else
SILENT=
endif

# diretrios de destino de programas e bibliotecas
BINDIR = $(RALLY_ROOT)/bin
LIBDIR = $(RALLY_ROOT)/bin/lib
APPDIR = $(RALLY_ROOT)/bin/app
SRCDIR = $(RALLY_ROOT)/src
TSTDIR = $(RALLY_ROOT)/tst
TSTBIN = $(TSTDIR)/bin
MCKDIR = $(RALLY_ROOT)/mck
MCKBIN = $(MCKDIR)/bin

INCDIR =	\
			-I ./ \
			-I $(SRCDIR) \
			-I $(BOOST_ROOT) \

INCLIBDIR = -L$(LIBDIR) \

# miscellaneous OS-dependent stuff
SHELL = /bin/sh
# make
MAKE = make
# nome do seu compilador C
CC = gcc
# nome do compilador c++
CXX = g++
# nome link editor
LD = ld
# comando de criao de arquivo de biblioteca (.a)
AR = ar rc
# segundo passo na criao de uma biblioteca .a (use "touch" se no for necessrio)
AR2 = ranlib
# strip de biblioteca
STRIP = strip
# deleo de arquivo
RM = rm -f
# move de arquivo
MV = mv
# echo
ECHO = @echo

CFLAGS += -DRELEASE -DNDEBUG -Wall -Werror -Wparentheses -fpic -Os $(INCDIR)
CPPFLAGS = $(CFLAGS) -fno-enforce-eh-specs -pedantic-errors -Wno-long-long -std=c++11

.cpp.o:
	$(ECHO) "[C++   ] $< "
	$(SILENT)$(CXX) -c $(CPPFLAGS) $(LCPPFLAGS) $< -o $@

.c.o:
	$(ECHO) "[C     ] $< "
	$(SILENT)$(CC) -c $(CFLAGS) $(LCFLAGS) $< -o $@

ifneq ($(LIBA),)
$(LIBA): $(OBJS)
	$(ECHO) "[AR    ] $@ "
	$(SILENT)$(RM) $@
	$(SILENT)$(AR) $@ $(OBJS)
	$(SILENT)$(AR2) $@
ifneq ($(MOVE_TO_BINDIR),)
	$(SILENT)$(RM) $(DESTLIBDIR)/$@
	$(SILENT)$(MV) $@ $(DESTLIBDIR)
endif
endif

ifneq ($(LIBSO),)
$(LIBSO): $(OBJS)
	$(ECHO) "[SO    ] $@ "
	$(SILENT)$(RM) $@
ifdef  PROF
	$(SILENT)$(CXX) -pg -shared -o $@ $(OBJS) $(ARFILES) $(LIBFLAGS)
else
	$(SILENT)$(CXX) -shared -o $@ $(OBJS) $(ARFILES) $(LIBFLAGS)
endif
ifneq ($(MOVE_TO_BINDIR),)
	$(SILENT)$(RM) $(DESTLIBDIR)/$@
	$(SILENT)$(MV) $@ $(DESTLIBDIR)
endif
endif

exetarget: directory_message $(EXE) $(SUBDIRS)

ifneq ($(EXE),)
$(EXE): $(OBJS) $(OTHER_OBJS) $(LIBDIR) $(MAIN_CPP) $(OTHERLIBDIR)
	$(ECHO) "[EXE   ] $@ "
	$(SILENT)$(RM) $@
	$(SILENT)$(CXX) $(EXEFLAGS) -o $@ $(OBJS) $(OTHER_OBJS) $(INCLIBDIR) $(OTHERINCLIBDIR) $(OTHER_EXE_PARMS) $(LIBS)
ifneq ($(MOVE_TO_BINDIR),)
	$(SILENT)$(RM) $(APPDIR)/$(EXE)
	$(SILENT)$(MV) $@ $(APPDIR)
endif
endif

# if there are .o files to be created, create depend.mk
depend: warning_env depend_local $(SUBDIRS)

depend_local:
ifneq ($(strip $(OBJS)),)
	$(ECHO) "[DEPEND] $(subst $(RALLY_ROOT),,$(shell pwd)) "
	$(SILENT)$(CXX) -MM $(CPPFLAGS) $(LCFLAGS) $(subst .o,.c*,$(OBJS)) > depend.mk

-include depend.mk
endif

format: directory_message format_local $(SUBDIRS)

format_local:
ifneq ($(strip $(shell ls *.h 2>/dev/null)),)
	$(SILENT)astyle *.h
endif
ifneq ($(strip $(shell ls *.cpp 2>/dev/null)),)
	$(SILENT)astyle *.cpp
endif
ifneq ($(strip $(shell ls *.c 2>/dev/null)),)
	$(SILENT)astyle *.c
endif

$(SUBDIRS):
	$(SILENT)$(MAKE) $(MAKECMDGOALS) --no-print-directory -C $@

warning_env:
	@if test "$(RALLY_ROOT)+set" = "+set" ;\
	then echo "==========================================================="     ;\
	echo "Error: the environment variable RALLY_ROOT is undefined"              ;\
	echo "       define it and then run the command make"                       ;\
	echo "       ex: export RALLY_ROOT=~/projects/rally-clone-game"             ;\
	echo "==========================================================="          ;\
{'fraction_non_alphanumeric': 0.2417697005809623, 'fraction_numerical': 0.0020855057351407717, 'mean_word_length': 4.002980625931445, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2695730', 'n_tokens_mistral': 2972, 'n_tokens_neox': 2783, 'n_words': 666}