<commit_before># A simple makefile.
#

default: all
-include .make.conf

CORE=.MAKEFILE-VERSION

# Pick one of:
#   linux
#   osx

UNAME=$(shell uname)
ifeq ($(UNAME),Darwin)
  OS=osx
else ifeq ($(UNAME),Linux)
  OS=linux
else ifeq ($(UNAME),FreeBSD)
  OS=bsd
else ifeq ($(UNAME),OpenBSD)
  OS=bsd
else
  $(error unknown unix)
endif

# Pick one of:
#   little
#   big
#
ENDIAN=little

# Binary directory - not in quotes.
#
BIN=bin

LIB=.

# Only include/link with this if it exists.
# (Mac OS X El Capitan clean install does not have /opt)
ifneq (,$(wildcard /opt/local/.))
  OPTLOCALINC=-I/opt/local/include
  OPTLOCALLIB=-L/opt/local/lib
endif

# Only include/link with this if it exists.
# (`brew install openssl` on Mac OS X El Capitan puts openssl here)
ifneq (,$(wildcard /usr/local/opt/openssl/.))
  OPENSSLINC=-I/usr/local/opt/openssl/include
  OPENSSLLIB=-L/usr/local/opt/openssl/lib
endif

RM=rm -f
ifneq ($(UNAME),FreeBSD)
CC=gcc
CXX=g++
CXXFLAGS=$(CFLAGS)
CLD=g++ -O3 -L/usr/local/lib $(OPTLOCALLIB) $(OPENSSLLIB)
else
CC=cc
CXX=c++
CXXFLAGS=$(CFLAGS)
CLD=c++ -O3 -L/usr/local/lib $(OPTLOCALLIB) $(OPENSSLLIB)
endif

ifeq ($(OS),osx)
  COSFLAGS=-fno-diagnostics-fixit-info
  CLDOSFLAGS=-bind_at_load
  OSLIBS=-framework CoreServices -framework CoreFoundation
endif
ifeq ($(OS),linux)
  OSLIBS=-lpthread -lrt -lcurses -lz
  DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
endif
ifeq ($(OS),bsd)
  OSLIBS=-lpthread -lncurses -lkvm
endif

ifeq ($(STATIC),yes)
LIBS=-lssl -lcrypto -lncurses /usr/local/lib/libsigsegv.a /usr/local/lib/libgmp.a $(OSLIBS)
else
LIBS=-lssl -lcrypto -lgmp -lncurses -lsigsegv $(OSLIBS)
endif

INCLUDE=include
MDEFINES=-DU3_OS_$(OS) -DU3_OS_ENDIAN_$(ENDIAN) -D U3_LIB=\"$(LIB)\"

DEBUG=no

ifeq ($(DEBUG),yes)
DEBUGFLAGS=-g
else
DEBUGFLAGS=-O3
endif

# libuv version
#LIBUV_VER=libuv_0.11
LIBUV_VER=libuv-v1.7.5

ifeq ($(LIBUV_VER),libuv_0.11)
LIBUV_CONFIGURE_OPTIONS=--disable-dtrace
else
LIBUV_CONFIGURE_OPTIONS=
endif

# NOTFORCHECKIN - restore -O3
# 	-DGHETTO \
#   -DHUSH
CFLAGS= $(COSFLAGS) $(DEBUGFLAGS) -DGHETTO -ffast-math \
	-funsigned-char \
	-I/usr/local/include \
	$(OPTLOCALINC) \
	$(OPENSSLINC) \
	-I$(INCLUDE) \
	-Ioutside/$(LIBUV_VER)/include \
	-Ioutside/anachronism/include \
	-Ioutside/ed25519/src \
	-Ioutside/commonmark/src \
	-Ioutside/commonmark/build/src \
	-Ioutside/scrypt \
	-Ioutside/softfloat-3/source/include \
	-Ioutside/murmur3 \
	$(DEFINES) \
	$(MDEFINES)

# TODO remove -Wno-*
CWFLAGS=-Wall \
        -Wextra \
        -Wno-sign-compare \
        -Wno-unused-parameter \
        -Wno-missing-field-initializers \
        -Wno-strict-aliasing \
        -Werror
ifneq ($(OS),bsd)
  CWFLAGS+=-Wno-error=unused-result<commit_msg>Don't be ghetto.<commit_after># A simple makefile.
#

default: all
-include .make.conf

CORE=.MAKEFILE-VERSION

# Pick one of:
#   linux
#   osx

UNAME=$(shell uname)
ifeq ($(UNAME),Darwin)
  OS=osx
else ifeq ($(UNAME),Linux)
  OS=linux
else ifeq ($(UNAME),FreeBSD)
  OS=bsd
else ifeq ($(UNAME),OpenBSD)
  OS=bsd
else
  $(error unknown unix)
endif

# Pick one of:
#   little
#   big
#
ENDIAN=little

# Binary directory - not in quotes.
#
BIN=bin

LIB=.

# Only include/link with this if it exists.
# (Mac OS X El Capitan clean install does not have /opt)
ifneq (,$(wildcard /opt/local/.))
  OPTLOCALINC=-I/opt/local/include
  OPTLOCALLIB=-L/opt/local/lib
endif

# Only include/link with this if it exists.
# (`brew install openssl` on Mac OS X El Capitan puts openssl here)
ifneq (,$(wildcard /usr/local/opt/openssl/.))
  OPENSSLINC=-I/usr/local/opt/openssl/include
  OPENSSLLIB=-L/usr/local/opt/openssl/lib
endif

RM=rm -f
ifneq ($(UNAME),FreeBSD)
CC=gcc
CXX=g++
CXXFLAGS=$(CFLAGS)
CLD=g++ -O3 -L/usr/local/lib $(OPTLOCALLIB) $(OPENSSLLIB)
else
CC=cc
CXX=c++
CXXFLAGS=$(CFLAGS)
CLD=c++ -O3 -L/usr/local/lib $(OPTLOCALLIB) $(OPENSSLLIB)
endif

ifeq ($(OS),osx)
  COSFLAGS=-fno-diagnostics-fixit-info
  CLDOSFLAGS=-bind_at_load
  OSLIBS=-framework CoreServices -framework CoreFoundation
endif
ifeq ($(OS),linux)
  OSLIBS=-lpthread -lrt -lcurses -lz
  DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
endif
ifeq ($(OS),bsd)
  OSLIBS=-lpthread -lncurses -lkvm
endif

ifeq ($(STATIC),yes)
LIBS=-lssl -lcrypto -lncurses /usr/local/lib/libsigsegv.a /usr/local/lib/libgmp.a $(OSLIBS)
else
LIBS=-lssl -lcrypto -lgmp -lncurses -lsigsegv $(OSLIBS)
endif

INCLUDE=include
MDEFINES=-DU3_OS_$(OS) -DU3_OS_ENDIAN_$(ENDIAN) -D U3_LIB=\"$(LIB)\"

DEBUG=no

ifeq ($(DEBUG),yes)
DEBUGFLAGS=-g
else
DEBUGFLAGS=-O3
endif

# libuv version
#LIBUV_VER=libuv_0.11
LIBUV_VER=libuv-v1.7.5

ifeq ($(LIBUV_VER),libuv_0.11)
LIBUV_CONFIGURE_OPTIONS=--disable-dtrace
else
LIBUV_CONFIGURE_OPTIONS=
endif

# NOTFORCHECKIN - restore -O3
# 	-DGHETTO \
#   -DHUSH
CFLAGS= $(COSFLAGS) $(DEBUGFLAGS) -ffast-math \
	-funsigned-char \
	-I/usr/local/include \
	$(OPTLOCALINC) \
	$(OPENSSLINC) \
	-I$(INCLUDE) \
	-Ioutside/$(LIBUV_VER)/include \
	-Ioutside/anachronism/include \
	-Ioutside/ed25519/src \
	-Ioutside/commonmark/src \
	-Ioutside/commonmark/build/src \
	-Ioutside/scrypt \
	-Ioutside/softfloat-3/source/include \
	-Ioutside/murmur3 \
	$(DEFINES) \
	$(MDEFINES)

# TODO remove -Wno-*
CWFLAGS=-Wall \
        -Wextra \
        -Wno-sign-compare \
        -Wno-unused-parameter \
        -Wno-missing-field-initializers \
        -Wno-strict-aliasing \
        -Werror
ifneq ($(OS),bsd)
  CWFLAGS+=-Wno-error=unused-result
{'fraction_non_alphanumeric': 0.15702632554690396, 'fraction_numerical': 0.010011123470522803, 'mean_word_length': 3.6994773519163764, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7399046', 'n_tokens_mistral': 2381, 'n_tokens_neox': 2261, 'n_words': 440}