<commit_before># crashdetect makefile
#
# To compile crahdetect on Linux run make as follows:
#   make os=linux config=release
# Similarly, to build on Windows with MinGW/Cygwin:
#   make os=windows config=release
#
# Build prerequisites:
#  1) Programs
#     - gcc
#     - g++
#     - GNU make
#     - sed
#     - windres (Windows only)
#  1) Libraries
#     - Boost.Filesystem
#     - Boost.System 

CC  = gcc
CXX = g++

ifndef config
config = release
endif

ifeq ($(config),debug)
CPPFLAGS += -DDEBUG
CFLAGS += -g
CFLAGS += -Wall
endif

ifeq ($(config),release)
CPPFLAGS += -DNDEBUG
CFLAGS += -O2
CFLAGS += -Wno-attributes
endif

CFLAGS  += -m32
LDFLAGS += -m32

ifeq ($(os),windows)
CPPFLAGS += -D_WIN32 
LDFLAGS  += -Wl,--kill-at --def plugin.def
endif

ifeq ($(os),linux)
CPPFLAGS += -DLINUX
CFLAGS   += -fPIC
LDFLAGS  += -Wl,--no-undefined 
LDFLAGS  += -fPIC
endif

CPPFLAGS += -Isrc
CPPFLAGS += -Isrc/amx 
CPPFLAGS += -I$(BOOST_ROOT)
CPPFLAGS += -DHAVE_STDINT_H 
CPPFLAGS += -include stddef.h

CXXFLAGS += -std=c++98
CXXFLAGS += $(CFLAGS)

LDFLAGS  += -L$(BOOST_ROOT)/stage/src 
LDFLAGS  += -lboost_filesystem 
LDFLAGS  += -lboost_system 
LDFLAGS  += -ldl
LDFLAGS  += -shared

objects = src/amx/amx.c.o \
	  src/amx/amxaux.c.o \
	  src/amx/amxdbg.c.o \
	  src/logprintf.cpp.o \
          src/amxcallstack.cpp.o \
          src/amxdebuginfo.cpp.o \
	  src/amxerror.cpp.o \
          src/amxpathfinder.cpp.o \
          src/configreader.cpp.o \
          src/crash.cpp.o \
          src/crashdetect.cpp.o \
          src/interrupt.cpp.o \
          src/jump-x86.cpp.o \
          src/plugin.cpp.o

ifeq ($(os),windows)
objects += src/crashdetect.rc.o
endif

ifeq ($(os),windows)
binary = crashdetect.dll
endif

ifeq ($(os),linux)
binary = crashdetect.so
endif

all: $(binary)

$(binary): $(objects)
	$(CXX) $(LDFLAGS) -o $@ $?

src/amx/amx.c.o: src/amx/amx.c src/amx/amx.h src/amx/sclinux.h src/amx/getch.h src/amx/osdefs.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

src/amx/amxaux.c.o: src/amx/amxaux.c src/amx/amxaux.h src/amx/amx.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

src/amx/amxdbg.c.o: src/amx/amxdbg.c src/amx/amxdbg.h src/amx/amx.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

src/logprintf.cpp.o: src/logprintf.cpp src/logprintf.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

src/amxcallstack.cpp.o: src/amxcallstack.cpp src/amxcallstack.h src/amxdebuginfo.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/amxdebuginfo.cpp.o: src/amxdebuginfo.cpp src/amxdebuginfo.h src/amx/amx.h src/amx/amxdbg.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/amxerror.cpp.o: src/amxerror.cpp src/crashdetect.h src/amx/amx.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/amxpathfinder.cpp.o: src/amxpathfinder.cpp src/amxpathfinder.h src/amx/amx.h src/amx/amxaux.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/configreader.cpp.o: src/configreader.cpp src/configreader.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/crash.cpp.o: src/crash.cpp src/crash.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
	
src/crashdetect.cpp.o: src/crashdetect.cpp src/crashdetect.h src/amxcallstack.h src/amxdebuginfo.h \
                       src/amxpathfinder.h src/configreader.h src/jump-x86.h src/version.h \
                       src/logprintf.h src/plugincommon.h src/amx/amx.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/interrupt.cpp.o: src/interrupt.cpp src/interrupt.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/jump-x86.cpp.o: src/jump-x86.cpp src/jump-x86.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/plugin.cpp.o: src/plugin.cpp src/crashdetect.h src/logprintf.h src/plugincommon.h src/amx/amx.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

ifeq ($(os),windows)
src/plugin.rc.o: src/plugin.rc src/version.h
	windres $< $@
endif

src/version.h:
	echo "Generating $@..."
	sh ./version.h.sh > $@

clean:
	rm -vf $(objects) $(binary)

.PHONY: all version clean<commit_msg>Update GNUMakefile<commit_after># crashdetect makefile
#
# To compile crahdetect on *nix run make as follows:
#   make os=unix config=release
# Similarly, to build on Windows with MinGW/Cygwin:
#   make os=windows config=release
#
# Build prerequisites:
#  1) Programs
#     - gcc
#     - g++
#     - GNU make
#     - sed
#     - windres (Windows only)
#  1) Libraries
#     - Boost.Filesystem
#     - Boost.System 

CC  = gcc
CXX = g++

ifndef config
config = release
endif

ifeq ($(config),debug)
CPPFLAGS += -DDEBUG
CFLAGS += -g
CFLAGS += -Wall
endif

ifeq ($(config),release)
CPPFLAGS += -DNDEBUG
CFLAGS += -O2
CFLAGS += -Wno-attributes
endif

CFLAGS  += -m32
LDFLAGS += -m32

ifeq ($(os),windows)
CPPFLAGS += -D_WIN32 
LDFLAGS  += -Wl,--kill-at --def plugin.def
endif

ifeq ($(os),unix)
CPPFLAGS += -DLINUX
CFLAGS   += -fPIC
LDFLAGS  += -Wl,--no-undefined 
LDFLAGS  += -fPIC
endif

CPPFLAGS += -Isrc
CPPFLAGS += -Isrc/amx 
CPPFLAGS += -I$(BOOST_ROOT)
CPPFLAGS += -DHAVE_STDINT_H 
CPPFLAGS += -include stddef.h

CXXFLAGS += -std=c++98
CXXFLAGS += $(CFLAGS)

LDFLAGS  += -L$(BOOST_ROOT)/stage/src 
LDFLAGS  += -lboost_filesystem 
LDFLAGS  += -lboost_system 
LDFLAGS  += -ldl
LDFLAGS  += -shared

objects = src/amx/amx.c.o \
	  src/amx/amxaux.c.o \
	  src/amx/amxdbg.c.o \
          src/amxcallstack.cpp.o \
          src/amxdebuginfo.cpp.o \
	  src/amxerror.cpp.o \
          src/amxpathfinder.cpp.o \
          src/amxutils.cpp.o \
          src/configreader.cpp.o \
          src/crash.cpp.o \
          src/crashdetect.cpp.o \
          src/interrupt.cpp.o \
          src/jump-x86.cpp.o \
	  src/logprintf.cpp.o \
          src/plugin.cpp.o

ifeq ($(os),windows)
objects += src/os-win32.cpp.o
objects += src/plugin.rc.o
endif

ifeq ($(os),unix)
objects += src/os-unix.cpp.o
endif

ifeq ($(os),windows)
binary = crashdetect.dll
endif

ifeq ($(os),unix)
binary = crashdetect.so
endif

all: $(binary)

$(binary): $(objects)
	$(CXX) $(LDFLAGS) -o $@ $?

src/amx/amx.c.o: src/amx/amx.c src/amx/amx.h src/amx/sclinux.h src/amx/getch.h src/amx/osdefs.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

src/amx/amxaux.c.o: src/amx/amxaux.c src/amx/amxaux.h src/amx/amx.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

src/amx/amxdbg.c.o: src/amx/amxdbg.c src/amx/amxdbg.h src/amx/amx.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

src/amxcallstack.cpp.o: src/amxcallstack.cpp src/amxcallstack.h src/amxdebuginfo.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/amxdebuginfo.cpp.o: src/amxdebuginfo.cpp src/amxdebuginfo.h src/amx/amx.h src/amx/amxdbg.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/amxerror.cpp.o: src/amxerror.cpp src/crashdetect.h src/amx/amx.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/amxpathfinder.cpp.o: src/amxpathfinder.cpp src/amxpathfinder.h src/amx/amx.h src/amx/amxaux.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/amxutils.cpp.o: src/amxutils.cpp src/amxutils.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/configreader.cpp.o: src/configreader.cpp src/configreader.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/crash.cpp.o: src/crash.cpp src/crash.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
	
src/crashdetect.cpp.o: src/crashdetect.cpp src/crashdetect.h src/amxcallstack.h src/amxdebuginfo.h \
                       src/amxpathfinder.h src/configreader.h src/jump-x86.h src/version.h \
                       src/logprintf.h src/plugincommon.h src/amx/amx.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/interrupt.cpp.o: src/interrupt.cpp src/interrupt.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/jump-x86.cpp.o: src/jump-x86.cpp src/jump-x86.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/logprintf.cpp.o: src/logprintf.cpp src/logprintf.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

src/os-unix.cpp.o: src/os-unix.cpp src/os.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/os-win32.cpp.o: src/os-win32.cpp src/os.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/plugin.cpp.o: src/plugin.cpp src/crashdetect.h src/logprintf.h src/plugincommon.h src/amx/amx.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

src/plugin.rc.o: src/plugin.rc src/version.h
	windres $< $@

src/version.h:
	echo "Generating $@..."
	sh ./version.h.sh > $@

clean:
	rm -vf $(objects) $(binary)

.PHONY: all version clean
{'fraction_non_alphanumeric': 0.18956414978514427, 'fraction_numerical': 0.005893186003683241, 'mean_word_length': 2.8716730038022815, 'pattern_counts': {'":': 0, '<': 36, '<?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': '1394812', 'n_tokens_mistral': 3682, 'n_tokens_neox': 3459, 'n_words': 649}